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

Unified Diff: src/parsing/pattern-rewriter.cc

Issue 2233473002: Redirect most NewUnresolved calls over Parser (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 4 years, 4 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/parsing/pattern-rewriter.cc
diff --git a/src/parsing/pattern-rewriter.cc b/src/parsing/pattern-rewriter.cc
index 2810c3506b165c352ab5dfeeb413cc4c90756437..cb47b572166b3cb8ff551303d86f78c08782f285 100644
--- a/src/parsing/pattern-rewriter.cc
+++ b/src/parsing/pattern-rewriter.cc
@@ -147,7 +147,12 @@ void Parser::PatternRewriter::VisitVariableProxy(VariableProxy* pattern) {
// pre-resolve the proxy because it resides in the same scope as the
// declaration.
const AstRawString* name = pattern->raw_name();
- VariableProxy* proxy = parser_->NewUnresolved(name, descriptor_->mode);
+ Scope* scope = IsLexicalVariableMode(descriptor_->mode)
+ ? parser_->scope()
+ : parser_->GetDeclarationScope();
+ VariableProxy* proxy = scope->NewUnresolved(
adamk 2016/08/10 17:37:43 I think this should just be unconditionally create
+ factory(), name, parser_->scanner()->location().beg_pos,
+ parser_->scanner()->location().end_pos);
Declaration* declaration = factory()->NewVariableDeclaration(
proxy, descriptor_->mode, descriptor_->scope,
descriptor_->declaration_pos);
« src/parsing/parser.cc ('K') | « src/parsing/parser-base.h ('k') | src/parsing/preparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698