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

Unified Diff: src/ast/ast.cc

Issue 2158853002: [parser] Rewritable expressions should not be valid variable references (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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 1554a5e0b9761856b86ba99263743dc96c6627db..8529b5b445133571f9ceeb7c042f52f641d731df 100644
--- a/src/ast/ast.cc
+++ b/src/ast/ast.cc
@@ -125,6 +125,10 @@ bool Expression::ToBooleanIsFalse() const {
}
bool Expression::IsValidReferenceExpression() const {
+ // We don't want expressions wrapped inside RewritableExpression to be
+ // considered as valid reference expressions, as they will be rewritten
+ // to something (most probably involving a do expression).
+ if (IsRewritableExpression()) return false;
Michael Starzinger 2016/07/18 13:08:04 I am confused, how can the below predicate return
Michael Starzinger 2016/07/18 13:10:13 Ah, now I see, the IsFoo predicates actually speci
nickie 2016/07/18 13:13:18 That's the point. They never should be. They nev
return IsProperty() ||
(IsVariableProxy() && AsVariableProxy()->IsValidReferenceExpression());
}
« 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