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

Issue 2099623003: Annex B.3.3 semantics (Closed)

Created:
4 years, 6 months ago by bakkot
Modified:
4 years, 5 months ago
Reviewers:
Dan Ehrenberg, adamk
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

Sloppy-mode function declarations in blocks are now hoisted appropriately. In ES2016, function declarations nested in blocks are formally allowed. This was never a part of ECMAScript, but was a common extension. Unfortunately implementations differed in the exact semantics. Annex B.3.3 in the spec tries to standardize the parts which are common to different implementations, but does so with some fairly complicated semantics. This CL addresses three issues related to annex B.3.3: * When the outer function had a complex parameter list, no hoisting whatsoever was being performed. * Hoisting was not blocked by parameters of the same name. * Hoisting was not blocked by nested lexical declarations of the same name. We had tests which checked for the second, but they were incorrectly passing due to the first. This CL adds more complete tests. BUG=v8:5151, v8:5111 Committed: https://crrev.com/9bbba1441a920ac6036e726da49f037e107835aa Cr-Commit-Position: refs/heads/master@{#37405}

Patch Set 1 #

Patch Set 2 : remove test which should not yet have been passing #

Patch Set 3 : more b33 fixes #

Total comments: 4

Patch Set 4 : typo and test #

Patch Set 5 : more documentation #

Total comments: 10

Patch Set 6 : cleanup per adam #

Patch Set 7 : param->params #

Total comments: 2

Patch Set 8 : typos #

Unified diffs Side-by-side diffs Delta from patch set Stats (+363 lines, -55 lines) Patch
M src/parsing/parser.h View 1 2 3 4 5 6 1 chunk +3 lines, -1 line 0 comments Download
M src/parsing/parser.cc View 1 2 3 4 5 6 7 5 chunks +79 lines, -27 lines 0 comments Download
M test/mjsunit/es6/block-sloppy-function.js View 1 2 3 3 chunks +281 lines, -17 lines 0 comments Download
M test/test262/test262.status View 1 2 1 chunk +0 lines, -10 lines 0 comments Download

Messages

Total messages: 38 (18 generated)
bakkot
The failure was because functions with complex parameters create a nested Scope, and the sloppy_block_function_map ...
4 years, 6 months ago (2016-06-25 00:41:13 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2099623003/1
4 years, 6 months ago (2016-06-25 01:11:44 UTC) #4
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_win_nosnap_shared_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win_nosnap_shared_rel_ng/builds/3910) v8_win_nosnap_shared_rel_ng_triggered on ...
4 years, 6 months ago (2016-06-25 01:25:55 UTC) #6
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2099623003/20001
4 years, 5 months ago (2016-06-27 17:11:15 UTC) #8
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 5 months ago (2016-06-27 17:34:52 UTC) #10
Dan Ehrenberg
lgtm Good catch, and the new test seems a lot better (what was I thinking?). ...
4 years, 5 months ago (2016-06-27 19:42:13 UTC) #11
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2099623003/40001
4 years, 5 months ago (2016-06-27 22:59:26 UTC) #15
bakkot
ptal
4 years, 5 months ago (2016-06-27 22:59:30 UTC) #16
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 5 months ago (2016-06-27 23:55:37 UTC) #19
Dan Ehrenberg
https://codereview.chromium.org/2099623003/diff/40001/src/parsing/parser.cc File src/parsing/parser.cc (right): https://codereview.chromium.org/2099623003/diff/40001/src/parsing/parser.cc#newcode5140 src/parsing/parser.cc:5140: if (outer_is_param_scope && outer_scope->LookupLocal(name) != nullptr) { Why would ...
4 years, 5 months ago (2016-06-28 01:07:00 UTC) #20
bakkot
Addressed comments; ptal https://codereview.chromium.org/2099623003/diff/40001/src/parsing/parser.cc File src/parsing/parser.cc (right): https://codereview.chromium.org/2099623003/diff/40001/src/parsing/parser.cc#newcode5140 src/parsing/parser.cc:5140: if (outer_is_param_scope && outer_scope->LookupLocal(name) != nullptr) ...
4 years, 5 months ago (2016-06-28 01:19:37 UTC) #21
adamk
Some comments (your conversation this morning piqued my interest :) https://codereview.chromium.org/2099623003/diff/80001/src/parsing/parser.cc File src/parsing/parser.cc (right): https://codereview.chromium.org/2099623003/diff/80001/src/parsing/parser.cc#newcode5139 ...
4 years, 5 months ago (2016-06-28 20:55:11 UTC) #23
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2099623003/80001
4 years, 5 months ago (2016-06-28 22:51:31 UTC) #25
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2099623003/120001
4 years, 5 months ago (2016-06-28 23:49:59 UTC) #28
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 5 months ago (2016-06-29 00:21:23 UTC) #30
bakkot
Addressed Adam's comments. https://codereview.chromium.org/2099623003/diff/80001/src/parsing/parser.cc File src/parsing/parser.cc (right): https://codereview.chromium.org/2099623003/diff/80001/src/parsing/parser.cc#newcode5139 src/parsing/parser.cc:5139: /* Check if there's a conflict ...
4 years, 5 months ago (2016-06-29 00:25:02 UTC) #31
adamk
lgtm https://codereview.chromium.org/2099623003/diff/120001/src/parsing/parser.cc File src/parsing/parser.cc (right): https://codereview.chromium.org/2099623003/diff/120001/src/parsing/parser.cc#newcode5138 src/parsing/parser.cc:5138: if (complex_params_scope) { Might as well do a ...
4 years, 5 months ago (2016-06-29 00:39:51 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2099623003/140001
4 years, 5 months ago (2016-06-29 20:19:11 UTC) #35
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 5 months ago (2016-06-29 20:52:40 UTC) #36
commit-bot: I haz the power
4 years, 5 months ago (2016-06-29 20:55:47 UTC) #38
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/9bbba1441a920ac6036e726da49f037e107835aa
Cr-Commit-Position: refs/heads/master@{#37405}

Powered by Google App Engine
This is Rietveld 408576698