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

Issue 1602823003: [parser] Disallow Expression in for..of statements (Closed)

Created:
4 years, 11 months ago by mike3
Modified:
4 years, 11 months ago
Reviewers:
adamk
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

[parser] Disallow Expression in for..of statements Although the `for..in` statement allows Expressions to define the iterator, only an AssignmentExpression may occupy this position in the `for..of` statement. BUG=v8:4692 LOG=N R=adamk@chromium.org Committed: https://crrev.com/f7263b6a3f35f677169c77cdd332794d1b3b63ca Cr-Commit-Position: refs/heads/master@{#33420}

Patch Set 1 #

Total comments: 3

Patch Set 2 : Modified to include expression validation and more extensive tests #

Patch Set 3 : Correcting a typo #

Total comments: 18

Patch Set 4 : Incorporating latest review feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+126 lines, -4 lines) Patch
M src/parsing/parser.cc View 1 2 3 2 chunks +19 lines, -2 lines 0 comments Download
M src/parsing/preparser.cc View 1 2 chunks +20 lines, -2 lines 0 comments Download
M test/cctest/test-parsing.cc View 1 2 3 2 chunks +87 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (2 generated)
mike3
4 years, 11 months ago (2016-01-19 22:16:15 UTC) #1
adamk
https://codereview.chromium.org/1602823003/diff/1/src/parsing/parser.cc File src/parsing/parser.cc (right): https://codereview.chromium.org/1602823003/diff/1/src/parsing/parser.cc#newcode3682 src/parsing/parser.cc:3682: enumerable = ParseAssignmentExpression(true, &classifier, CHECK_OK); Why no ValidateExpression() call ...
4 years, 11 months ago (2016-01-19 22:21:47 UTC) #2
adamk
https://codereview.chromium.org/1602823003/diff/40001/src/parsing/parser.cc File src/parsing/parser.cc (right): https://codereview.chromium.org/1602823003/diff/40001/src/parsing/parser.cc#newcode3683 src/parsing/parser.cc:3683: ParserTraits::RewriteNonPattern(enumerable, &classifier, CHECK_OK); I think the calling convention here ...
4 years, 11 months ago (2016-01-20 00:35:57 UTC) #3
adamk
https://codereview.chromium.org/1602823003/diff/40001/test/cctest/test-parsing.cc File test/cctest/test-parsing.cc (right): https://codereview.chromium.org/1602823003/diff/40001/test/cctest/test-parsing.cc#newcode5112 test/cctest/test-parsing.cc:5112: const char* data[] = {"for(x of yield) {}", "for(var ...
4 years, 11 months ago (2016-01-20 00:38:09 UTC) #4
mike3
https://codereview.chromium.org/1602823003/diff/40001/src/parsing/parser.cc File src/parsing/parser.cc (right): https://codereview.chromium.org/1602823003/diff/40001/src/parsing/parser.cc#newcode3683 src/parsing/parser.cc:3683: ParserTraits::RewriteNonPattern(enumerable, &classifier, CHECK_OK); On 2016/01/20 00:35:57, adamk wrote: > ...
4 years, 11 months ago (2016-01-20 17:55:40 UTC) #5
adamk
https://codereview.chromium.org/1602823003/diff/40001/test/cctest/test-parsing.cc File test/cctest/test-parsing.cc (right): https://codereview.chromium.org/1602823003/diff/40001/test/cctest/test-parsing.cc#newcode4913 test/cctest/test-parsing.cc:4913: const char* context_data[][2] = {{"'use strict';", ""}, On 2016/01/20 ...
4 years, 11 months ago (2016-01-20 19:31:18 UTC) #6
caitp (gmail)
Can't we just emit a SyntaxError if the iterable is a BinaryExpression with Token::COMMA in ...
4 years, 11 months ago (2016-01-20 19:42:19 UTC) #7
mike3
https://codereview.chromium.org/1602823003/diff/40001/test/cctest/test-parsing.cc File test/cctest/test-parsing.cc (right): https://codereview.chromium.org/1602823003/diff/40001/test/cctest/test-parsing.cc#newcode4913 test/cctest/test-parsing.cc:4913: const char* context_data[][2] = {{"'use strict';", ""}, On 2016/01/20 ...
4 years, 11 months ago (2016-01-20 19:54:09 UTC) #8
mike3
On 2016/01/20 19:42:19, caitp wrote: > Can't we just emit a SyntaxError if the iterable ...
4 years, 11 months ago (2016-01-20 20:00:17 UTC) #9
adamk
On 2016/01/20 20:00:17, mike3 wrote: > On 2016/01/20 19:42:19, caitp wrote: > > Can't we ...
4 years, 11 months ago (2016-01-20 21:24:52 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1602823003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1602823003/60001
4 years, 11 months ago (2016-01-20 21:40:48 UTC) #12
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 11 months ago (2016-01-20 22:05:05 UTC) #13
commit-bot: I haz the power
4 years, 11 months ago (2016-01-20 22:05:56 UTC) #15
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/f7263b6a3f35f677169c77cdd332794d1b3b63ca
Cr-Commit-Position: refs/heads/master@{#33420}

Powered by Google App Engine
This is Rietveld 408576698