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

Issue 1468143004: [es6] Self-assignment in a default parameter initializer should throw (Closed)

Created:
5 years, 1 month ago by adamk
Modified:
5 years ago
Reviewers:
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

[es6] Self-assignment in a default parameter initializer should throw The first bug was that there are two different "initialization positions" passed into PatternRewriter::DeclareAndInitializeVariables, and we weren't setting them all properly for this case. After further code review, it became clear that we weren't even recording the correct position (the end of the initializer expression). The combination of those two bugs caused the hole check elimination code in full-codegen to skip emitting a hole check. This patch takes care of both of those things. A follow-up will try to reduce the number of "initializer positions" we track in the variable declaration code. R=littledan@chromium.org BUG=v8:4568 LOG=n Committed: https://crrev.com/b6e9f625c17f3a688139426771e2cb34fbdcb46e Cr-Commit-Position: refs/heads/master@{#32237}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Handle more complex expressions, arrow functions #

Patch Set 3 : Split out the two uses of initializer #

Patch Set 4 : Change less behavior, add TODO #

Unified diffs Side-by-side diffs Delta from patch set Stats (+55 lines, -22 lines) Patch
M src/parser.h View 1 4 chunks +18 lines, -9 lines 0 comments Download
M src/parser.cc View 1 2 3 6 chunks +15 lines, -5 lines 0 comments Download
M src/preparser.h View 1 2 chunks +6 lines, -4 lines 0 comments Download
A + test/message/default-parameter-tdz.js View 1 1 chunk +2 lines, -2 lines 0 comments Download
A test/message/default-parameter-tdz.out View 1 1 chunk +6 lines, -0 lines 0 comments Download
A + test/message/default-parameter-tdz-arrow.js View 1 1 chunk +2 lines, -2 lines 0 comments Download
A test/message/default-parameter-tdz-arrow.out View 1 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (2 generated)
adamk
5 years, 1 month ago (2015-11-24 00:22:57 UTC) #1
Dan Ehrenberg
https://codereview.chromium.org/1468143004/diff/1/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1468143004/diff/1/src/parser.cc#newcode4663 src/parser.cc:4663: parameter.pattern, descriptor.initialization_pos, initial_value); I think you want the position ...
5 years, 1 month ago (2015-11-24 00:37:35 UTC) #2
adamk
https://codereview.chromium.org/1468143004/diff/1/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1468143004/diff/1/src/parser.cc#newcode4663 src/parser.cc:4663: parameter.pattern, descriptor.initialization_pos, initial_value); On 2015/11/24 00:37:35, Dan Ehrenberg wrote: ...
5 years, 1 month ago (2015-11-24 01:08:51 UTC) #4
adamk
Hmm, it looks like I misunderstood the two concepts of "initialization position". One is for ...
5 years, 1 month ago (2015-11-24 01:18:29 UTC) #5
adamk
Okay, this is ready for re-review
5 years ago (2015-11-24 20:01:37 UTC) #6
Dan Ehrenberg
lgtm
5 years ago (2015-11-25 01:10:18 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1468143004/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1468143004/60001
5 years ago (2015-11-25 01:13:40 UTC) #9
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years ago (2015-11-25 01:30:37 UTC) #10
commit-bot: I haz the power
5 years ago (2015-11-25 01:30:45 UTC) #11
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/b6e9f625c17f3a688139426771e2cb34fbdcb46e
Cr-Commit-Position: refs/heads/master@{#32237}

Powered by Google App Engine
This is Rietveld 408576698