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:
parent
370984018f
commit
b802051df2
@ -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
|
||||
|
7
test/message/let-lexical-name-in-array-prohibited.js
Normal file
7
test/message/let-lexical-name-in-array-prohibited.js
Normal 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];
|
5
test/message/let-lexical-name-in-array-prohibited.out
Normal file
5
test/message/let-lexical-name-in-array-prohibited.out
Normal 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
|
||||
|
Loading…
Reference in New Issue
Block a user