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

Issue 2258313002: [async functions] Disallow 'await' in arrow params inside async functions (Closed)

Created:
4 years, 4 months ago by adamk
Modified:
4 years, 4 months ago
Reviewers:
caitp, Dan Ehrenberg
CC:
v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[async functions] Disallow 'await' in arrow params inside async functions The following code was previously accepted: async function f() { let g = (await) => {}; } But per the spec, using 'await' is disallowed in arrow parameters by an early error rule (just as 'yield' is disallowed in arrow params inside generators). There was special logic in ParseUnaryExpression which seems to have been there only to allow that case. Having removed it, we get a SyntaxError in the right cases anyway when ParseUnaryExpression chokes on whatever illegal token follows 'await' in the cases this code previously handled. Also removes the unnecessary AsyncBindingPatternProduction enum value. R=caitp@igalia.com, littledan@chromium.org BUG=v8:4483 Committed: https://crrev.com/232a33602bd6fff2cd381927d94ba9e86cf9a6e5 Cr-Commit-Position: refs/heads/master@{#38802}

Patch Set 1 #

Total comments: 3

Patch Set 2 : Different approach with more tests #

Total comments: 2

Patch Set 3 : Better testing #

Patch Set 4 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+64 lines, -98 lines) Patch
M src/parsing/expression-classifier.h View 1 2 3 5 chunks +17 lines, -36 lines 0 comments Download
M src/parsing/parser-base.h View 1 2 3 2 chunks +5 lines, -38 lines 0 comments Download
M test/cctest/test-parsing.cc View 1 2 3 4 chunks +42 lines, -24 lines 0 comments Download

Messages

Total messages: 32 (18 generated)
adamk
4 years, 4 months ago (2016-08-19 22:58:27 UTC) #1
caitp
lgtm https://codereview.chromium.org/2258313002/diff/1/src/parsing/parser-base.h File src/parsing/parser-base.h (left): https://codereview.chromium.org/2258313002/diff/1/src/parsing/parser-base.h#oldcode936 src/parsing/parser-base.h:936: if (!classifier->is_valid_binding_pattern() || If this passes tests, it ...
4 years, 4 months ago (2016-08-19 23:04:34 UTC) #4
adamk
https://codereview.chromium.org/2258313002/diff/1/src/parsing/parser-base.h File src/parsing/parser-base.h (left): https://codereview.chromium.org/2258313002/diff/1/src/parsing/parser-base.h#oldcode936 src/parsing/parser-base.h:936: if (!classifier->is_valid_binding_pattern() || On 2016/08/19 23:04:34, caitp wrote: > ...
4 years, 4 months ago (2016-08-19 23:07:42 UTC) #5
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/2258313002/1
4 years, 4 months ago (2016-08-19 23:08:22 UTC) #8
adamk
Different approach with more test coverage, ptal
4 years, 4 months ago (2016-08-19 23:40:08 UTC) #13
Dan Ehrenberg
I find this version of the grammar counter-intuitive, and I'm having trouble finding which early ...
4 years, 4 months ago (2016-08-22 01:35:20 UTC) #16
Dan Ehrenberg
lgtm Never mind, this is because CoverCallExpressionAndAsyncArrowHead is parametrized by [Await], which leads to banning ...
4 years, 4 months ago (2016-08-22 01:48:53 UTC) #17
caitp
On 2016/08/22 01:35:20, Dan Ehrenberg wrote: > I find this version of the grammar counter-intuitive, ...
4 years, 4 months ago (2016-08-22 01:51:40 UTC) #18
adamk
https://codereview.chromium.org/2258313002/diff/20001/test/cctest/test-parsing.cc File test/cctest/test-parsing.cc (right): https://codereview.chromium.org/2258313002/diff/20001/test/cctest/test-parsing.cc#newcode7895 test/cctest/test-parsing.cc:7895: "async function f() { return (await = 42) }", ...
4 years, 4 months ago (2016-08-22 18:00:00 UTC) #20
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/2258313002/40001
4 years, 4 months ago (2016-08-22 18:01:55 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: v8_android_arm_compile_rel on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_android_arm_compile_rel/builds/23153) v8_linux64_gyp_rel_ng on master.tryserver.v8 (JOB_FAILED, ...
4 years, 4 months ago (2016-08-22 18:03:22 UTC) #25
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/2258313002/60001
4 years, 4 months ago (2016-08-22 18:30:35 UTC) #28
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 4 months ago (2016-08-22 19:03:19 UTC) #30
commit-bot: I haz the power
4 years, 4 months ago (2016-08-22 19:03:45 UTC) #32
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/232a33602bd6fff2cd381927d94ba9e86cf9a6e5
Cr-Commit-Position: refs/heads/master@{#38802}

Powered by Google App Engine
This is Rietveld 408576698