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

Unified Diff: src/ast/ast.cc

Issue 1813913004: An undefined literal should match as an undefined literal. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/ast.cc
diff --git a/src/ast/ast.cc b/src/ast/ast.cc
index 43670ad8a5a2c87c134e41e84bc0384f0d417eb9..c055545c4ef4e715fb33cd4fe731cbe03fdc7cf4 100644
--- a/src/ast/ast.cc
+++ b/src/ast/ast.cc
@@ -64,6 +64,10 @@ bool Expression::IsNullLiteral() const {
bool Expression::IsUndefinedLiteral(Isolate* isolate) const {
+ if (IsLiteral() && AsLiteral()->value()->IsUndefined()) {
+ return true;
+ }
+
const VariableProxy* var_proxy = AsVariableProxy();
if (var_proxy == NULL) return false;
Variable* var = var_proxy->var();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698