Debian Codegraph @

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

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