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

Unified Diff: src/parsing/preparser.h

Issue 2683563002: [parser] Skipping inner funcs: produce the same scopes / variables for this expressions. (Closed)
Patch Set: oops cannot assign this Created 3 years, 10 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 | « no previous file | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/preparser.h
diff --git a/src/parsing/preparser.h b/src/parsing/preparser.h
index 6ff3b46c7dfc7aedbe71efe3a86b9e3121c78958..3c72fcca1c113c150d85e0bf01a64510383ba9cf 100644
--- a/src/parsing/preparser.h
+++ b/src/parsing/preparser.h
@@ -203,9 +203,10 @@ class PreParserExpression {
IsUseAsmField::encode(true));
}
- static PreParserExpression This() {
+ static PreParserExpression This(ZoneList<VariableProxy*>* variables) {
return PreParserExpression(TypeField::encode(kExpression) |
- ExpressionTypeField::encode(kThisExpression));
+ ExpressionTypeField::encode(kThisExpression),
+ variables);
}
static PreParserExpression ThisProperty() {
@@ -1494,7 +1495,19 @@ class PreParser : public ParserBase<PreParser> {
}
V8_INLINE PreParserExpression ThisExpression(int pos = kNoSourcePosition) {
- return PreParserExpression::This();
+ ZoneList<VariableProxy*>* variables = nullptr;
+ if (track_unresolved_variables_) {
+ AstNodeFactory factory(ast_value_factory());
+ // Setting the Zone is necessary because zone_ might be the temp Zone, and
+ // AstValueFactory doesn't know about it.
+ factory.set_zone(zone());
+ VariableProxy* proxy = scope()->NewUnresolved(
+ &factory, ast_value_factory()->this_string(), pos, THIS_VARIABLE);
+
+ variables = new (zone()) ZoneList<VariableProxy*>(1, zone());
+ variables->Add(proxy, zone());
+ }
+ return PreParserExpression::This(variables);
}
V8_INLINE PreParserExpression NewSuperPropertyReference(int pos) {
« no previous file with comments | « no previous file | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698