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

Issue 2244003003: Change which ExceptionEvents are triggered by Promises (Closed)

Created:
4 years, 4 months ago by Dan Ehrenberg
Modified:
4 years, 4 months ago
Reviewers:
kozy, caitp, neis, adamk, gsathya
CC:
jgruber, v8-reviews_googlegroups.com, Yang
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

Change which ExceptionEvents are triggered by Promises To make async/await catch prediction work well, this patch regularizes the exception events sent to DevTools from various places in the Promise lifecycle. The core is that there should be an exception event when the rejection first starts, rather than when it is propagated. - Several cases within Promise code which propagate errors are modified to not trigger a new ExceptionEvent in that case, such as .then on a rejected Promise and returning a rejected Promise from .then, as well as Promise.race and Promise.all. - Make Promise.reject() create an ExceptionEvent, subject to catch prediction based on the Promise stack. This is important so that, e.g., if "await Promise.reject()" will trigger a new throw (rather than a silent rethrow of something that never triggered an event in the first place). BUG=v8:5167 Committed: https://crrev.com/013e49f73cab96c49df284312f8316e572df3a96 Cr-Commit-Position: refs/heads/master@{#38847}

Patch Set 1 #

Patch Set 2 : Changed tests #

Patch Set 3 : Update tests #

Patch Set 4 : No redundant exception for async/await #

Patch Set 5 : Test for redundant exceptions #

Patch Set 6 : Fix comments for the tests, add another test and fix it #

Patch Set 7 : Suppress some more events, which actually allows all of the original tests to pass with minimal mod… #

Patch Set 8 : Fix expected #args #

Total comments: 6

Patch Set 9 : Changes based on code review, and suppress Promise.all/Promise.race-based redundant exceptions #

Patch Set 10 : formatting #

Patch Set 11 : formatting #

Patch Set 12 : // namespace #

Total comments: 3

Patch Set 13 : Fixed typos #

Unified diffs Side-by-side diffs Delta from patch set Stats (+144 lines, -60 lines) Patch
M src/js/harmony-async-await.js View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M src/js/promise.js View 1 2 3 4 5 6 7 8 9 10 11 12 15 chunks +50 lines, -24 lines 0 comments Download
M src/runtime/runtime.h View 1 2 3 4 5 6 7 8 1 chunk +1 line, -0 lines 0 comments Download
M src/runtime/runtime-internal.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +35 lines, -7 lines 0 comments Download
M test/mjsunit/es6/debug-promises/promise-all-uncaught.js View 1 2 3 4 5 6 7 8 2 chunks +8 lines, -11 lines 0 comments Download
M test/mjsunit/es6/debug-promises/promise-race-uncaught.js View 1 2 3 4 5 6 7 8 2 chunks +8 lines, -11 lines 0 comments Download
M test/mjsunit/es6/debug-promises/reject-caught-by-default-reject-handler.js View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M test/mjsunit/es6/debug-promises/reject-uncaught-all.js View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M test/mjsunit/es6/debug-promises/reject-uncaught-uncaught.js View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 0 comments Download
M test/mjsunit/harmony/async-debug-caught-exception.js View 1 2 3 4 5 6 1 chunk +34 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 61 (44 generated)
Dan Ehrenberg
4 years, 4 months ago (2016-08-16 04:15:35 UTC) #7
adamk
Does this CL have an effect, in itself, on how async/await and rejection interact? Or ...
4 years, 4 months ago (2016-08-18 20:08:31 UTC) #21
Dan Ehrenberg
On 2016/08/18 at 20:08:31, adamk wrote: > Does this CL have an effect, in itself, ...
4 years, 4 months ago (2016-08-22 00:21:13 UTC) #22
Dan Ehrenberg
The new version fixes comments in existing tests and also fixes a new test case, ...
4 years, 4 months ago (2016-08-22 20:25:14 UTC) #24
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/2244003003/100001
4 years, 4 months ago (2016-08-22 20:25:20 UTC) #25
commit-bot: I haz the power
No L-G-T-M from a valid reviewer yet. CQ run can only be started by full ...
4 years, 4 months ago (2016-08-22 20:25:22 UTC) #27
adamk
This lgtm from the v8 code side, I'd like it to be signed-off from the ...
4 years, 4 months ago (2016-08-22 20:33:18 UTC) #30
kozy
I play with patch and without it in DevTools. Here are some results: Current state: ...
4 years, 4 months ago (2016-08-22 22:04:50 UTC) #33
Dan Ehrenberg
On 2016/08/22 at 22:04:50, kozyatinskiy wrote: > I play with patch and without it in ...
4 years, 4 months ago (2016-08-23 00:15:56 UTC) #34
Dan Ehrenberg
On 2016/08/23 at 00:15:56, Dan Ehrenberg wrote: > On 2016/08/22 at 22:04:50, kozyatinskiy wrote: > ...
4 years, 4 months ago (2016-08-23 21:22:24 UTC) #35
adamk
https://codereview.chromium.org/2244003003/diff/140001/src/js/promise.js File src/js/promise.js (right): https://codereview.chromium.org/2244003003/diff/140001/src/js/promise.js#newcode308 src/js/promise.js:308: function RejectPromise(promise, reason, suppressDebugEvent) { It's confusing to me ...
4 years, 4 months ago (2016-08-23 22:29:27 UTC) #39
kozy
On 2016/08/23 21:22:24, Dan Ehrenberg wrote: > The new version makes better use of catch ...
4 years, 4 months ago (2016-08-23 23:18:23 UTC) #42
Dan Ehrenberg
Made cleanups and further improvements based on review; PTAL https://codereview.chromium.org/2244003003/diff/140001/src/js/promise.js File src/js/promise.js (right): https://codereview.chromium.org/2244003003/diff/140001/src/js/promise.js#newcode308 src/js/promise.js:308: ...
4 years, 4 months ago (2016-08-23 23:28:38 UTC) #48
adamk
lgtm besides a few style/typo nits Agreed on the intuition for race and all as ...
4 years, 4 months ago (2016-08-23 23:43:39 UTC) #55
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/2244003003/240001
4 years, 4 months ago (2016-08-23 23:58:30 UTC) #58
commit-bot: I haz the power
Committed patchset #13 (id:240001)
4 years, 4 months ago (2016-08-24 00:20:37 UTC) #59
commit-bot: I haz the power
4 years, 4 months ago (2016-08-24 00:21:02 UTC) #61
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/013e49f73cab96c49df284312f8316e572df3a96
Cr-Commit-Position: refs/heads/master@{#38847}

Powered by Google App Engine
This is Rietveld 408576698