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

Unified Diff: src/js/promise.js

Issue 2575313002: [promisehook] Implement PromiseHook (Closed)
Patch Set: add tests Created 4 years 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
Index: src/js/promise.js
diff --git a/src/js/promise.js b/src/js/promise.js
index 35bdf188216dd4027b52dc3702b1bf57e77a3c86..7106464517b10e792e3ecfac4f1bfeb72c74be02 100644
--- a/src/js/promise.js
+++ b/src/js/promise.js
@@ -76,7 +76,7 @@ SET_PRIVATE(PromiseIdRejectHandler, promiseForwardingHandlerSymbol, true);
// This is used by utils and v8-extras.
function PromiseCreate() {
- return %promise_internal_constructor();
+ return %promise_internal_constructor(UNDEFINED);
}
// Only used by async-await.js
@@ -92,9 +92,9 @@ function DoRejectPromise(promise, reason) {
// The resultCapability.promise is only ever fulfilled internally,
// so we don't need the closures to protect against accidentally
// calling them multiple times.
-function CreateInternalPromiseCapability() {
+function CreateInternalPromiseCapability(parent) {
return {
- promise: %promise_internal_constructor(),
+ promise: %promise_internal_constructor(parent),
resolve: UNDEFINED,
reject: UNDEFINED
};
@@ -105,7 +105,7 @@ function CreateInternalPromiseCapability() {
function NewPromiseCapability(C, debugEvent) {
if (C === GlobalPromise) {
// Optimized case, avoid extra closure.
- var promise = %promise_internal_constructor();
+ var promise = %promise_internal_constructor(UNDEFINED);
// TODO(gsathya): Remove container for callbacks when this is
// moved to CPP/TF.
var callbacks = %create_resolving_functions(promise, debugEvent);
@@ -168,7 +168,7 @@ function PromiseResolve(x) {
// Avoid creating resolving functions.
if (this === GlobalPromise) {
- var promise = %promise_internal_constructor();
+ var promise = %promise_internal_constructor(UNDEFINED);
%promise_resolve(promise, x);
return promise;
}
« src/isolate.cc ('K') | « src/js/async-await.js ('k') | src/runtime/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698