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

Issue 1396663004: Fix scopes for body of sloppy-mode for-in/of loop (Closed)

Created:
5 years, 2 months ago by Dan Ehrenberg
Modified:
5 years, 2 months ago
Reviewers:
rossberg
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

Fix scopes for body of sloppy-mode for-in/of loop This patch fixes an obscure edge case for functions defined as the direct body of a for-of/for-in loop, such as the following: for (foo in []) function foo() { return foo; } Here, the first occurrence of foo should point to the outer scope; however, before this patch, it pointed to the inner foo in an invalid way which caused an assertion about the scope chain to fail. This patch fixes the scope chain by inserting an extra scope for the body of the loop, not including the header. BUG=chromium:542099 LOG=N R=rossberg Committed: https://crrev.com/d0618585a747e1ba51e84a2d30526d8b21ff7191 Cr-Commit-Position: refs/heads/master@{#31268}

Patch Set 1 #

Total comments: 4

Patch Set 2 : Fix comment, improve test #

Total comments: 1

Patch Set 3 : better comment #

Patch Set 4 : Improve test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+30 lines, -3 lines) Patch
M src/parser.cc View 1 2 1 chunk +12 lines, -3 lines 0 comments Download
A test/mjsunit/regress/regress-542099.js View 1 2 3 1 chunk +18 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (7 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1396663004/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1396663004/1
5 years, 2 months ago (2015-10-13 09:40:46 UTC) #2
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 2 months ago (2015-10-13 10:09:07 UTC) #4
Dan Ehrenberg
5 years, 2 months ago (2015-10-13 10:09:47 UTC) #6
rossberg
https://codereview.chromium.org/1396663004/diff/1/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1396663004/diff/1/src/parser.cc#newcode3797 src/parser.cc:3797: // This block must not be based on for_scope ...
5 years, 2 months ago (2015-10-13 10:52:04 UTC) #7
Dan Ehrenberg
PTAL https://codereview.chromium.org/1396663004/diff/1/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/1396663004/diff/1/src/parser.cc#newcode3797 src/parser.cc:3797: // This block must not be based on ...
5 years, 2 months ago (2015-10-13 14:58:40 UTC) #8
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1396663004/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1396663004/20001
5 years, 2 months ago (2015-10-13 14:58:49 UTC) #10
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 2 months ago (2015-10-13 15:20:45 UTC) #12
rossberg
LGTM module comments (online & offline) https://codereview.chromium.org/1396663004/diff/20001/test/mjsunit/regress/regress-542099.js File test/mjsunit/regress/regress-542099.js (right): https://codereview.chromium.org/1396663004/diff/20001/test/mjsunit/regress/regress-542099.js#newcode16 test/mjsunit/regress/regress-542099.js:16: assertEquals("function", typeof foo()); ...
5 years, 2 months ago (2015-10-13 15:21:18 UTC) #13
Dan Ehrenberg
On 2015/10/13 at 14:58:49, commit-bot wrote: > Dry run: CQ is trying da patch. Follow ...
5 years, 2 months ago (2015-10-13 16:02:41 UTC) #14
rossberg
Excellent, thanks!
5 years, 2 months ago (2015-10-13 16:05:27 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1396663004/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1396663004/60001
5 years, 2 months ago (2015-10-14 15:50:10 UTC) #18
commit-bot: I haz the power
Committed patchset #4 (id:60001)
5 years, 2 months ago (2015-10-14 17:36:11 UTC) #19
commit-bot: I haz the power
5 years, 2 months ago (2015-10-14 17:36:26 UTC) #20
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/d0618585a747e1ba51e84a2d30526d8b21ff7191
Cr-Commit-Position: refs/heads/master@{#31268}

Powered by Google App Engine
This is Rietveld 408576698