Debian Codegraph @

js/src/tests/test262/built-ins/Temporal/Now/timeZoneId/not-a-constructor.js

raw
1 // |reftest| shell-option(--enable-temporal) skip-if(!this.hasOwnProperty('Temporal')||!xulRuntime.shell) -- Temporal is not enabled unconditionally, requires shell-options
2 // Copyright (C) 2021 the V8 project authors. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 esid: sec-temporal.now.timezoneid
7 description: Temporal.Now.timeZoneId does not implement [[Construct]]
8 info: |
9 ECMAScript Function Objects
10
11 Built-in function objects that are not identified as constructors do not
12 implement the [[Construct]] internal method unless otherwise specified in
13 the description of a particular function.
14 includes: [isConstructor.js]
15 features: [Reflect.construct, Temporal, arrow-function]
16 ---*/
17
18 assert.sameValue(isConstructor(Temporal.Now.timeZoneId), false, 'isConstructor(Temporal.Now.timeZoneId) must return false');
19
20 assert.throws(TypeError, () => {
21 new Temporal.Now.timeZoneId();
22 }, 'new Temporal.Now.timeZoneId() throws a TypeError exception');
23
24 reportCompare(0, 0);