Index: src/parser.cc |
diff --git a/src/parser.cc b/src/parser.cc |
index a08148c5974f3de8fb882935b774afd1e0d20abf..49e76618ca6fbea9b0787b3ced1ca9050eeb37e5 100644 |
--- a/src/parser.cc |
+++ b/src/parser.cc |
@@ -525,7 +525,7 @@ Expression* ParserTraits::BuildUnaryExpression( |
Expression* expression, Token::Value op, int pos, |
AstNodeFactory<AstConstructionVisitor>* factory) { |
ASSERT(expression != NULL); |
- if (expression->AsLiteral() != NULL) { |
+ if (expression->IsLiteral()) { |
Handle<Object> literal = expression->AsLiteral()->value(); |
if (op == Token::NOT) { |
// Convert the literal to a boolean condition and negate it. |
@@ -3224,7 +3224,7 @@ void Parser::ReportInvalidCachedData(Handle<String> name, bool* ok) { |
bool CompileTimeValue::IsCompileTimeValue(Expression* expression) { |
- if (expression->AsLiteral() != NULL) return true; |
+ if (expression->IsLiteral()) return true; |
MaterializedLiteral* lit = expression->AsMaterializedLiteral(); |
return lit != NULL && lit->is_simple(); |
} |