Debian Codegraph @

js/src/tests/test262/built-ins/Error/isError/is-a-constructor.js

raw
1 // |reftest| shell-option(--enable-error-iserror) skip-if(!Error.isError||!xulRuntime.shell) -- Error.isError 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 esid: sec-error.iserror
7 description: >
8 Error.isError does not implement [[Construct]]
9 info: |
10 IsConstructor ( argument )
11
12 The abstract operation IsConstructor takes argument argument (an ECMAScript language value).
13 It determines if argument is a function object with a [[Construct]] internal method.
14 It performs the following steps when called:
15
16 If Type(argument) is not Object, return false.
17 If argument has a [[Construct]] internal method, return true.
18 Return false.
19 includes: [isConstructor.js]
20 features: [Error.isError, Reflect.construct]
21 ---*/
22
23 assert.sameValue(isConstructor(Error.isError), false, 'isConstructor(Error.isError) must return false');
24 assert.throws(TypeError, function () { new Error.isError(); });
25
26
27 reportCompare(0, 0);