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

Unified Diff: src/promise.js

Issue 393283007: Introduce more debug events for promises. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Check result length in the test as well Created 6 years, 5 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 | « src/debug-debugger.js ('k') | test/mjsunit/es6/debug-promises-new-event.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/promise.js
diff --git a/src/promise.js b/src/promise.js
index 2797d79acbc83941058bc7f189dc228957fc82c9..09582a279758b1ba43fb4991c567cc784ca5a211 100644
--- a/src/promise.js
+++ b/src/promise.js
@@ -40,7 +40,7 @@ var lastMicrotaskId = 0;
throw MakeTypeError('resolver_not_a_function', [resolver]);
var promise = PromiseInit(this);
if (DEBUG_IS_ACTIVE) {
- %DebugPromiseEvent({ type : "new Promise",
+ %DebugPromiseEvent({ type : "new",
promise: this,
resolver: resolver });
}
@@ -62,6 +62,12 @@ var lastMicrotaskId = 0;
SET_PRIVATE(promise, promiseValue, value);
SET_PRIVATE(promise, promiseOnResolve, onResolve);
SET_PRIVATE(promise, promiseOnReject, onReject);
+ if (DEBUG_IS_ACTIVE && status !== 0) {
+ %DebugPromiseEvent({ type: "update",
+ promise: promise,
+ status: status,
+ value: value });
+ }
return promise;
}
@@ -234,6 +240,11 @@ var lastMicrotaskId = 0;
-1);
break;
}
+ if (DEBUG_IS_ACTIVE) {
+ %DebugPromiseEvent({ type: "chain",
+ promise: deferred.promise,
+ parentPromise: this });
+ }
return deferred.promise;
}
« no previous file with comments | « src/debug-debugger.js ('k') | test/mjsunit/es6/debug-promises-new-event.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698