Promise: use .then($DONE, $DONE) wherever possible

This commit is contained in:
Rick Waldron 2020-06-24 15:22:00 -04:00
parent 040eb5393a
commit 2f12ab71f8
14 changed files with 14 additions and 14 deletions

View File

@ -39,5 +39,5 @@ Promise.all.call(Custom, values)
.then(() => {
assert.sameValue(presolveCallCount, 0, '`Promise.resolve` is never invoked');
assert.sameValue(cresolveCallCount, 3, '`Custom.resolve` invoked once for every iterated promise');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -30,5 +30,5 @@ Promise.resolve = function(...args) {
Promise.all(values)
.then(() => {
assert.sameValue(callCount, 3, '`then` invoked once for every iterated promise');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -30,5 +30,5 @@ Promise.resolve = function(...args) {
Promise.all(values)
.then(() => {
assert.sameValue(callCount, 3, '`Promise.resolve` invoked once for every iterated value');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -39,5 +39,5 @@ Promise.allSettled.call(Custom, values)
.then(() => {
assert.sameValue(presolveCallCount, 0, '`Promise.resolve` is never invoked');
assert.sameValue(cresolveCallCount, 3, '`Custom.resolve` invoked once for every iterated promise');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -30,5 +30,5 @@ Promise.resolve = function(...args) {
Promise.allSettled(values)
.then(() => {
assert.sameValue(callCount, 3, '`then` invoked once for every iterated promise');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -30,5 +30,5 @@ Promise.resolve = function(...args) {
Promise.allSettled(values)
.then(() => {
assert.sameValue(callCount, 3, '`Promise.resolve` invoked once for every iterated value');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -39,5 +39,5 @@ Promise.any.call(Custom, values)
.then(() => {
assert.sameValue(presolveCallCount, 0, '`Promise.resolve` is never invoked');
assert.sameValue(cresolveCallCount, 3, '`Custom.resolve` invoked once for every iterated promise');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -30,5 +30,5 @@ Promise.resolve = function(...args) {
Promise.any(values)
.then(() => {
assert.sameValue(callCount, 3, '`then` invoked once for every iterated promise');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -39,5 +39,5 @@ Promise.any.call(Custom, values)
.then(() => {
assert.sameValue(presolveCallCount, 0, '`Promise.resolve` is never invoked');
assert.sameValue(cresolveCallCount, 3, '`Custom.resolve` invoked once for every iterated promise');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -30,5 +30,5 @@ Promise.resolve = function(...args) {
Promise.any(values)
.then(() => {
assert.sameValue(callCount, 3, '`Promise.resolve` invoked once for every iterated value');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -38,4 +38,4 @@ promises.forEach(promise => {
Promise.any(promises)
.then(() => {
assert.sameValue(callCount, 3, '`then` invoked once for every iterated value');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -39,5 +39,5 @@ Promise.race.call(Custom, values)
.then(() => {
assert.sameValue(presolveCallCount, 0, '`Promise.resolve` is never invoked');
assert.sameValue(cresolveCallCount, 3, '`Custom.resolve` invoked once for every item in iterable arg');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -30,5 +30,5 @@ Promise.resolve = function(...args) {
Promise.race(values)
.then(() => {
assert.sameValue(callCount, 3, '`then` invoked once for every item in iterable arg');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);

View File

@ -30,5 +30,5 @@ Promise.resolve = function(...args) {
Promise.race(values)
.then(() => {
assert.sameValue(callCount, 3, '`Promise.resolve` invoked once for every item in iterable arg');
}, $DONE).then($DONE, $DONE);
}).then($DONE, $DONE);