Commit d390e11e authored by gsathya's avatar gsathya Committed by Commit bot

[promises] remove if kPending check

FulfillPromise is always called when a promise is in a pending state
which makes this check redundant.

Review-Url: https://codereview.chromium.org/2442373002
Cr-Commit-Position: refs/heads/master@{#40556}
parent 438c5eb2
...@@ -143,14 +143,12 @@ function PromiseInit(promise) { ...@@ -143,14 +143,12 @@ function PromiseInit(promise) {
} }
function FulfillPromise(promise, status, value, promiseQueue) { function FulfillPromise(promise, status, value, promiseQueue) {
if (GET_PRIVATE(promise, promiseStateSymbol) === kPending) { var tasks = GET_PRIVATE(promise, promiseQueue);
var tasks = GET_PRIVATE(promise, promiseQueue); if (!IS_UNDEFINED(tasks)) {
if (!IS_UNDEFINED(tasks)) { var deferred = GET_PRIVATE(promise, promiseDeferredReactionSymbol);
var deferred = GET_PRIVATE(promise, promiseDeferredReactionSymbol); PromiseEnqueue(value, tasks, deferred, status);
PromiseEnqueue(value, tasks, deferred, status);
}
PromiseSet(promise, status, value);
} }
PromiseSet(promise, status, value);
} }
function PromiseHandle(value, handler, deferred) { function PromiseHandle(value, handler, deferred) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment