Commit a0ac642b authored by aandrey's avatar aandrey Committed by Commit bot

Fix Promise.resolve/Promise.reject unnecessarily scheduling a microtask.

R=rossberg@chromium.org, yangguo@chromium.org, adamk@chromium.org
LOG=N

Review URL: https://codereview.chromium.org/777703002

Cr-Commit-Position: refs/heads/master@{#25650}
parent ed95aaab
......@@ -74,7 +74,8 @@ var lastMicrotaskId = 0;
function PromiseDone(promise, status, value, promiseQueue) {
if (GET_PRIVATE(promise, promiseStatus) === 0) {
PromiseEnqueue(value, GET_PRIVATE(promise, promiseQueue), status);
var tasks = GET_PRIVATE(promise, promiseQueue);
if (tasks.length) PromiseEnqueue(value, tasks, status);
PromiseSet(promise, status, value);
}
}
......
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