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

Issue 1259283002: [es6] Implement proper TDZ for parameters (Closed)

Created:
5 years, 4 months ago by rossberg
Modified:
5 years, 4 months ago
CC:
v8-dev, 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 proper TDZ for parameters Previously, examples like (({a = x}, x) => {})({}, 0) did not throw a ReferenceError like they should. This CL - Splits up DeclareFormalParameters such that the formals can be recorded first and declared later. - Declaration then takes the complete parameter list into account. If it is not simple, temporaries are introduced for all parameters. - BuildParameterInitializationBlock desugars all parameters from non-simple lists into let-bindings. - Refactored Pre/ParserFormalParameters, so that the arity information is no longer duplicated in Parser. - Rest is currently handled specially, until rest-via-destructuring has landed. R=adamk@chromium.org, littledan@chromium.org BUG=v8:811 LOG=N Committed: https://crrev.com/4273f66e9882f1239c6b7846c31730d47b870d81 Cr-Commit-Position: refs/heads/master@{#30025}

Patch Set 1 #

Total comments: 10

Patch Set 2 : Rebase #

Patch Set 3 : Adam's comments #

Total comments: 6

Patch Set 4 : Adjust test expectations #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+166 lines, -62 lines) Patch
M src/parser.h View 1 2 4 chunks +32 lines, -20 lines 1 comment Download
M src/parser.cc View 1 2 6 chunks +30 lines, -13 lines 0 comments Download
M src/preparser.h View 1 2 11 chunks +43 lines, -25 lines 0 comments Download
M test/mjsunit/harmony/destructuring.js View 1 chunk +58 lines, -4 lines 0 comments Download
M test/test262-es6/test262-es6.status View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (5 generated)
rossberg
5 years, 4 months ago (2015-07-28 15:54:26 UTC) #1
adamk
https://codereview.chromium.org/1259283002/diff/1/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1259283002/diff/1/src/parser.cc#newcode1205 src/parser.cc:1205: ParseFormalParameter(is_rest, &formals, &formals_classifier, &ok); Check ok before declaring? https://codereview.chromium.org/1259283002/diff/1/src/parser.cc#newcode2222 ...
5 years, 4 months ago (2015-08-03 18:43:52 UTC) #2
rossberg
Addressed the arity issue by separating out a FormalParametersBase class that does not have an ...
5 years, 4 months ago (2015-08-04 15:31:19 UTC) #3
caitp (gmail)
These shouldn't block anything, just wondering https://codereview.chromium.org/1259283002/diff/40001/src/parser.h File src/parser.h (right): https://codereview.chromium.org/1259283002/diff/40001/src/parser.h#newcode556 src/parser.h:556: const Parameter& at(int ...
5 years, 4 months ago (2015-08-04 16:46:26 UTC) #4
adamk
lgtm https://codereview.chromium.org/1259283002/diff/1/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1259283002/diff/1/src/parser.cc#newcode2222 src/parser.cc:2222: !scope_->is_declaration_scope() ? LET : VAR; On 2015/08/04 15:31:19, ...
5 years, 4 months ago (2015-08-04 17:25:04 UTC) #5
rossberg
https://codereview.chromium.org/1259283002/diff/40001/src/parser.h File src/parser.h (right): https://codereview.chromium.org/1259283002/diff/40001/src/parser.h#newcode556 src/parser.h:556: const Parameter& at(int i) const { return params[i]; } ...
5 years, 4 months ago (2015-08-04 19:09:21 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1259283002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1259283002/40001
5 years, 4 months ago (2015-08-04 19:09:43 UTC) #8
commit-bot: I haz the power
Try jobs failed on following builders: v8_linux_rel on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_rel/builds/8284)
5 years, 4 months ago (2015-08-04 19:53:58 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1259283002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1259283002/60001
5 years, 4 months ago (2015-08-05 11:36:42 UTC) #13
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 4 months ago (2015-08-05 12:00:45 UTC) #14
commit-bot: I haz the power
Patchset 4 (id:??) landed as https://crrev.com/4273f66e9882f1239c6b7846c31730d47b870d81 Cr-Commit-Position: refs/heads/master@{#30025}
5 years, 4 months ago (2015-08-05 12:02:33 UTC) #15
caitp (gmail)
5 years, 4 months ago (2015-08-05 12:53:54 UTC) #17
Message was sent while issue was closed.
Didn't notice last night, but don't want to change that in the rest CL

https://codereview.chromium.org/1259283002/diff/60001/src/parser.h
File src/parser.h (left):

https://codereview.chromium.org/1259283002/diff/60001/src/parser.h#oldcode1320
src/parser.h:1320: const AstRawString* name = is_simple
Another piece of potential cleanup, the name-picking ternary expression isn't
really needed, because AddFormalParameter() stores the empty string for
non-simple parameters anyways.

Powered by Google App Engine
This is Rietveld 408576698