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

Unified Diff: src/pattern-rewriter.cc

Issue 1385913003: Fix legacy const for-of/in destructuring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rephrasing suggested by Adam Created 5 years, 2 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/parser.cc ('k') | test/mjsunit/harmony/destructuring.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pattern-rewriter.cc
diff --git a/src/pattern-rewriter.cc b/src/pattern-rewriter.cc
index 4bfeae4400ef2b75e5f35c2a7cf07a095828a79d..51cc33998da866d8293283dd1c3db68fc7365efe 100644
--- a/src/pattern-rewriter.cc
+++ b/src/pattern-rewriter.cc
@@ -175,7 +175,7 @@ void Parser::PatternRewriter::VisitVariableProxy(VariableProxy* pattern) {
factory()->NewExpressionStatement(initialize, RelocInfo::kNoPosition),
zone());
}
- } else if (value != nullptr && (descriptor_->needs_init ||
+ } else if (value != nullptr && (descriptor_->mode == CONST_LEGACY ||
adamk 2015/10/05 22:17:51 I like this better, too; the old code is very odd
IsLexicalVariableMode(descriptor_->mode))) {
// Constant initializations always assign to the declared constant which
// is always at the function scope level. This is only relevant for
« no previous file with comments | « src/parser.cc ('k') | test/mjsunit/harmony/destructuring.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698