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

Unified Diff: src/ast.h

Issue 883823002: Implement proper scoping for "this" in arrow functions Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Make sure an unresolved VariableProxy for "this" is not considered a valid LHS Created 5 years, 11 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
Index: src/ast.h
diff --git a/src/ast.h b/src/ast.h
index 4903928456dd540cce2cfbdae6f17e3c058b731e..6ef9063302d4137dc6ab5e52436ff31254db069d 100644
--- a/src/ast.h
+++ b/src/ast.h
@@ -1630,7 +1630,7 @@ class VariableProxy FINAL : public Expression {
DECLARE_NODE_TYPE(VariableProxy)
bool IsValidReferenceExpression() const OVERRIDE {
- return !is_resolved() || var()->IsValidReference();
+ return !is_this() && (!is_resolved() || var()->IsValidReference());
wingo 2015/02/04 10:02:13 So it used to be that we would eagerly resolve "th
aperez 2015/02/04 21:00:42 Acknowledged. Also, I am going to write it as:
}
bool IsArguments() const { return is_resolved() && var()->is_arguments(); }

Powered by Google App Engine
This is Rietveld 408576698