mirror of
https://github.com/tc39/test262.git
synced 2025-07-24 06:25:30 +02:00
Temporal.now.timeZone: improve coverage
This commit is contained in:
parent
19c5e38118
commit
802f22bf0e
@ -335,3 +335,7 @@ json-modules
|
|||||||
# Resizable Arraybuffer
|
# Resizable Arraybuffer
|
||||||
# https://github.com/tc39/proposal-resizablearraybuffer
|
# https://github.com/tc39/proposal-resizablearraybuffer
|
||||||
resizable-arraybuffer
|
resizable-arraybuffer
|
||||||
|
|
||||||
|
# Temporal
|
||||||
|
# https://github.com/tc39/proposal-temporal
|
||||||
|
Temporal
|
||||||
|
15
test/built-ins/Temporal/now/timeZone/extensible.js
Normal file
15
test/built-ins/Temporal/now/timeZone/extensible.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
// 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.timezone
|
||||||
|
description: Temporal.now.timeZone is extensible.
|
||||||
|
info: |
|
||||||
|
## 17 ECMAScript Standard Built-in Objects
|
||||||
|
|
||||||
|
Unless specified otherwise, the [[Extensible]] internal slot
|
||||||
|
of a built-in object initially has the value true.
|
||||||
|
features: [Temporal]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert(Object.isExtensible(Temporal.now.timeZone));
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
esid: sec-temporal.now.timezone
|
esid: sec-temporal.now.timezone
|
||||||
|
description: Temporal.now.timeZone.length is 0
|
||||||
info: |
|
info: |
|
||||||
Every built-in function object, including constructors, has a "length" property whose value is
|
Every built-in function object, including constructors, has a "length" property whose value is
|
||||||
an integer. Unless otherwise specified, this value is equal to the largest number of named
|
an integer. Unless otherwise specified, this value is equal to the largest number of named
|
||||||
@ -13,6 +14,7 @@ info: |
|
|||||||
Unless otherwise specified, the "length" property of a built-in function object has the
|
Unless otherwise specified, the "length" property of a built-in function object has the
|
||||||
attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
|
attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }.
|
||||||
includes: [propertyHelper.js]
|
includes: [propertyHelper.js]
|
||||||
|
features: [Temporal]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
verifyProperty(Temporal.now.timeZone, "length", {
|
verifyProperty(Temporal.now.timeZone, "length", {
|
||||||
|
26
test/built-ins/Temporal/now/timeZone/name.js
Normal file
26
test/built-ins/Temporal/now/timeZone/name.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
// 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.timezone
|
||||||
|
description: Temporal.now.timeZone.name is "timeZone".
|
||||||
|
info: |
|
||||||
|
## 17 ECMAScript Standard Built-in Objects:
|
||||||
|
Every built-in Function object, including constructors, that is not
|
||||||
|
identified as an anonymous function has a name property whose value is a
|
||||||
|
String.
|
||||||
|
|
||||||
|
Unless otherwise specified, the name property of a built-in Function object,
|
||||||
|
if it exists, has the attributes { [[Writable]]: false, [[Enumerable]]:
|
||||||
|
false, [[Configurable]]: true }.
|
||||||
|
includes: [propertyHelper.js]
|
||||||
|
features: [Temporal]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(Temporal.now.timeZone.name, 'timeZone');
|
||||||
|
|
||||||
|
verifyProperty(Temporal.now.timeZone, 'name', {
|
||||||
|
enumerable: false,
|
||||||
|
writable: false,
|
||||||
|
configurable: true
|
||||||
|
});
|
@ -3,6 +3,8 @@
|
|||||||
|
|
||||||
/*---
|
/*---
|
||||||
esid: sec-temporal.now.timezone
|
esid: sec-temporal.now.timezone
|
||||||
|
description: Each invocation of the function produces a distinct object value
|
||||||
|
features: [Temporal]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const tz = Temporal.now.timeZone;
|
const tz = Temporal.now.timeZone;
|
||||||
|
21
test/built-ins/Temporal/now/timeZone/not-a-constructor.js
Normal file
21
test/built-ins/Temporal/now/timeZone/not-a-constructor.js
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
// 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.timezone
|
||||||
|
description: Temporal.now.timeZone 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]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(isConstructor(Temporal.now.timeZone), false, 'isConstructor(Temporal.now.timeZone) must return false');
|
||||||
|
|
||||||
|
assert.throws(TypeError, () => {
|
||||||
|
new Temporal.now.timeZone();
|
||||||
|
}, '`new Temporal.now.timeZone()` throws TypeError');
|
19
test/built-ins/Temporal/now/timeZone/prop-desc.js
Normal file
19
test/built-ins/Temporal/now/timeZone/prop-desc.js
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
// 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.timezone
|
||||||
|
description: The "timeZone" property of Temporal.now
|
||||||
|
info: |
|
||||||
|
Section 17: Every other data property described in clauses 18 through 26
|
||||||
|
and in Annex B.2 has the attributes { [[Writable]]: true,
|
||||||
|
[[Enumerable]]: false, [[Configurable]]: true } unless otherwise specified.
|
||||||
|
includes: [propertyHelper.js]
|
||||||
|
features: [Temporal]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
verifyProperty(Temporal.now, 'timeZone', {
|
||||||
|
enumerable: false,
|
||||||
|
writable: true,
|
||||||
|
configurable: true
|
||||||
|
});
|
15
test/built-ins/Temporal/now/timeZone/return-value.js
Normal file
15
test/built-ins/Temporal/now/timeZone/return-value.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
// 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.timezone
|
||||||
|
description: Temporal.now.timeZone returns an instance of the TimeZone constructor
|
||||||
|
info: |
|
||||||
|
1. Return ? SystemTimeZone().
|
||||||
|
features: [Temporal]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(
|
||||||
|
Object.getPrototypeOf(Temporal.now.timeZone()),
|
||||||
|
Temporal.TimeZone.prototype
|
||||||
|
);
|
Loading…
x
Reference in New Issue
Block a user