Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Unified Diff: src/parser.cc

Issue 12459011: Avoid bool to Oddball conversions by being lazy. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 62b633ea2807f4edbfed4d6147196058f3745ec9..632215aaa11582238d0b3e1d339ceb84bcab915a 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -3212,7 +3212,7 @@ Expression* Parser::ParseUnaryExpression(bool* ok) {
Handle<Object> literal = expression->AsLiteral()->handle();
if (op == Token::NOT) {
// Convert the literal to a boolean condition and negate it.
- bool condition = literal->ToBoolean()->IsTrue();
+ bool condition = literal->BooleanValue();
Handle<Object> result(isolate()->heap()->ToBoolean(!condition),
isolate());
return factory()->NewLiteral(result);
« no previous file with comments | « src/objects.cc ('k') | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698