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

Unified Diff: src/parser.cc

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/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 51e79bb14cf1c6519de925d6bb1434e06ccc225f..73afb0b541efd6fc7f672af4b9c46d4c529276fd 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -674,7 +674,11 @@ const AstRawString* ParserTraits::GetNextSymbol(Scanner* scanner) {
Expression* ParserTraits::ThisExpression(Scope* scope, AstNodeFactory* factory,
int pos) {
- return factory->NewVariableProxy(scope->receiver(), pos);
+ return scope->NewUnresolved(factory,
+ ast_value_factory()->this_string(),
+ Interface::NewValue(),
+ RelocInfo::kNoPosition,
+ true);
}
Expression* ParserTraits::SuperReference(Scope* scope, AstNodeFactory* factory,

Powered by Google App Engine
This is Rietveld 408576698