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

Issue 2112163002: Block-scoped functions in evals are now only conditionally hoisted out. (Closed)

Created:
4 years, 5 months ago by bakkot
Modified:
4 years, 4 months 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

Block-scoped functions in evals are now only conditionally hoisted out. Annex B.3.3 of the spec requires that sloppy-mode block-scoped functions declared by "eval" are hoisted unless doing so would cause an early error (which is to say, conflict with a lexical declaration). This patch amends the check for conflicting declarations to include those outside of the eval itself. BUG=v8:4468, v8:4479 Committed: https://crrev.com/f6c6ae903463327af2a0a8766a15d882a9eb3e93 Cr-Commit-Position: refs/heads/master@{#37783}

Patch Set 1 #

Total comments: 1

Patch Set 2 : fix test #

Total comments: 1

Patch Set 3 : more tests #

Unified diffs Side-by-side diffs Delta from patch set Stats (+74 lines, -18 lines) Patch
M src/parsing/parser.cc View 1 2 1 chunk +5 lines, -1 line 0 comments Download
M test/mjsunit/es6/block-eval-var-over-let.js View 2 chunks +1 line, -4 lines 0 comments Download
M test/mjsunit/es6/block-sloppy-function.js View 1 2 5 chunks +68 lines, -13 lines 0 comments Download

Messages

Total messages: 28 (15 generated)
bakkot
There should probably be more tests before this goes in, but it seems correct.
4 years, 5 months ago (2016-07-01 00:43:44 UTC) #4
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/2112163002/1
4 years, 5 months ago (2016-07-01 00:53:06 UTC) #6
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 5 months ago (2016-07-01 01:22:16 UTC) #8
Dan Ehrenberg
Need to think more about the main change (seems right at a first glance), but ...
4 years, 5 months ago (2016-07-01 01:36:21 UTC) #9
bakkot
Corrected the incorrectly-passing test.
4 years, 5 months ago (2016-07-01 19:49:59 UTC) #11
Dan Ehrenberg
On 2016/07/01 19:49:59, bakkot wrote: > Corrected the incorrectly-passing test.
4 years, 5 months ago (2016-07-01 23:55:10 UTC) #12
Dan Ehrenberg
https://codereview.chromium.org/2112163002/diff/20001/src/parsing/parser.cc File src/parsing/parser.cc (right): https://codereview.chromium.org/2112163002/diff/20001/src/parsing/parser.cc#newcode5118 src/parsing/parser.cc:5118: decl_scope = decl_scope->outer_scope()->DeclarationScope(); It feels like this will search ...
4 years, 5 months ago (2016-07-01 23:55:53 UTC) #13
bakkot
On 2016/07/01 at 23:55:53, littledan wrote: > https://codereview.chromium.org/2112163002/diff/20001/src/parsing/parser.cc > File src/parsing/parser.cc (right): > > https://codereview.chromium.org/2112163002/diff/20001/src/parsing/parser.cc#newcode5118 ...
4 years, 5 months ago (2016-07-02 00:00:59 UTC) #14
Dan Ehrenberg
lgtm OK, thought about it more, this seems right.
4 years, 5 months ago (2016-07-02 00:12:44 UTC) #15
Dan Ehrenberg
Is anything holding up committing this patch?
4 years, 5 months ago (2016-07-14 03:08:56 UTC) #16
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/2112163002/40001
4 years, 5 months ago (2016-07-14 22:39:24 UTC) #24
commit-bot: I haz the power
Committed patchset #3 (id:40001)
4 years, 5 months ago (2016-07-14 22:41:48 UTC) #25
commit-bot: I haz the power
4 years, 5 months ago (2016-07-14 22:43:13 UTC) #27
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/f6c6ae903463327af2a0a8766a15d882a9eb3e93
Cr-Commit-Position: refs/heads/master@{#37783}

Powered by Google App Engine
This is Rietveld 408576698