mirror of
https://github.com/tc39/test262.git
synced 2025-07-31 01:44:54 +02:00
Now.timeZoneId() returns a string so that it can be used to construct objects that have the builtin time zone behaviour. Normative PR: https://github.com/tc39/proposal-temporal/pull/2482
22 lines
833 B
JavaScript
22 lines
833 B
JavaScript
// Copyright (C) 2021 the V8 project authors. All rights reserved.
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
|
|
|
/*---
|
|
esid: sec-temporal.now.timezoneid
|
|
description: Temporal.Now.timeZoneId does not implement [[Construct]]
|
|
info: |
|
|
ECMAScript Function Objects
|
|
|
|
Built-in function objects that are not identified as constructors do not
|
|
implement the [[Construct]] internal method unless otherwise specified in
|
|
the description of a particular function.
|
|
includes: [isConstructor.js]
|
|
features: [Reflect.construct, Temporal, arrow-function]
|
|
---*/
|
|
|
|
assert.sameValue(isConstructor(Temporal.Now.timeZoneId), false, 'isConstructor(Temporal.Now.timeZoneId) must return false');
|
|
|
|
assert.throws(TypeError, () => {
|
|
new Temporal.Now.timeZoneId();
|
|
}, 'new Temporal.Now.timeZoneId() throws a TypeError exception');
|