Commit 24291c32 authored by nikolaos's avatar nikolaos Committed by Commit bot

[parser] Rewritable expressions should not be valid variable references

This patch restores the status of rewritable expressions, which
were not considered valid variable references before CL 2126233002,
regardless of the type of the wrapped expression.

R=mstarzinger@chromium.org, verwaest@chromium.org
BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2158853002
Cr-Commit-Position: refs/heads/master@{#37864}
parent 09a854c7
...@@ -125,6 +125,10 @@ bool Expression::ToBooleanIsFalse() const { ...@@ -125,6 +125,10 @@ bool Expression::ToBooleanIsFalse() const {
} }
bool Expression::IsValidReferenceExpression() 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;
return IsProperty() || return IsProperty() ||
(IsVariableProxy() && AsVariableProxy()->IsValidReferenceExpression()); (IsVariableProxy() && AsVariableProxy()->IsValidReferenceExpression());
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment