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

Issue 1416753009: [parser] early error when declaration Pattern missing Initializer (Closed)

Created:
5 years, 1 month ago by caitp (gmail)
Modified:
5 years, 1 month ago
Reviewers:
wingo, adamk, rossberg
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] early error when declaration Pattern missing Initializer Emit an early error when BindingPatterns are used in a VariableDeclaration or LexicalBinding without an Initializer. BUG=v8:4532 LOG=N R=adamk@chromium.org, rossberg@chromium.org, wingo@igalia.com Committed: https://crrev.com/55e1cfebfd72ba9ba418091dab98ff7724222b02 Cr-Commit-Position: refs/heads/master@{#31802}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Add a bunch of message tests + refactor a bit #

Total comments: 18

Patch Set 3 : comments addressed #

Unified diffs Side-by-side diffs Delta from patch set Stats (+128 lines, -45 lines) Patch
M src/messages.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/parser.cc View 1 2 4 chunks +13 lines, -4 lines 0 comments Download
M src/preparser.h View 1 2 5 chunks +22 lines, -4 lines 0 comments Download
M src/preparser.cc View 1 2 5 chunks +20 lines, -9 lines 0 comments Download
M test/cctest/test-parsing.cc View 2 chunks +29 lines, -2 lines 0 comments Download
A + test/message/const-decl-no-init.js View 1 1 chunk +2 lines, -1 line 0 comments Download
A + test/message/const-decl-no-init.out View 1 1 chunk +4 lines, -4 lines 0 comments Download
A + test/message/const-decl-no-init2.js View 1 1 chunk +1 line, -5 lines 0 comments Download
A + test/message/const-decl-no-init2.out View 1 1 chunk +4 lines, -4 lines 0 comments Download
A + test/message/destructuring-decl-no-init-array.js View 1 1 chunk +1 line, -2 lines 0 comments Download
A test/message/destructuring-decl-no-init-array.out View 1 1 chunk +7 lines, -0 lines 0 comments Download
A + test/message/destructuring-decl-no-init-array2.js View 1 1 chunk +1 line, -2 lines 0 comments Download
A test/message/destructuring-decl-no-init-array2.out View 1 1 chunk +7 lines, -0 lines 0 comments Download
A + test/message/destructuring-decl-no-init-obj.js View 1 1 chunk +1 line, -2 lines 0 comments Download
A test/message/destructuring-decl-no-init-obj.out View 1 1 chunk +7 lines, -0 lines 0 comments Download
A + test/message/destructuring-decl-no-init-obj2.js View 1 1 chunk +1 line, -2 lines 0 comments Download
A test/message/destructuring-decl-no-init-obj2.out View 1 1 chunk +7 lines, -0 lines 0 comments Download
M test/mjsunit/harmony/destructuring.js View 1 1 chunk +0 lines, -4 lines 0 comments Download

Messages

Total messages: 16 (3 generated)
caitp (gmail)
PTAL It's more code than it should be to do this consistently in both parsers, ...
5 years, 1 month ago (2015-11-03 19:04:59 UTC) #1
adamk
https://codereview.chromium.org/1416753009/diff/1/src/messages.h File src/messages.h (right): https://codereview.chromium.org/1416753009/diff/1/src/messages.h#newcode130 src/messages.h:130: T(InvalidDestructuringDeclaration, \ Looks like we're currently giving bad error ...
5 years, 1 month ago (2015-11-03 20:13:53 UTC) #2
caitp (gmail)
- I've added a bunch of message tests and gotten rid of the syntax error ...
5 years, 1 month ago (2015-11-03 23:55:31 UTC) #3
adamk
https://codereview.chromium.org/1416753009/diff/20001/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1416753009/diff/20001/src/parser.cc#newcode2578 src/parser.cc:2578: if (peek() != Token::ASSIGN) { You can also consume ...
5 years, 1 month ago (2015-11-04 00:37:54 UTC) #4
caitp (gmail)
I'll have an updated patchset in the morning https://codereview.chromium.org/1416753009/diff/20001/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1416753009/diff/20001/src/parser.cc#newcode2578 src/parser.cc:2578: if ...
5 years, 1 month ago (2015-11-04 00:50:02 UTC) #5
adamk
https://codereview.chromium.org/1416753009/diff/20001/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1416753009/diff/20001/src/parser.cc#newcode2578 src/parser.cc:2578: if (peek() != Token::ASSIGN) { On 2015/11/04 00:50:02, caitp ...
5 years, 1 month ago (2015-11-04 00:55:10 UTC) #6
rossberg
https://codereview.chromium.org/1416753009/diff/20001/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1416753009/diff/20001/src/parser.cc#newcode2534 src/parser.cc:2534: bool is_pattern = false; Nit: declare this after the ...
5 years, 1 month ago (2015-11-04 10:52:36 UTC) #7
caitp (gmail)
https://codereview.chromium.org/1416753009/diff/20001/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1416753009/diff/20001/src/parser.cc#newcode2576 src/parser.cc:2576: ((parsing_result->descriptor.mode == CONST || is_pattern) && On 2015/11/04 10:52:35, ...
5 years, 1 month ago (2015-11-04 15:07:28 UTC) #8
rossberg
LGTM, but let Adam take another pass, too.
5 years, 1 month ago (2015-11-04 15:10:32 UTC) #9
adamk
lgtm
5 years, 1 month ago (2015-11-04 15:59:25 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1416753009/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1416753009/40001
5 years, 1 month ago (2015-11-04 19:02:53 UTC) #14
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 1 month ago (2015-11-04 19:26:16 UTC) #15
commit-bot: I haz the power
5 years, 1 month ago (2015-11-04 19:26:46 UTC) #16
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/55e1cfebfd72ba9ba418091dab98ff7724222b02
Cr-Commit-Position: refs/heads/master@{#31802}

Powered by Google App Engine
This is Rietveld 408576698