Index: src/js/async-await.js |
diff --git a/src/js/async-await.js b/src/js/async-await.js |
index a1cac0d5cd62a6bb6850197db285460cf06681ea..dd8f5c0f7e5b8a00c3f79180cc38933dc36ca23d 100644 |
--- a/src/js/async-await.js |
+++ b/src/js/async-await.js |
@@ -90,8 +90,11 @@ function AsyncFunctionAwait(generator, awaited, outerPromise) { |
return; |
} |
- // Just forwarding the exception, so no debugEvent for throwawayCapability |
- var throwawayCapability = NewPromiseCapability(GlobalPromise, false); |
+ // Just forwarding the exception, so no debugEvent for throwawayCapability. |
+ // The resultCapability.promise is only ever fulfilled internally, |
+ // so we don't need the closures to protect against accidentally |
+ // calling them multiple times. |
+ var throwawayCapability = NewPromiseCapability(GlobalPromise, false, true); |
// The Promise will be thrown away and not handled, but it shouldn't trigger |
// unhandled reject events as its work is done |