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

Issue 1417483014: [es6] Implement destructuring binding in try/catch (Closed)

Created:
5 years, 1 month ago by adamk
Modified:
5 years, 1 month ago
Reviewers:
rossberg
CC:
v8-reviews_googlegroups.com, caitp (gmail)
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[es6] Implement destructuring binding in try/catch The approach is to desugar try { ... } catch ({x, y}) { ... } into try { ... } catch (.catch) { let x = .catch.x; let y = .catch.y; ... } using the PatternRewriter's normal facilities. This has the side benefit of throwing the appropriate variable conflict errors for declarations made inside the catch block. No change is made to non-destructured cases, which will hopefully save us some work if https://github.com/tc39/ecma262/issues/150 is adopted in the spec. There's one big problem with this patch, which is a lack of PreParser support for the redeclaration errors. But it seems we're already lacking good PreParser support for such errors, so I'm not sure that should block this moving forward. BUG=v8:811 LOG=y Committed: https://crrev.com/a316db995e6e4253664920652ed4e5a38b2caeba Cr-Commit-Position: refs/heads/master@{#31797}

Patch Set 1 #

Total comments: 7

Patch Set 2 : Handled code review comments #

Patch Set 3 : Fix CheckConflictingVariableDeclarations to deal with destructuring #

Unified diffs Side-by-side diffs Delta from patch set Stats (+117 lines, -12 lines) Patch
M src/ast-value-factory.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/parser.cc View 1 2 3 chunks +66 lines, -7 lines 0 comments Download
M src/preparser.cc View 1 chunk +4 lines, -1 line 0 comments Download
M test/cctest/test-parsing.cc View 2 chunks +2 lines, -0 lines 0 comments Download
A + test/message/try-catch-lexical-conflict.js View 1 chunk +5 lines, -2 lines 0 comments Download
A test/message/try-catch-lexical-conflict.out View 1 chunk +4 lines, -0 lines 0 comments Download
A + test/message/try-catch-variable-conflict.js View 2 1 chunk +4 lines, -2 lines 0 comments Download
A test/message/try-catch-variable-conflict.out View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M test/mjsunit/harmony/destructuring.js View 1 1 chunk +27 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (2 generated)
adamk
This is ready for a look, though it needs some polish before landing.
5 years, 1 month ago (2015-11-03 00:27:57 UTC) #2
rossberg
https://codereview.chromium.org/1417483014/diff/1/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1417483014/diff/1/src/parser.cc#newcode3162 src/parser.cc:3162: bool is_simple = false; Nit: why not `is_simple = ...
5 years, 1 month ago (2015-11-03 12:00:50 UTC) #3
adamk
https://codereview.chromium.org/1417483014/diff/1/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1417483014/diff/1/src/parser.cc#newcode3162 src/parser.cc:3162: bool is_simple = false; On 2015/11/03 12:00:50, rossberg wrote: ...
5 years, 1 month ago (2015-11-03 20:35:20 UTC) #4
rossberg
lgtm https://codereview.chromium.org/1417483014/diff/1/test/mjsunit/harmony/destructuring.js File test/mjsunit/harmony/destructuring.js (right): https://codereview.chromium.org/1417483014/diff/1/test/mjsunit/harmony/destructuring.js#newcode1131 test/mjsunit/harmony/destructuring.js:1131: assertEquals("undefined", typeof foo); On 2015/11/03 20:35:20, adamk wrote: ...
5 years, 1 month ago (2015-11-04 10:26:56 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1417483014/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1417483014/40001
5 years, 1 month ago (2015-11-04 16:04:35 UTC) #7
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 1 month ago (2015-11-04 16:06:22 UTC) #8
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/a316db995e6e4253664920652ed4e5a38b2caeba Cr-Commit-Position: refs/heads/master@{#31797}
5 years, 1 month ago (2015-11-04 16:06:51 UTC) #9
adamk
5 years, 1 month ago (2015-11-04 16:39:22 UTC) #10
Message was sent while issue was closed.
A revert of this CL (patchset #3 id:40001) has been created in
https://codereview.chromium.org/1408063013/ by adamk@chromium.org.

The reason for reverting is: MSAN errors on arm64:
http://build.chromium.org/p/client.v8/builders/V8%20Linux%20-%20arm64%20-%20s....

Powered by Google App Engine
This is Rietveld 408576698