Fix let pattern error accumulation

When the checker was added prohibiting lexical binding called let,
certain error propagation was not implemented properly. This patch
fixes that issue, which fixes error checking for cases such as
  let [let]

BUG=v8:4403
R=adamk
LOG=N

Review URL: https://codereview.chromium.org/1409613003

Cr-Commit-Position: refs/heads/master@{#31289}
This commit is contained in:
littledan 2015-10-15 03:45:56 -07:00 committed by Commit bot
parent 370984018f
commit b802051df2
3 changed files with 14 additions and 0 deletions

View File

@ -264,6 +264,8 @@ class ExpressionClassifier {
if (errors & StrongModeFormalParametersProduction)
strong_mode_formal_parameter_error_ =
inner.strong_mode_formal_parameter_error_;
if (errors & LetPatternProduction)
let_pattern_error_ = inner.let_pattern_error_;
}
// As an exception to the above, the result continues to be a valid arrow

View File

@ -0,0 +1,7 @@
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-sloppy --harmony-sloppy-let --harmony-destructuring
let [let];

View File

@ -0,0 +1,5 @@
*%(basename)s:7: SyntaxError: let is disallowed as a lexically bound name
let [let];
^^^
SyntaxError: let is disallowed as a lexically bound name