Debian Codegraph @

js/src/tests/test262/built-ins/Promise/allSettled/ctx-non-ctor.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 non-constructor value
7 esid: sec-promise.allsettled
8 info: |
9 ...
10 3. Let promiseCapability be ? NewPromiseCapability(C).
11
12 NewPromiseCapability ( C )
13
14 1. If IsConstructor(C) is false, throw a TypeError exception.
15 features: [Promise.allSettled]
16 ---*/
17
18 assert.throws(TypeError, function() {
19 Promise.allSettled.call(eval);
20 });
21
22 reportCompare(0, 0);