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

Issue 1371333004: [es6] Scoping & initialization for var shadowing non-simple parameters (Closed)

Created:
5 years, 2 months ago by rossberg
Modified:
4 years, 4 months ago
Reviewers:
adamk, Toon Verwaest
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] Scoping & initialization for var shadowing non-simple parameters Var-bindings may shadow parameters from a non-simple parameter list. When that happens: they create separate bindings, but are initialised with the respective parameter value. Thus: (function(x, f = () => x) { var x; var y = x; x = 2; return [x, y, f()] })(1) --> [2, 1, 1] This CL implements that by inserting a suitable assignment for every shadwowing var-variable (e.g., x = outer_x above) at the beginning of the function's body block. R=adamk@chromium.org BUG=v8:4440, v8:811 LOG=N Committed: https://crrev.com/2c2848dccf697830dab75f59a2b7a72af48cbc48 Cr-Commit-Position: refs/heads/master@{#31042}

Patch Set 1 #

Patch Set 2 : Handle function decls correctly #

Total comments: 10

Patch Set 3 : Comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+110 lines, -11 lines) Patch
M src/parser.h View 2 chunks +6 lines, -2 lines 0 comments Download
M src/parser.cc View 1 2 3 chunks +27 lines, -2 lines 0 comments Download
M src/scopes.cc View 2 chunks +1 line, -5 lines 0 comments Download
M test/mjsunit/harmony/destructuring.js View 1 2 1 chunk +76 lines, -2 lines 0 comments Download

Messages

Total messages: 16 (4 generated)
rossberg
5 years, 2 months ago (2015-09-29 13:18:24 UTC) #1
adamk
Please add more detail to the CL description: what does the patch change, and why ...
5 years, 2 months ago (2015-09-29 18:28:29 UTC) #2
rossberg
Addresed comments and extended CL description. https://codereview.chromium.org/1371333004/diff/20001/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1371333004/diff/20001/src/parser.cc#newcode4956 src/parser.cc:4956: Scope* scope = ...
5 years, 2 months ago (2015-09-30 14:50:49 UTC) #3
adamk
lgtm
5 years, 2 months ago (2015-09-30 18:54:38 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1371333004/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1371333004/40001
5 years, 2 months ago (2015-10-01 10:19:38 UTC) #6
commit-bot: I haz the power
Try jobs failed on following builders: v8_presubmit on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/6257)
5 years, 2 months ago (2015-10-01 10:22:27 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1371333004/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1371333004/40001
5 years, 2 months ago (2015-10-01 10:25:06 UTC) #10
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 2 months ago (2015-10-01 10:42:28 UTC) #11
commit-bot: I haz the power
Patchset 3 (id:??) landed as https://crrev.com/2c2848dccf697830dab75f59a2b7a72af48cbc48 Cr-Commit-Position: refs/heads/master@{#31042}
5 years, 2 months ago (2015-10-01 10:42:49 UTC) #12
Toon Verwaest
The code snippet in the comment returns [2,1,1], but as far as I can tell ...
4 years, 4 months ago (2016-08-03 11:22:06 UTC) #14
adamk
On 2016/08/03 11:22:06, Toon Verwaest wrote: > The code snippet in the comment returns [2,1,1], ...
4 years, 4 months ago (2016-08-03 17:39:23 UTC) #15
Toon Verwaest
4 years, 4 months ago (2016-08-03 19:25:16 UTC) #16
Message was sent while issue was closed.
I see. This came from a discussion with neis about it, and we focused too much
on 26. Sorry for the noise.

Powered by Google App Engine
This is Rietveld 408576698