Debian Codegraph @

js/src/tests/test262/built-ins/Promise/try/not-a-constructor.js

raw
1 // |reftest| shell-option(--enable-promise-try) skip-if(!Promise.try||!xulRuntime.shell) -- promise-try is not enabled unconditionally, requires shell-options
2 // Copyright (C) 2024 Jordan Harband. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 description: >
7 Promise.try does not implement [[Construct]], is not new-able
8 includes: [isConstructor.js]
9 features: [Reflect.construct, promise-try]
10 ---*/
11
12 assert.sameValue(isConstructor(Promise.try), false, 'isConstructor(Promise.all) must return false');
13
14 assert.throws(TypeError, function () {
15 new Promise.try(function () {});
16 });
17
18
19 reportCompare(0, 0);