Chromium Code Reviews

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

Issue 1836183002: Remove vestigial legacy const handling from parser (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
« src/parsing/parser.cc ('K') | « 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 3ecffb99dbd763f26a5a13756092fb5e8006a64b..6903607246f7ff173f504b234514ac94fba0143d 100644
--- a/src/parsing/pattern-rewriter.cc
+++ b/src/parsing/pattern-rewriter.cc
@@ -268,15 +268,9 @@ void Parser::PatternRewriter::VisitVariableProxy(VariableProxy* pattern) {
factory()->NewExpressionStatement(initialize, initialize->position()),
zone());
}
- } else if (value != nullptr && (descriptor_->mode == CONST_LEGACY ||
- IsLexicalVariableMode(descriptor_->mode))) {
- // Constant initializations always assign to the declared constant which
- // is always at the function scope level. This is only relevant for
- // dynamically looked-up variables and constants (the
- // start context for constant lookups is always the function context,
- // while it is the top context for var declared variables). Sigh...
- // For 'let' and 'const' declared variables in harmony mode the
- // initialization also always assigns to the declared variable.
+ } else if (value != nullptr && IsLexicalVariableMode(descriptor_->mode)) {
+ // For 'let' and 'const' declared variables the initialization always
+ // assigns to the declared variable.
DCHECK_NOT_NULL(proxy);
DCHECK_NOT_NULL(proxy->var());
DCHECK_NOT_NULL(value);
« src/parsing/parser.cc ('K') | « src/parsing/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine