94bf354af5
ES2017 forbids the sequence of tokens "let [" in in expression statements [1]. This CL makes ParserBase report those instances as SyntaxError. It also adds a customised error message for that, because the standard "Unexpected token" is not applicable: "let" itself is not forbidden in those context, only the sequence of "let [". [1] https://tc39.github.io/ecma262/#sec-expression-statement BUG=v8:5686 Review-Url: https://codereview.chromium.org/2694003002 Cr-Commit-Position: refs/heads/master@{#43258}
5 lines
209 B
Plaintext
5 lines
209 B
Plaintext
*%(basename)s:5: SyntaxError: Lexical declaration cannot appear in a single-statement context
|
|
with ({}) let [a] = [];
|
|
^^^
|
|
SyntaxError: Lexical declaration cannot appear in a single-statement context
|