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

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

Issue 2223843002: [ast][parsing] Variable declaration cleanups. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase and make DefaultInitializationFlag static. 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
« no previous file with comments | « src/parsing/parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parsing/pattern-rewriter.cc
diff --git a/src/parsing/pattern-rewriter.cc b/src/parsing/pattern-rewriter.cc
index 2e3695541b63dfaf12c3f3298775a2df391085a2..2810c3506b165c352ab5dfeeb413cc4c90756437 100644
--- a/src/parsing/pattern-rewriter.cc
+++ b/src/parsing/pattern-rewriter.cc
@@ -152,13 +152,13 @@ void Parser::PatternRewriter::VisitVariableProxy(VariableProxy* pattern) {
proxy, descriptor_->mode, descriptor_->scope,
descriptor_->declaration_pos);
Variable* var = parser_->Declare(declaration, descriptor_->declaration_kind,
+ DefaultInitializationFlag(descriptor_->mode),
ok_, descriptor_->hoist_scope);
if (!*ok_) return;
DCHECK_NOT_NULL(var);
DCHECK(!proxy->is_resolved() || proxy->var() == var);
- var->set_initializer_position(initializer_position_);
-
DCHECK(initializer_position_ != kNoSourcePosition);
+ var->set_initializer_position(initializer_position_);
// TODO(adamk): This should probably be checking hoist_scope.
// Move it to Parser::Declare() to make it easier to test
« no previous file with comments | « src/parsing/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698