Index: src/js/async-await.js |
diff --git a/src/js/async-await.js b/src/js/async-await.js |
index b733f3d9fa90b81de782ba79d17916d6101b41ea..e7425b33183d92b8796a2000a22a29a420c09910 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({ |
adamk
2016/10/14 20:31:12
Indentation looks off here (should be two spaces).
gsathya
2016/10/14 20:47:06
Done.
|
+ type: "cancel", |
+ id: id, |
+ name: "async function", |
+ }); |
+ } |
// Pop the Promise under construction in an async function on |
// from catch prediction stack. |
%DebugPopPromise(); |