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

Unified Diff: src/js/promise.js

Issue 2575313002: [promisehook] Implement PromiseHook (Closed)
Patch Set: rebase + add comments 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
« no previous file with comments | « src/js/async-await.js ('k') | src/promise-utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/js/promise.js
diff --git a/src/js/promise.js b/src/js/promise.js
index d66ae1a9ca40b293886ba6745ab866e7b94f3042..7cd789295644f8be560f8c85346fd9c279720024 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;
}
« no previous file with comments | « src/js/async-await.js ('k') | src/promise-utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698