Index: src/js/promise.js |
diff --git a/src/js/promise.js b/src/js/promise.js |
index c057238af696d78416a6198b3c0f68dabb8c31c1..5c80ac8df373931ceef442a647a41ade5c9baa83 100644 |
--- a/src/js/promise.js |
+++ b/src/js/promise.js |
@@ -279,30 +279,9 @@ function ResolvePromise(promise, resolution) { |
} |
if (IS_CALLABLE(then)) { |
- // PromiseResolveThenableJob |
- var id; |
- var name = "PromiseResolveThenableJob"; |
- var instrumenting = DEBUG_IS_ACTIVE; |
- %EnqueueMicrotask(function() { |
- if (instrumenting) { |
- %DebugAsyncTaskEvent({ type: "willHandle", id: id, name: name }); |
- } |
- // These resolving functions simply forward the exception, so |
- // don't create a new debugEvent. |
- var callbacks = CreateResolvingFunctions(promise, false); |
- try { |
- %_Call(then, resolution, callbacks.resolve, callbacks.reject); |
- } catch (e) { |
- %_Call(callbacks.reject, UNDEFINED, e); |
- } |
- if (instrumenting) { |
- %DebugAsyncTaskEvent({ type: "didHandle", id: id, name: name }); |
- } |
- }); |
- if (instrumenting) { |
- id = ++lastMicrotaskId; |
- %DebugAsyncTaskEvent({ type: "enqueue", id: id, name: name }); |
- } |
+ var callbacks = CreateResolvingFunctions(promise, false); |
+ %EnqueuePromiseResolveThenableJob( |
+ promise, resolution, then, callbacks.resolve, callbacks.reject); |
return; |
} |
} |
@@ -610,7 +589,7 @@ utils.InstallFunctions(GlobalPromise.prototype, DONT_ENUM, [ |
"promise_has_user_defined_reject_handler", PromiseHasUserDefinedRejectHandler, |
"promise_reject", DoRejectPromise, |
"promise_resolve", ResolvePromise, |
- "promise_then", PromiseThen, |
+ "promise_then", PromiseThen |
]); |
// This allows extras to create promises quickly without building extra |