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

Unified Diff: src/parser.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 | « no previous file | src/pattern-rewriter.cc » ('j') | src/pattern-rewriter.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/parser.cc
diff --git a/src/parser.cc b/src/parser.cc
index f122d9aa5e4b57ff1459cfa48e060c666bd407ff..8a6f2ebd9c6e445070e0cde3c4abaa567e7d64e9 100644
--- a/src/parser.cc
+++ b/src/parser.cc
@@ -2553,7 +2553,9 @@ void Parser::ParseVariableDeclarations(VariableDeclarationContext var_context,
is_for_iteration_variable =
var_context == kForStatement &&
(peek() == Token::IN || PeekContextualKeyword(CStrVector("of")));
- if (is_for_iteration_variable && parsing_result->descriptor.mode == CONST) {
+ if (is_for_iteration_variable &&
+ (parsing_result->descriptor.mode == CONST ||
+ parsing_result->descriptor.mode == CONST_LEGACY)) {
parsing_result->descriptor.needs_init = false;
}
« no previous file with comments | « no previous file | src/pattern-rewriter.cc » ('j') | src/pattern-rewriter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698