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

Unified Diff: src/js/async-await.js

Issue 2417093003: [async await] Fix debug async task event (Closed)
Patch Set: fmt Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/harmony/debug-async-function-async-task-event.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/async-await.js
diff --git a/src/js/async-await.js b/src/js/async-await.js
index b733f3d9fa90b81de782ba79d17916d6101b41ea..d687642a7883eef43e1183c9937c613c5e83c934 100644
--- a/src/js/async-await.js
+++ b/src/js/async-await.js
@@ -158,11 +158,16 @@ function AsyncFunctionPromiseRelease(promise) {
if (DEBUG_IS_ACTIVE) {
// Cancel
var id = GET_PRIVATE(promise, promiseAsyncStackIDSymbol);
- %DebugAsyncTaskEvent({
- type: "cancel",
- id: id,
- name: "async function",
- });
+
+ // Don't send invalid events when catch prediction is turned on in
+ // the middle of some async operation.
+ if (!IS_UNDEFINED(id)) {
+ %DebugAsyncTaskEvent({
+ type: "cancel",
+ id: id,
+ name: "async function",
+ });
+ }
// Pop the Promise under construction in an async function on
// from catch prediction stack.
%DebugPopPromise();
« no previous file with comments | « no previous file | test/mjsunit/harmony/debug-async-function-async-task-event.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698