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

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

Issue 2685293003: [parsing] Fix maybe-assigned for top-level class declarations. (Closed)
Patch Set: 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 | « src/parsing/parser.cc ('k') | 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/pattern-rewriter.cc
diff --git a/src/parsing/pattern-rewriter.cc b/src/parsing/pattern-rewriter.cc
index 2dad31d8d3a0d1723c392ae3083c746db62ca6ba..6d2ed3d8bb05af405030c8211b708fab7d52cc94 100644
--- a/src/parsing/pattern-rewriter.cc
+++ b/src/parsing/pattern-rewriter.cc
@@ -171,12 +171,10 @@ void Parser::PatternRewriter::VisitVariableProxy(VariableProxy* pattern) {
names_->Add(name, zone());
}
- Scope* var_init_scope = descriptor_->scope;
- MarkTopLevelVariableAsAssigned(var_init_scope, proxy);
-
// If there's no initializer, we're done.
if (value == nullptr) return;
+ Scope* var_init_scope = descriptor_->scope;
MarkLoopVariableAsAssigned(var_init_scope, proxy->var());
// A declaration of the form:
« no previous file with comments | « src/parsing/parser.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698