mirror of
https://github.com/tc39/test262.git
synced 2025-07-21 04:54:44 +02:00
Promise.any: review fixes, 2
This commit is contained in:
parent
b21b0c1820
commit
499b748dca
@ -24,9 +24,6 @@ Object.defineProperty(Promise, Symbol.species, {
|
||||
get() {
|
||||
throw new Test262Error('Erroneous Get(C, @@species) via SpeciesConstructor() occurred.');
|
||||
}
|
||||
static resolve() {
|
||||
throw new Test262Error('Promise.resolve was reached');
|
||||
}
|
||||
});
|
||||
|
||||
Promise.any([1]).then(() => $DONE(), $DONE);
|
||||
|
@ -1,22 +0,0 @@
|
||||
// Copyright (C) 2020 Rick Waldron. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
esid: sec-promise.any
|
||||
description: >
|
||||
Promise.any resolves with the first item that does not reject.
|
||||
flags: [async]
|
||||
features: [Promise.any, arrow-function]
|
||||
---*/
|
||||
|
||||
let fulfillables = [
|
||||
Promise.reject('a'),
|
||||
new Promise((resolve, reject) => reject('b')),
|
||||
Promise.all([Promise.reject('c')]),
|
||||
Promise.resolve(Promise.reject('d').finally(v => v)),
|
||||
];
|
||||
|
||||
Promise.any(fulfillables)
|
||||
.then((resolution) => {
|
||||
assert.sameValue(resolution, 'd');
|
||||
}).then($DONE, $DONE);
|
Loading…
x
Reference in New Issue
Block a user