v8/test/message/let-lexical-declaration-in-single-statement.out
vabr 94bf354af5 Raise SyntaxError on let [ starting an ExpressionStatement
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}
2017-02-16 17:37:21 +00:00

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