Promise.any: empty iterable rejects with AggregateError

This commit is contained in:
Rick Waldron 2020-03-16 15:21:06 -04:00
parent 272e9abed4
commit e0f0c7860b
1 changed files with 6 additions and 2 deletions

View File

@ -6,11 +6,15 @@ description: Promise.any([]) rejects immediately
esid: sec-promise.any
flags: [async]
includes: [promiseHelper.js]
features: [Promise.any]
features: [AggregateError, Promise.any]
---*/
Promise.any([])
.then(
() => $DONE('The promise should be rejected, but was resolved'),
() => $DONE()
error => {
assert(error instanceof AggregateError);
assert.sameValue(error.errors.length, 0);
$DONE()
}
);