blob: b7e4ca8abec7f8a6f01b7212f2ecda4e7d5a3cf5 [file] [log] [blame]
// 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: >
If the constructor's `resolve` method is not callable, reject with a TypeError.
info: |
Let result be PerformPromiseAny(iteratorRecord, C, promiseCapability).
Runtime Semantics: PerformPromiseAny
Let promiseResolve be ? Get(constructor, "resolve").
If ! IsCallable(promiseResolve) is false, throw a TypeError exception.
flags: [async]
features: [Promise.any, arrow-function]
---*/
Promise.resolve = null;
Promise.any([1])
.then(
() => $DONE('The promise should not be resolved.'),
error => {
assert(error instanceof TypeError);
}
).then($DONE, $DONE);