Debian Codegraph @

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