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

Issue 1728973002: Fix priority of exceptions being thrown from for-of loops (Closed)

Created:
4 years, 10 months ago by Dan Ehrenberg
Modified:
4 years, 10 months ago
Reviewers:
rossberg
CC:
jugglinmike, 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 priority of exceptions being thrown from for-of loops In the for-of desugaring, IteratorClose is a subtle thing to get right. When return exists, the logic for which exception to throw is as follows: 1. Get the 'return' property and property any exception that might come from the property read 2. Call return, not yet propagating an exception if it's thrown. 3. If we are closing the iterator due to an exception, propagate that error. 4. If return threw, propagate that error. 5. Check if return's return value was not an object, and throw if so Previously, we were effectively doing step 5 even if an exception "had already been thrown" by step 3. Because this took place in a finally block, the exception "won the race" and was the one propagated to the user. The fix is a simple change to the desugaring to do step 5 only if step 3 didn't happen. R=rossberg BUG=v8:4775 LOG=Y Committed: https://crrev.com/5f67e34aed279d3239f66f8fb0a26e650ec7bb79 Cr-Commit-Position: refs/heads/master@{#34261}

Patch Set 1 #

Patch Set 2 : Fix iterator-close tests and holding onto value #

Patch Set 3 : Fix formatting #

Patch Set 4 : Rebase, with test262 expectations updated #

Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -71 lines) Patch
M src/parsing/parser.cc View 1 2 9 chunks +56 lines, -55 lines 0 comments Download
M test/mjsunit/harmony/iterator-close.js View 1 1 chunk +6 lines, -4 lines 0 comments Download
M test/test262/test262.status View 1 2 3 1 chunk +0 lines, -12 lines 0 comments Download

Messages

Total messages: 18 (9 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/1728973002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1728973002/20001
4 years, 10 months ago (2016-02-24 01:26:07 UTC) #2
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: v8_presubmit on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/11405)
4 years, 10 months ago (2016-02-24 01:28:49 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1728973002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1728973002/40001
4 years, 10 months ago (2016-02-24 01:35:19 UTC) #6
Dan Ehrenberg
4 years, 10 months ago (2016-02-24 01:51:47 UTC) #8
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-24 02:53:03 UTC) #11
rossberg
lgtm
4 years, 10 months ago (2016-02-24 14:08:58 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1728973002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1728973002/60001
4 years, 10 months ago (2016-02-24 18:01:10 UTC) #15
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years, 10 months ago (2016-02-24 18:21:38 UTC) #16
commit-bot: I haz the power
4 years, 10 months ago (2016-02-24 18:21:54 UTC) #18
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/5f67e34aed279d3239f66f8fb0a26e650ec7bb79
Cr-Commit-Position: refs/heads/master@{#34261}

Powered by Google App Engine
This is Rietveld 408576698