Promise.any: review fixes, 2

This commit is contained in:
Rick Waldron 2020-03-25 12:14:32 -04:00
parent b21b0c1820
commit 499b748dca
2 changed files with 0 additions and 25 deletions

View File

@ -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);

View File

@ -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);