diff --git a/src/expression-classifier.h b/src/expression-classifier.h index bd9ba7064b..7392a7add8 100644 --- a/src/expression-classifier.h +++ b/src/expression-classifier.h @@ -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 diff --git a/test/message/let-lexical-name-in-array-prohibited.js b/test/message/let-lexical-name-in-array-prohibited.js new file mode 100644 index 0000000000..1df487a578 --- /dev/null +++ b/test/message/let-lexical-name-in-array-prohibited.js @@ -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]; diff --git a/test/message/let-lexical-name-in-array-prohibited.out b/test/message/let-lexical-name-in-array-prohibited.out new file mode 100644 index 0000000000..fc8181a498 --- /dev/null +++ b/test/message/let-lexical-name-in-array-prohibited.out @@ -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 +