Debian Codegraph @

js/src/tests/test262/built-ins/Promise/any/ctx-ctor-throws.js

raw
1 // Copyright (C) 2019 Sergey Rubanov. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 description: >
6 Promise.any invoked on a constructor value that throws an error
7 esid: sec-promise.any
8 info: |
9 2. Let promiseCapability be ? NewPromiseCapability(C).
10
11 NewPromiseCapability
12
13 ...
14 7. Let promise be ? Construct(C, « executor »).
15
16 features: [Promise.any]
17 ---*/
18
19 function CustomPromise() {
20 throw new Test262Error();
21 }
22
23 assert.throws(Test262Error, function() {
24 Promise.any.call(CustomPromise);
25 });
26
27 reportCompare(0, 0);