Index: src/js/promise.js |
diff --git a/src/js/promise.js b/src/js/promise.js |
index ce62cf2379ca4c176b6719b26068439e9ad67c21..0cde9320e2c2da25395a7f9d3b19401603625a51 100644 |
--- a/src/js/promise.js |
+++ b/src/js/promise.js |
@@ -185,7 +185,7 @@ function PromiseHandle(value, handler, deferred) { |
} |
function PromiseEnqueue(value, tasks, deferreds, status) { |
- var id, name, beforeDebug, afterDebug, instrumenting = DEBUG_IS_ACTIVE; |
+ var id, name, instrumenting = DEBUG_IS_ACTIVE; |
if (instrumenting) { |
// In an async function, reuse the existing stack related to the outer |
@@ -204,14 +204,10 @@ function PromiseEnqueue(value, tasks, deferreds, status) { |
} else { |
id = PromiseNextMicrotaskID(); |
name = status === kFulfilled ? "Promise.resolve" : "Promise.reject"; |
- %DebugAsyncTaskEvent({ type: "enqueue", id: id, name: name }); |
+ %DebugAsyncTaskEvent("enqueue", id, name); |
} |
- |
- beforeDebug = { type: "willHandle", id: id, name: name }; |
- afterDebug = { type: "didHandle", id: id, name: name }; |
} |
- |
- %EnqueuePromiseReactionJob(value, tasks, deferreds, beforeDebug, afterDebug); |
+ %EnqueuePromiseReactionJob(value, tasks, deferreds, id, name); |
} |
function PromiseAttachCallbacks(promise, deferred, onResolve, onReject) { |
@@ -305,33 +301,18 @@ function ResolvePromise(promise, resolution) { |
if (IS_CALLABLE(then)) { |
var callbacks = CreateResolvingFunctions(promise, false); |
- var id, before_debug_event, after_debug_event; |
- var instrumenting = DEBUG_IS_ACTIVE; |
+ var id, name, instrumenting = DEBUG_IS_ACTIVE; |
if (instrumenting) { |
if (IsPromise(resolution)) { |
// Mark the dependency of the new promise on the resolution |
SET_PRIVATE(resolution, promiseHandledBySymbol, promise); |
} |
id = PromiseNextMicrotaskID(); |
- before_debug_event = { |
- type: "willHandle", |
- id: id, |
- name: "PromiseResolveThenableJob" |
- }; |
- after_debug_event = { |
- type: "didHandle", |
- id: id, |
- name: "PromiseResolveThenableJob" |
- }; |
- %DebugAsyncTaskEvent({ |
- type: "enqueue", |
- id: id, |
- name: "PromiseResolveThenableJob" |
- }); |
+ name = "PromiseResolveThenableJob"; |
+ %DebugAsyncTaskEvent("enqueue", id, name); |
} |
%EnqueuePromiseResolveThenableJob( |
- resolution, then, callbacks.resolve, callbacks.reject, |
- before_debug_event, after_debug_event); |
+ resolution, then, callbacks.resolve, callbacks.reject, id, name); |
return; |
} |
} |