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

Unified Diff: src/js/promise.js

Issue 2451133002: [promises] Remove FulfillPromise (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | no next file » | 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 7e0ad4906f798f2b8d36fd3a410e8c8db0637c9e..fb3a3d78cf2800adf4768c84395190f842150447 100644
--- a/src/js/promise.js
+++ b/src/js/promise.js
@@ -142,11 +142,6 @@ function PromiseInit(promise) {
return PromiseSet(promise, kPending, UNDEFINED);
}
-function FulfillPromise(promise, status, value, promiseQueue) {
- %PromiseFulfill(promise, status, value, promiseQueue);
- PromiseSet(promise, status, value);
-}
-
function PromiseHandle(value, handler, deferred) {
var debug_is_active = DEBUG_IS_ACTIVE;
try {
@@ -269,8 +264,9 @@ function ResolvePromise(promise, resolution) {
// This goes inside the if-else to save one symbol lookup in
// the slow path.
var thenableValue = GET_PRIVATE(resolution, promiseResultSymbol);
- FulfillPromise(promise, kFulfilled, thenableValue,
+ %PromiseFulfill(promise, kFulfilled, thenableValue,
promiseFulfillReactionsSymbol);
+ PromiseSet(promise, kFulfilled, thenableValue);
SET_PRIVATE(promise, promiseHasHandlerSymbol, true);
return;
} else if (thenableState === kRejected) {
@@ -298,8 +294,9 @@ function ResolvePromise(promise, resolution) {
return;
}
}
- FulfillPromise(promise, kFulfilled, resolution,
- promiseFulfillReactionsSymbol);
+ %PromiseFulfill(promise, kFulfilled, resolution,
+ promiseFulfillReactionsSymbol);
+ PromiseSet(promise, kFulfilled, resolution);
}
// ES#sec-rejectpromise
@@ -318,7 +315,8 @@ function RejectPromise(promise, reason, debugEvent) {
%PromiseRejectEvent(promise, reason, debugEvent);
}
}
- FulfillPromise(promise, kRejected, reason, promiseRejectReactionsSymbol)
+ %PromiseFulfill(promise, kRejected, reason, promiseRejectReactionsSymbol)
+ PromiseSet(promise, kRejected, reason);
}
// Export to bindings
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698