Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Issue 2694003002: Raise SyntaxError on let [ starting an ExpressionStatement (Closed)

Created:
3 years, 10 months ago by vabr (Chromium)
Modified:
3 years, 10 months ago
Reviewers:
Dan Ehrenberg
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

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} Committed: https://chromium.googlesource.com/v8/v8/+/94bf354af55261a9a3c6f994b338627bb56231d2

Patch Set 1 #

Total comments: 3

Patch Set 2 : Restrict the disallowed let [ to for(;;) #

Patch Set 3 : Only cover the ExpressionStatement case #

Total comments: 4

Patch Set 4 : test/message + improve message #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -0 lines) Patch
M src/messages.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/parsing/parser-base.h View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download
A test/message/let-lexical-declaration-in-single-statement.js View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
A test/message/let-lexical-declaration-in-single-statement.out View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 28 (18 generated)
Dan Ehrenberg
https://codereview.chromium.org/2694003002/diff/1/src/parsing/parser-base.h File src/parsing/parser-base.h (right): https://codereview.chromium.org/2694003002/diff/1/src/parsing/parser-base.h#newcode5461 src/parsing/parser-base.h:5461: } I'm not sure I agree with your reading ...
3 years, 10 months ago (2017-02-13 19:26:57 UTC) #6
vabr (Chromium)
Thanks for the comment! However, please note that this CL has not been posted for ...
3 years, 10 months ago (2017-02-13 20:14:46 UTC) #7
vabr (Chromium)
https://codereview.chromium.org/2694003002/diff/1/src/parsing/parser-base.h File src/parsing/parser-base.h (right): https://codereview.chromium.org/2694003002/diff/1/src/parsing/parser-base.h#newcode5461 src/parsing/parser-base.h:5461: } On 2017/02/13 20:14:46, vabr (OOO until late Feb) ...
3 years, 10 months ago (2017-02-13 20:29:20 UTC) #10
vabr (Chromium)
Hi Dan, Could you please review the current patch set (3)? Cheers, Vaclav
3 years, 10 months ago (2017-02-13 21:16:21 UTC) #16
vabr (Chromium)
Hi Dan, A friendly reminder in case this CL got lost. I restricted the change ...
3 years, 10 months ago (2017-02-16 08:33:07 UTC) #17
Dan Ehrenberg
https://codereview.chromium.org/2694003002/diff/40001/src/messages.h File src/messages.h (right): https://codereview.chromium.org/2694003002/diff/40001/src/messages.h#newcode641 src/messages.h:641: T(UnexpectedTokenLetLBrack, "Unexpected token sequence let [") \ From a ...
3 years, 10 months ago (2017-02-16 09:16:52 UTC) #18
vabr (Chromium)
Thanks for the review and useful suggesitons! Please take a look again at how I ...
3 years, 10 months ago (2017-02-16 17:09:33 UTC) #21
Dan Ehrenberg
lgtm
3 years, 10 months ago (2017-02-16 17:17:36 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2694003002/60001
3 years, 10 months ago (2017-02-16 17:25:27 UTC) #25
commit-bot: I haz the power
3 years, 10 months ago (2017-02-16 17:37:28 UTC) #28
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://chromium.googlesource.com/v8/v8/+/94bf354af55261a9a3c6f994b338627bb56...

Powered by Google App Engine
This is Rietveld 408576698