Index: src/parsing/pattern-rewriter.cc |
diff --git a/src/parsing/pattern-rewriter.cc b/src/parsing/pattern-rewriter.cc |
index e699255cdb38b8932fdd2dbf10b718f8d21bfd80..a9d2051b18c1ba30c64ee01db4b46d163fb87d75 100644 |
--- a/src/parsing/pattern-rewriter.cc |
+++ b/src/parsing/pattern-rewriter.cc |
@@ -272,15 +272,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); |