mirror of
https://github.com/tc39/test262.git
synced 2025-07-25 15:04:43 +02:00
Promise.any: empty iterable rejects with AggregateError
This commit is contained in:
parent
272e9abed4
commit
e0f0c7860b
@ -6,11 +6,15 @@ description: Promise.any([]) rejects immediately
|
|||||||
esid: sec-promise.any
|
esid: sec-promise.any
|
||||||
flags: [async]
|
flags: [async]
|
||||||
includes: [promiseHelper.js]
|
includes: [promiseHelper.js]
|
||||||
features: [Promise.any]
|
features: [AggregateError, Promise.any]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
Promise.any([])
|
Promise.any([])
|
||||||
.then(
|
.then(
|
||||||
() => $DONE('The promise should be rejected, but was resolved'),
|
() => $DONE('The promise should be rejected, but was resolved'),
|
||||||
() => $DONE()
|
error => {
|
||||||
|
assert(error instanceof AggregateError);
|
||||||
|
assert.sameValue(error.errors.length, 0);
|
||||||
|
$DONE()
|
||||||
|
}
|
||||||
);
|
);
|
Loading…
x
Reference in New Issue
Block a user