Promise.any: convert sync test to async test to ensure run to completion

This commit is contained in:
Rick Waldron 2020-03-12 11:03:07 -04:00
parent 860e02ad28
commit e0abeaa4df
1 changed files with 7 additions and 3 deletions

View File

@ -14,6 +14,8 @@ info: |
Runtime Semantics: PerformPromiseAny
r. Perform ? Invoke(nextPromise, "then", « resultCapability.[[Resolve]], rejectElement »).
flags: [async]
features: [Promise.any]
---*/
@ -48,6 +50,8 @@ p1.then = p2.then = p3.then = function(a, b) {
callCount += 1;
};
Promise.any([p1, p2, p3]);
assert.sameValue(callCount, 3, '`then` invoked once for every iterated value');
Promise.any([p1, p2, p3])
.then(function() {
assert.sameValue(callCount, 3, '`then` invoked once for every iterated value');
$DONE();
}, $DONE);