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

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: Statically resolve "this" even inside "with" 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
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index 87d347d4c56491499b05c55bdf05fac38c3b8435..89ef48b7f4e0ad0a976f11ed23e4dc96998cace4 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -740,7 +740,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/ia32/lithium-codegen-ia32.cc ('k') | src/runtime/runtime-debug.cc » ('j') | src/scopeinfo.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698