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

Unified Diff: src/parser.cc

Issue 1097283003: Resolve references to "this" the same way as normal variables (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Add tests for "this" scoping in arrow functions Created 5 years, 8 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 | « src/heap/heap.h ('k') | src/runtime/runtime-debug.cc » ('j') | src/scopes.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 056d34a42faf80946de4c9f5a1a43ce0930c8d66..d3ac57e4fe6731a5a6132d27a2fab773b98a295b 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -739,7 +739,9 @@ 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,
+ parser_->ast_value_factory()->this_string(), pos,
+ pos + 4, Variable::THIS);
}
Expression* ParserTraits::SuperReference(Scope* scope, AstNodeFactory* factory,
« no previous file with comments | « src/heap/heap.h ('k') | src/runtime/runtime-debug.cc » ('j') | src/scopes.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698