diff --git a/test/built-ins/Temporal/Instant/basic.js b/test/built-ins/Temporal/Instant/basic.js index 2e99e5ef5e..455837a519 100644 --- a/test/built-ins/Temporal/Instant/basic.js +++ b/test/built-ins/Temporal/Instant/basic.js @@ -9,12 +9,10 @@ features: [Temporal] const bigIntInstant = new Temporal.Instant(217175010123456789n); assert(bigIntInstant instanceof Temporal.Instant, "BigInt instanceof"); -assert.sameValue(bigIntInstant.epochSeconds, 217175010, "BigInt epochSeconds"); assert.sameValue(bigIntInstant.epochMilliseconds, 217175010123, "BigInt epochMilliseconds"); const stringInstant = new Temporal.Instant("217175010123456789"); assert(stringInstant instanceof Temporal.Instant, "String instanceof"); -assert.sameValue(stringInstant.epochSeconds, 217175010, "String epochSeconds"); assert.sameValue(stringInstant.epochMilliseconds, 217175010123, "String epochMilliseconds"); assert.throws(SyntaxError, () => new Temporal.Instant("abc123"), "invalid BigInt syntax"); diff --git a/test/built-ins/Temporal/Instant/fromEpochMicroseconds/basic.js b/test/built-ins/Temporal/Instant/fromEpochMicroseconds/basic.js deleted file mode 100644 index 73ffb79e09..0000000000 --- a/test/built-ins/Temporal/Instant/fromEpochMicroseconds/basic.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2021 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.instant.fromepochmicroseconds -description: Basic tests for Instant.fromEpochMicroseconds(). -features: [BigInt, Temporal] ----*/ - -const afterEpoch = Temporal.Instant.fromEpochMicroseconds(217175010_123_456n); -assert.sameValue(afterEpoch.epochNanoseconds, 217175010_123_456_000n, "fromEpochMicroseconds post epoch"); - -const beforeEpoch = Temporal.Instant.fromEpochMicroseconds(-217175010_876_543n); -assert.sameValue(beforeEpoch.epochNanoseconds, -217175010_876_543_000n, "fromEpochMicroseconds pre epoch"); diff --git a/test/built-ins/Temporal/Instant/fromEpochMicroseconds/builtin.js b/test/built-ins/Temporal/Instant/fromEpochMicroseconds/builtin.js deleted file mode 100644 index 073b7f21b2..0000000000 --- a/test/built-ins/Temporal/Instant/fromEpochMicroseconds/builtin.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (C) 2021 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.instant.fromepochmicroseconds -description: Tests that Temporal.Instant.fromEpochMicroseconds meets the requirements for built-in objects -info: | - Built-in functions that are not constructors do not have a "prototype" property unless - otherwise specified in the description of a particular function. - - Unless specified otherwise, a built-in object that is callable as a function is a built-in - function object with the characteristics described in 10.3. Unless specified otherwise, the - [[Extensible]] internal slot of a built-in object initially has the value true. - - Unless otherwise specified every built-in function and every built-in constructor has the - Function prototype object [...] as the value of its [[Prototype]] internal slot. -features: [Temporal] ----*/ - -assert.sameValue(Object.isExtensible(Temporal.Instant.fromEpochMicroseconds), - true, "Built-in objects must be extensible."); - -assert.sameValue(Object.prototype.toString.call(Temporal.Instant.fromEpochMicroseconds), - "[object Function]", "Object.prototype.toString"); - -assert.sameValue(Object.getPrototypeOf(Temporal.Instant.fromEpochMicroseconds), - Function.prototype, "prototype"); - -assert.sameValue(Temporal.Instant.fromEpochMicroseconds.hasOwnProperty("prototype"), - false, "prototype property"); diff --git a/test/built-ins/Temporal/Instant/fromEpochMicroseconds/length.js b/test/built-ins/Temporal/Instant/fromEpochMicroseconds/length.js deleted file mode 100644 index a5bb9922d3..0000000000 --- a/test/built-ins/Temporal/Instant/fromEpochMicroseconds/length.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (C) 2020 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.instant.fromepochmicroseconds -description: Temporal.Instant.fromEpochMicroseconds.length is 1 -info: | - 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 - arguments shown in the subclause headings for the function description. Optional parameters - (which are indicated with brackets: [ ]) or rest parameters (which are shown using the form - «...name») are not included in the default argument count. - - Unless otherwise specified, the "length" property of a built-in function object has the - attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -verifyProperty(Temporal.Instant.fromEpochMicroseconds, "length", { - value: 1, - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/Instant/fromEpochMicroseconds/name.js b/test/built-ins/Temporal/Instant/fromEpochMicroseconds/name.js deleted file mode 100644 index 4ed946db31..0000000000 --- a/test/built-ins/Temporal/Instant/fromEpochMicroseconds/name.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2020 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.instant.fromepochmicroseconds -description: Temporal.Instant.fromEpochMicroseconds.name is "fromEpochMicroseconds" -info: | - 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, this value - is the name that is given to the function in this specification. - - 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] ----*/ - -verifyProperty(Temporal.Instant.fromEpochMicroseconds, "name", { - value: "fromEpochMicroseconds", - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/Instant/fromEpochMicroseconds/not-a-constructor.js b/test/built-ins/Temporal/Instant/fromEpochMicroseconds/not-a-constructor.js deleted file mode 100644 index 7bb9615fc5..0000000000 --- a/test/built-ins/Temporal/Instant/fromEpochMicroseconds/not-a-constructor.js +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2021 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.instant.fromepochmicroseconds -description: Temporal.Instant.fromEpochMicroseconds does not implement [[Construct]], is not new-able -info: | - 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.throws(TypeError, () => { - new Temporal.Instant.fromEpochMicroseconds(); -}, "Calling as constructor"); - -assert.sameValue(isConstructor(Temporal.Instant.fromEpochMicroseconds), false, - "isConstructor(Temporal.Instant.fromEpochMicroseconds)"); diff --git a/test/built-ins/Temporal/Instant/fromEpochMicroseconds/prop-desc.js b/test/built-ins/Temporal/Instant/fromEpochMicroseconds/prop-desc.js deleted file mode 100644 index bdb25776b4..0000000000 --- a/test/built-ins/Temporal/Instant/fromEpochMicroseconds/prop-desc.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2021 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.instant.fromepochmicroseconds -description: The "fromEpochMicroseconds" property of Temporal.Instant -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -assert.sameValue( - typeof Temporal.Instant.fromEpochMicroseconds, - "function", - "`typeof Instant.fromEpochMicroseconds` is `function`" -); - -verifyProperty(Temporal.Instant, "fromEpochMicroseconds", { - writable: true, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/Instant/fromEpochMicroseconds/subclassing-ignored.js b/test/built-ins/Temporal/Instant/fromEpochMicroseconds/subclassing-ignored.js deleted file mode 100644 index b2542670ac..0000000000 --- a/test/built-ins/Temporal/Instant/fromEpochMicroseconds/subclassing-ignored.js +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) 2021 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.instant.fromepochmicroseconds -description: The receiver is never called by fromEpochMicroseconds() -includes: [temporalHelpers.js] -features: [Temporal] ----*/ - -TemporalHelpers.checkSubclassingIgnoredStatic( - Temporal.Instant, - "fromEpochMicroseconds", - [10n], - (result) => { - assert.sameValue(result.epochNanoseconds, 10_000n, "epochNanoseconds result"); - }, -); diff --git a/test/built-ins/Temporal/Instant/fromEpochSeconds/basic.js b/test/built-ins/Temporal/Instant/fromEpochSeconds/basic.js deleted file mode 100644 index ad9f175660..0000000000 --- a/test/built-ins/Temporal/Instant/fromEpochSeconds/basic.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2021 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.instant.fromepochseconds -description: Basic tests for Instant.fromEpochSeconds(). -features: [BigInt, Temporal] ----*/ - -const afterEpoch = Temporal.Instant.fromEpochSeconds(217175010); -assert.sameValue(afterEpoch.epochNanoseconds, 217175010_000_000_000n, "fromEpochSeconds post epoch"); - -const beforeEpoch = Temporal.Instant.fromEpochSeconds(-217175010); -assert.sameValue(beforeEpoch.epochNanoseconds, -217175010_000_000_000n, "fromEpochSeconds pre epoch"); diff --git a/test/built-ins/Temporal/Instant/fromEpochSeconds/builtin.js b/test/built-ins/Temporal/Instant/fromEpochSeconds/builtin.js deleted file mode 100644 index 6fba9b7255..0000000000 --- a/test/built-ins/Temporal/Instant/fromEpochSeconds/builtin.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (C) 2021 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.instant.fromepochseconds -description: Tests that Temporal.Instant.fromEpochSeconds meets the requirements for built-in objects -info: | - Built-in functions that are not constructors do not have a "prototype" property unless - otherwise specified in the description of a particular function. - - Unless specified otherwise, a built-in object that is callable as a function is a built-in - function object with the characteristics described in 10.3. Unless specified otherwise, the - [[Extensible]] internal slot of a built-in object initially has the value true. - - Unless otherwise specified every built-in function and every built-in constructor has the - Function prototype object [...] as the value of its [[Prototype]] internal slot. -features: [Temporal] ----*/ - -assert.sameValue(Object.isExtensible(Temporal.Instant.fromEpochSeconds), - true, "Built-in objects must be extensible."); - -assert.sameValue(Object.prototype.toString.call(Temporal.Instant.fromEpochSeconds), - "[object Function]", "Object.prototype.toString"); - -assert.sameValue(Object.getPrototypeOf(Temporal.Instant.fromEpochSeconds), - Function.prototype, "prototype"); - -assert.sameValue(Temporal.Instant.fromEpochSeconds.hasOwnProperty("prototype"), - false, "prototype property"); diff --git a/test/built-ins/Temporal/Instant/fromEpochSeconds/length.js b/test/built-ins/Temporal/Instant/fromEpochSeconds/length.js deleted file mode 100644 index 5d0a1b1d79..0000000000 --- a/test/built-ins/Temporal/Instant/fromEpochSeconds/length.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (C) 2020 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.instant.fromepochseconds -description: Temporal.Instant.fromEpochSeconds.length is 1 -info: | - 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 - arguments shown in the subclause headings for the function description. Optional parameters - (which are indicated with brackets: [ ]) or rest parameters (which are shown using the form - «...name») are not included in the default argument count. - - Unless otherwise specified, the "length" property of a built-in function object has the - attributes { [[Writable]]: false, [[Enumerable]]: false, [[Configurable]]: true }. -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -verifyProperty(Temporal.Instant.fromEpochSeconds, "length", { - value: 1, - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/Instant/fromEpochSeconds/name.js b/test/built-ins/Temporal/Instant/fromEpochSeconds/name.js deleted file mode 100644 index 75720d6294..0000000000 --- a/test/built-ins/Temporal/Instant/fromEpochSeconds/name.js +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2020 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.instant.fromepochseconds -description: Temporal.Instant.fromEpochSeconds.name is "fromEpochSeconds" -info: | - 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, this value - is the name that is given to the function in this specification. - - 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] ----*/ - -verifyProperty(Temporal.Instant.fromEpochSeconds, "name", { - value: "fromEpochSeconds", - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/Instant/fromEpochSeconds/not-a-constructor.js b/test/built-ins/Temporal/Instant/fromEpochSeconds/not-a-constructor.js deleted file mode 100644 index 800103e638..0000000000 --- a/test/built-ins/Temporal/Instant/fromEpochSeconds/not-a-constructor.js +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (C) 2021 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.instant.fromepochseconds -description: Temporal.Instant.fromEpochSeconds does not implement [[Construct]], is not new-able -info: | - 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.throws(TypeError, () => { - new Temporal.Instant.fromEpochSeconds(); -}, "Calling as constructor"); - -assert.sameValue(isConstructor(Temporal.Instant.fromEpochSeconds), false, - "isConstructor(Temporal.Instant.fromEpochSeconds)"); diff --git a/test/built-ins/Temporal/Instant/fromEpochSeconds/prop-desc.js b/test/built-ins/Temporal/Instant/fromEpochSeconds/prop-desc.js deleted file mode 100644 index 48d51e344d..0000000000 --- a/test/built-ins/Temporal/Instant/fromEpochSeconds/prop-desc.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2021 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.instant.fromepochseconds -description: The "fromEpochSeconds" property of Temporal.Instant -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -assert.sameValue( - typeof Temporal.Instant.fromEpochSeconds, - "function", - "`typeof Instant.fromEpochSeconds` is `function`" -); - -verifyProperty(Temporal.Instant, "fromEpochSeconds", { - writable: true, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/Instant/fromEpochSeconds/subclassing-ignored.js b/test/built-ins/Temporal/Instant/fromEpochSeconds/subclassing-ignored.js deleted file mode 100644 index 334950198b..0000000000 --- a/test/built-ins/Temporal/Instant/fromEpochSeconds/subclassing-ignored.js +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) 2021 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.instant.fromepochseconds -description: The receiver is never called by fromEpochSeconds() -includes: [temporalHelpers.js] -features: [Temporal] ----*/ - -TemporalHelpers.checkSubclassingIgnoredStatic( - Temporal.Instant, - "fromEpochSeconds", - [10], - (result) => { - assert.sameValue(result.epochNanoseconds, 10_000_000_000n, "epochNanoseconds result"); - }, -); diff --git a/test/built-ins/Temporal/Instant/prototype/add/argument-string.js b/test/built-ins/Temporal/Instant/prototype/add/argument-string.js index 3dec39fc63..3f31114307 100644 --- a/test/built-ins/Temporal/Instant/prototype/add/argument-string.js +++ b/test/built-ins/Temporal/Instant/prototype/add/argument-string.js @@ -7,6 +7,6 @@ description: A string is parsed into the correct object when passed as the argum features: [Temporal] ---*/ -const instance = Temporal.Instant.fromEpochSeconds(10); +const instance = Temporal.Instant.fromEpochMilliseconds(10_000); const result = instance.add("PT3H"); assert.sameValue(result.epochNanoseconds, 10_810_000_000_000n, "epochNanoseconds result"); diff --git a/test/built-ins/Temporal/Instant/prototype/add/infinity-throws-rangeerror.js b/test/built-ins/Temporal/Instant/prototype/add/infinity-throws-rangeerror.js index 2f75efe04c..a2253c84c1 100644 --- a/test/built-ins/Temporal/Instant/prototype/add/infinity-throws-rangeerror.js +++ b/test/built-ins/Temporal/Instant/prototype/add/infinity-throws-rangeerror.js @@ -9,7 +9,7 @@ features: [Temporal] const fields = ["hours", "minutes", "seconds", "milliseconds", "microseconds", "nanoseconds"]; -const instance = Temporal.Instant.fromEpochSeconds(10); +const instance = Temporal.Instant.fromEpochMilliseconds(10_000); fields.forEach((field) => { assert.throws(RangeError, () => instance.add({ [field]: Infinity })); diff --git a/test/built-ins/Temporal/Instant/prototype/add/negative-infinity-throws-rangeerror.js b/test/built-ins/Temporal/Instant/prototype/add/negative-infinity-throws-rangeerror.js index 57d3bb46e2..9bd9fb14c1 100644 --- a/test/built-ins/Temporal/Instant/prototype/add/negative-infinity-throws-rangeerror.js +++ b/test/built-ins/Temporal/Instant/prototype/add/negative-infinity-throws-rangeerror.js @@ -9,7 +9,7 @@ features: [Temporal] const fields = ["hours", "minutes", "seconds", "milliseconds", "microseconds", "nanoseconds"]; -const instance = Temporal.Instant.fromEpochSeconds(10); +const instance = Temporal.Instant.fromEpochMilliseconds(10_000); fields.forEach((field) => { assert.throws(RangeError, () => instance.add({ [field]: -Infinity })); diff --git a/test/built-ins/Temporal/Instant/prototype/epochMicroseconds/basic.js b/test/built-ins/Temporal/Instant/prototype/epochMicroseconds/basic.js deleted file mode 100644 index 48b2dff6ee..0000000000 --- a/test/built-ins/Temporal/Instant/prototype/epochMicroseconds/basic.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (C) 2021 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-get-temporal.instant.prototype.epochmicroseconds -description: Basic tests for epochMicroseconds. -features: [BigInt, Temporal] ----*/ - -const afterEpoch = new Temporal.Instant(217175010_123_456_789n); -assert.sameValue(afterEpoch.epochMicroseconds, 217175010_123_456n, "epochMicroseconds post epoch"); -assert.sameValue(typeof afterEpoch.epochMicroseconds, "bigint", "epochMicroseconds value is a bigint"); - -const beforeEpoch = new Temporal.Instant(-217175010_876_543_211n); -assert.sameValue(beforeEpoch.epochMicroseconds, -217175010_876_544n, "epochMicroseconds pre epoch"); -assert.sameValue(typeof beforeEpoch.epochMicroseconds, "bigint", "epochMicroseconds value is a bigint"); diff --git a/test/built-ins/Temporal/Instant/prototype/epochMicroseconds/branding.js b/test/built-ins/Temporal/Instant/prototype/epochMicroseconds/branding.js deleted file mode 100644 index 654833ba08..0000000000 --- a/test/built-ins/Temporal/Instant/prototype/epochMicroseconds/branding.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2020 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-get-temporal.instant.prototype.epochmicroseconds -description: Throw a TypeError if the receiver is invalid -features: [Symbol, Temporal] ----*/ - -const epochMicroseconds = Object.getOwnPropertyDescriptor(Temporal.Instant.prototype, "epochMicroseconds").get; - -assert.sameValue(typeof epochMicroseconds, "function"); - -assert.throws(TypeError, () => epochMicroseconds.call(undefined), "undefined"); -assert.throws(TypeError, () => epochMicroseconds.call(null), "null"); -assert.throws(TypeError, () => epochMicroseconds.call(true), "true"); -assert.throws(TypeError, () => epochMicroseconds.call(""), "empty string"); -assert.throws(TypeError, () => epochMicroseconds.call(Symbol()), "symbol"); -assert.throws(TypeError, () => epochMicroseconds.call(1), "1"); -assert.throws(TypeError, () => epochMicroseconds.call({}), "plain object"); -assert.throws(TypeError, () => epochMicroseconds.call(Temporal.Instant), "Temporal.Instant"); -assert.throws(TypeError, () => epochMicroseconds.call(Temporal.Instant.prototype), "Temporal.Instant.prototype"); diff --git a/test/built-ins/Temporal/Instant/prototype/epochMicroseconds/prop-desc.js b/test/built-ins/Temporal/Instant/prototype/epochMicroseconds/prop-desc.js deleted file mode 100644 index c64fe27972..0000000000 --- a/test/built-ins/Temporal/Instant/prototype/epochMicroseconds/prop-desc.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2020 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-get-temporal.instant.prototype.epochmicroseconds -description: The "epochMicroseconds" property of Temporal.Instant.prototype -features: [Temporal] ----*/ - -const descriptor = Object.getOwnPropertyDescriptor(Temporal.Instant.prototype, "epochMicroseconds"); -assert.sameValue(typeof descriptor.get, "function"); -assert.sameValue(descriptor.set, undefined); -assert.sameValue(descriptor.enumerable, false); -assert.sameValue(descriptor.configurable, true); diff --git a/test/built-ins/Temporal/Instant/prototype/epochSeconds/basic.js b/test/built-ins/Temporal/Instant/prototype/epochSeconds/basic.js deleted file mode 100644 index 404b01c558..0000000000 --- a/test/built-ins/Temporal/Instant/prototype/epochSeconds/basic.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (C) 2021 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-get-temporal.instant.prototype.epochseconds -description: Basic tests for epochSeconds. -features: [BigInt, Temporal] ----*/ - -const afterEpoch = new Temporal.Instant(217175010_123_456_789n); -assert.sameValue(afterEpoch.epochSeconds, 217175010, "epochSeconds post epoch"); -assert.sameValue(typeof afterEpoch.epochSeconds, "number", "epochSeconds value is a number"); - -const beforeEpoch = new Temporal.Instant(-217175010_876_543_211n); -assert.sameValue(beforeEpoch.epochSeconds, -217175011, "epochSeconds pre epoch"); -assert.sameValue(typeof beforeEpoch.epochSeconds, "number", "epochSeconds value is a number"); diff --git a/test/built-ins/Temporal/Instant/prototype/epochSeconds/branding.js b/test/built-ins/Temporal/Instant/prototype/epochSeconds/branding.js deleted file mode 100644 index a6c30b798b..0000000000 --- a/test/built-ins/Temporal/Instant/prototype/epochSeconds/branding.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2020 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-get-temporal.instant.prototype.epochseconds -description: Throw a TypeError if the receiver is invalid -features: [Symbol, Temporal] ----*/ - -const epochSeconds = Object.getOwnPropertyDescriptor(Temporal.Instant.prototype, "epochSeconds").get; - -assert.sameValue(typeof epochSeconds, "function"); - -assert.throws(TypeError, () => epochSeconds.call(undefined), "undefined"); -assert.throws(TypeError, () => epochSeconds.call(null), "null"); -assert.throws(TypeError, () => epochSeconds.call(true), "true"); -assert.throws(TypeError, () => epochSeconds.call(""), "empty string"); -assert.throws(TypeError, () => epochSeconds.call(Symbol()), "symbol"); -assert.throws(TypeError, () => epochSeconds.call(1), "1"); -assert.throws(TypeError, () => epochSeconds.call({}), "plain object"); -assert.throws(TypeError, () => epochSeconds.call(Temporal.Instant), "Temporal.Instant"); -assert.throws(TypeError, () => epochSeconds.call(Temporal.Instant.prototype), "Temporal.Instant.prototype"); diff --git a/test/built-ins/Temporal/Instant/prototype/epochSeconds/prop-desc.js b/test/built-ins/Temporal/Instant/prototype/epochSeconds/prop-desc.js deleted file mode 100644 index 2b92c7f65b..0000000000 --- a/test/built-ins/Temporal/Instant/prototype/epochSeconds/prop-desc.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2020 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-get-temporal.instant.prototype.epochseconds -description: The "epochSeconds" property of Temporal.Instant.prototype -features: [Temporal] ----*/ - -const descriptor = Object.getOwnPropertyDescriptor(Temporal.Instant.prototype, "epochSeconds"); -assert.sameValue(typeof descriptor.get, "function"); -assert.sameValue(descriptor.set, undefined); -assert.sameValue(descriptor.enumerable, false); -assert.sameValue(descriptor.configurable, true); diff --git a/test/built-ins/Temporal/Instant/prototype/subtract/argument-string.js b/test/built-ins/Temporal/Instant/prototype/subtract/argument-string.js index 92fcec8b55..ea6a4f204c 100644 --- a/test/built-ins/Temporal/Instant/prototype/subtract/argument-string.js +++ b/test/built-ins/Temporal/Instant/prototype/subtract/argument-string.js @@ -7,6 +7,6 @@ description: A string is parsed into the correct object when passed as the argum features: [Temporal] ---*/ -const instance = Temporal.Instant.fromEpochSeconds(10); +const instance = Temporal.Instant.fromEpochMilliseconds(10_000); const result = instance.subtract("PT3H"); assert.sameValue(result.epochNanoseconds, -10_790_000_000_000n, "epochNanoseconds result"); diff --git a/test/built-ins/Temporal/Instant/prototype/subtract/infinity-throws-rangeerror.js b/test/built-ins/Temporal/Instant/prototype/subtract/infinity-throws-rangeerror.js index 17fa7b25df..7218fac280 100644 --- a/test/built-ins/Temporal/Instant/prototype/subtract/infinity-throws-rangeerror.js +++ b/test/built-ins/Temporal/Instant/prototype/subtract/infinity-throws-rangeerror.js @@ -9,7 +9,7 @@ features: [Temporal] const fields = ["hours", "minutes", "seconds", "milliseconds", "microseconds", "nanoseconds"]; -const instance = Temporal.Instant.fromEpochSeconds(10); +const instance = Temporal.Instant.fromEpochMilliseconds(10_000); fields.forEach((field) => { assert.throws(RangeError, () => instance.subtract({ [field]: Infinity })); diff --git a/test/built-ins/Temporal/Instant/prototype/subtract/negative-infinity-throws-rangeerror.js b/test/built-ins/Temporal/Instant/prototype/subtract/negative-infinity-throws-rangeerror.js index 2aca9588ff..0d5e670976 100644 --- a/test/built-ins/Temporal/Instant/prototype/subtract/negative-infinity-throws-rangeerror.js +++ b/test/built-ins/Temporal/Instant/prototype/subtract/negative-infinity-throws-rangeerror.js @@ -9,7 +9,7 @@ features: [Temporal] const fields = ["hours", "minutes", "seconds", "milliseconds", "microseconds", "nanoseconds"]; -const instance = Temporal.Instant.fromEpochSeconds(10); +const instance = Temporal.Instant.fromEpochMilliseconds(10_000); fields.forEach((field) => { assert.throws(RangeError, () => instance.subtract({ [field]: -Infinity })); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/epochMicroseconds/basic.js b/test/built-ins/Temporal/ZonedDateTime/prototype/epochMicroseconds/basic.js deleted file mode 100644 index 33844e45f4..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/epochMicroseconds/basic.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (C) 2021 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-get-temporal.zoneddatetime.prototype.epochmicroseconds -description: Basic tests for epochMicroseconds. -features: [BigInt, Temporal] ----*/ - -const afterEpoch = new Temporal.ZonedDateTime(217175010_123_456_789n, "UTC"); -assert.sameValue(afterEpoch.epochMicroseconds, 217175010_123_456n, "epochMicroseconds post epoch"); -assert.sameValue(typeof afterEpoch.epochMicroseconds, "bigint", "epochMicroseconds value is a bigint"); - -const beforeEpoch = new Temporal.ZonedDateTime(-217175010_876_543_211n, "UTC"); -assert.sameValue(beforeEpoch.epochMicroseconds, -217175010_876_544n, "epochMicroseconds pre epoch"); -assert.sameValue(typeof beforeEpoch.epochMicroseconds, "bigint", "epochMicroseconds value is a bigint"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/epochMicroseconds/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/epochMicroseconds/branding.js deleted file mode 100644 index 5957b64c80..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/epochMicroseconds/branding.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2021 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-get-temporal.zoneddatetime.prototype.epochmicroseconds -description: Throw a TypeError if the receiver is invalid -features: [Symbol, Temporal] ----*/ - -const epochMicroseconds = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.prototype, "epochMicroseconds").get; - -assert.sameValue(typeof epochMicroseconds, "function"); - -assert.throws(TypeError, () => epochMicroseconds.call(undefined), "undefined"); -assert.throws(TypeError, () => epochMicroseconds.call(null), "null"); -assert.throws(TypeError, () => epochMicroseconds.call(true), "true"); -assert.throws(TypeError, () => epochMicroseconds.call(""), "empty string"); -assert.throws(TypeError, () => epochMicroseconds.call(Symbol()), "symbol"); -assert.throws(TypeError, () => epochMicroseconds.call(1), "1"); -assert.throws(TypeError, () => epochMicroseconds.call({}), "plain object"); -assert.throws(TypeError, () => epochMicroseconds.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); -assert.throws(TypeError, () => epochMicroseconds.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/epochMicroseconds/prop-desc.js b/test/built-ins/Temporal/ZonedDateTime/prototype/epochMicroseconds/prop-desc.js deleted file mode 100644 index 2ad8041283..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/epochMicroseconds/prop-desc.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2021 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-get-temporal.zoneddatetime.prototype.epochmicroseconds -description: The "epochMicroseconds" property of Temporal.ZonedDateTime.prototype -features: [Temporal] ----*/ - -const descriptor = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.prototype, "epochMicroseconds"); -assert.sameValue(typeof descriptor.get, "function"); -assert.sameValue(descriptor.set, undefined); -assert.sameValue(descriptor.enumerable, false); -assert.sameValue(descriptor.configurable, true); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/epochSeconds/basic.js b/test/built-ins/Temporal/ZonedDateTime/prototype/epochSeconds/basic.js deleted file mode 100644 index 7e693d15a0..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/epochSeconds/basic.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright (C) 2021 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-get-temporal.zoneddatetime.prototype.epochseconds -description: Basic tests for epochSeconds. -features: [BigInt, Temporal] ----*/ - -const afterEpoch = new Temporal.ZonedDateTime(217175010_123_456_789n, "UTC"); -assert.sameValue(afterEpoch.epochSeconds, 217175010, "epochSeconds post epoch"); -assert.sameValue(typeof afterEpoch.epochSeconds, "number", "epochSeconds value is a number"); - -const beforeEpoch = new Temporal.ZonedDateTime(-217175010_876_543_211n, "UTC"); -assert.sameValue(beforeEpoch.epochSeconds, -217175011, "epochSeconds pre epoch"); -assert.sameValue(typeof beforeEpoch.epochSeconds, "number", "epochSeconds value is a number"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/epochSeconds/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/epochSeconds/branding.js deleted file mode 100644 index 9f68f73d1e..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/epochSeconds/branding.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2021 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-get-temporal.zoneddatetime.prototype.epochseconds -description: Throw a TypeError if the receiver is invalid -features: [Symbol, Temporal] ----*/ - -const epochSeconds = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.prototype, "epochSeconds").get; - -assert.sameValue(typeof epochSeconds, "function"); - -assert.throws(TypeError, () => epochSeconds.call(undefined), "undefined"); -assert.throws(TypeError, () => epochSeconds.call(null), "null"); -assert.throws(TypeError, () => epochSeconds.call(true), "true"); -assert.throws(TypeError, () => epochSeconds.call(""), "empty string"); -assert.throws(TypeError, () => epochSeconds.call(Symbol()), "symbol"); -assert.throws(TypeError, () => epochSeconds.call(1), "1"); -assert.throws(TypeError, () => epochSeconds.call({}), "plain object"); -assert.throws(TypeError, () => epochSeconds.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); -assert.throws(TypeError, () => epochSeconds.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/epochSeconds/prop-desc.js b/test/built-ins/Temporal/ZonedDateTime/prototype/epochSeconds/prop-desc.js deleted file mode 100644 index 28749fb60d..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/epochSeconds/prop-desc.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (C) 2021 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-get-temporal.zoneddatetime.prototype.epochseconds -description: The "epochSeconds" property of Temporal.ZonedDateTime.prototype -features: [Temporal] ----*/ - -const descriptor = Object.getOwnPropertyDescriptor(Temporal.ZonedDateTime.prototype, "epochSeconds"); -assert.sameValue(typeof descriptor.get, "function"); -assert.sameValue(descriptor.set, undefined); -assert.sameValue(descriptor.enumerable, false); -assert.sameValue(descriptor.configurable, true); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/round/order-of-operations.js b/test/built-ins/Temporal/ZonedDateTime/prototype/round/order-of-operations.js index 9692dd5b23..9f6ddf1295 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/round/order-of-operations.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/round/order-of-operations.js @@ -48,7 +48,7 @@ const instance = new Temporal.ZonedDateTime( calendar, ); -const fallBackTimeZone = TemporalHelpers.oneShiftTimeZone(Temporal.Instant.fromEpochSeconds(1800), -3600_000_000_000); +const fallBackTimeZone = TemporalHelpers.oneShiftTimeZone(Temporal.Instant.fromEpochMilliseconds(1800_000), -3600_000_000_000); const fallBackTimeZoneObserver = TemporalHelpers.timeZoneObserver(actual, "this.timeZone", { getOffsetNanosecondsFor: fallBackTimeZone.getOffsetNanosecondsFor.bind(fallBackTimeZone), getPossibleInstantsFor: fallBackTimeZone.getPossibleInstantsFor.bind(fallBackTimeZone), @@ -56,7 +56,7 @@ const fallBackTimeZoneObserver = TemporalHelpers.timeZoneObserver(actual, "this. const fallBackInstance = new Temporal.ZonedDateTime(0n, fallBackTimeZoneObserver, calendar); const beforeFallBackInstance = new Temporal.ZonedDateTime(-3599_000_000_000n, fallBackTimeZoneObserver, calendar); -const springForwardTimeZone = TemporalHelpers.oneShiftTimeZone(Temporal.Instant.fromEpochSeconds(-1800), 3600_000_000_000); +const springForwardTimeZone = TemporalHelpers.oneShiftTimeZone(Temporal.Instant.fromEpochMilliseconds(-1800_000), 3600_000_000_000); const springForwardTimeZoneObserver = TemporalHelpers.timeZoneObserver(actual, "this.timeZone", { getOffsetNanosecondsFor: springForwardTimeZone.getOffsetNanosecondsFor.bind(springForwardTimeZone), getPossibleInstantsFor: springForwardTimeZone.getPossibleInstantsFor.bind(springForwardTimeZone), diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/order-of-operations.js b/test/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/order-of-operations.js index 04d218b63d..c01b80f40d 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/order-of-operations.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/startOfDay/order-of-operations.js @@ -26,7 +26,7 @@ const instance = new Temporal.ZonedDateTime( calendar, ); -const fallBackTimeZone = TemporalHelpers.oneShiftTimeZone(Temporal.Instant.fromEpochSeconds(1800), -3600_000_000_000); +const fallBackTimeZone = TemporalHelpers.oneShiftTimeZone(Temporal.Instant.fromEpochMilliseconds(1800_000), -3600_000_000_000); const fallBackInstance = new Temporal.ZonedDateTime( 0n, TemporalHelpers.timeZoneObserver(actual, "this.timeZone", { @@ -35,7 +35,7 @@ const fallBackInstance = new Temporal.ZonedDateTime( }), calendar, ); -const springForwardTimeZone = TemporalHelpers.oneShiftTimeZone(Temporal.Instant.fromEpochSeconds(-1800), 3600_000_000_000); +const springForwardTimeZone = TemporalHelpers.oneShiftTimeZone(Temporal.Instant.fromEpochMilliseconds(-1800_000), 3600_000_000_000); const springForwardInstance = new Temporal.ZonedDateTime( 0n, TemporalHelpers.timeZoneObserver(actual, "this.timeZone", { diff --git a/test/staging/Temporal/TimeZone/old/timezone-offset.js b/test/staging/Temporal/TimeZone/old/timezone-offset.js index 31ffd7acb1..21b0c0798c 100644 --- a/test/staging/Temporal/TimeZone/old/timezone-offset.js +++ b/test/staging/Temporal/TimeZone/old/timezone-offset.js @@ -8,7 +8,7 @@ features: [Temporal] ---*/ var zone = new Temporal.TimeZone("+01:00"); -var inst = Temporal.Instant.fromEpochSeconds(Math.floor(Math.random() * 1000000000)); +var inst = Temporal.Instant.fromEpochMilliseconds(Math.floor(Math.random() * 1_000_000_000_000)); var dtm = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789); assert.sameValue(zone.id, `${ zone }`) assert.sameValue(zone.getOffsetNanosecondsFor(inst), 3600000000000) diff --git a/test/staging/Temporal/TimeZone/old/timezone-utc-offset.js b/test/staging/Temporal/TimeZone/old/timezone-utc-offset.js index 4abd2d1ee9..b6421c7910 100644 --- a/test/staging/Temporal/TimeZone/old/timezone-utc-offset.js +++ b/test/staging/Temporal/TimeZone/old/timezone-utc-offset.js @@ -8,7 +8,7 @@ features: [Temporal] ---*/ var zone = new Temporal.TimeZone("UTC"); -var inst = Temporal.Instant.fromEpochSeconds(Math.floor(Math.random() * 1000000000)); +var inst = Temporal.Instant.fromEpochMilliseconds(Math.floor(Math.random() * 1_000_000_000_000)); var dtm = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789); assert.sameValue(zone.id, `${ zone }`) assert.sameValue(zone.getOffsetNanosecondsFor(inst), 0) diff --git a/test/staging/Temporal/UserCalendar/old/trivial-protocol-implementation.js b/test/staging/Temporal/UserCalendar/old/trivial-protocol-implementation.js index fcd2183ba6..c4935577dd 100644 --- a/test/staging/Temporal/UserCalendar/old/trivial-protocol-implementation.js +++ b/test/staging/Temporal/UserCalendar/old/trivial-protocol-implementation.js @@ -215,7 +215,7 @@ assert.sameValue(md2.monthCode, "M01"); // timezone.getPlainDateTimeFor() var tz = Temporal.TimeZone.from("UTC"); -var inst = Temporal.Instant.fromEpochSeconds(0); +var inst = Temporal.Instant.fromEpochMilliseconds(0); var dt = tz.getPlainDateTimeFor(inst, obj); assert.sameValue(dt.getCalendar(), obj); diff --git a/test/staging/Temporal/UserCalendar/old/trivial-subclass.js b/test/staging/Temporal/UserCalendar/old/trivial-subclass.js index d6ed5f7825..dbdb9a46d0 100644 --- a/test/staging/Temporal/UserCalendar/old/trivial-subclass.js +++ b/test/staging/Temporal/UserCalendar/old/trivial-subclass.js @@ -151,7 +151,7 @@ assert.sameValue(md2.monthCode, "M02"); // timezone.getPlainDateTimeFor() var tz = Temporal.TimeZone.from("UTC"); -var instant = Temporal.Instant.fromEpochSeconds(0); +var instant = Temporal.Instant.fromEpochMilliseconds(0); var dt = tz.getPlainDateTimeFor(instant, obj); assert.sameValue(dt.getCalendar(), obj); diff --git a/test/staging/Temporal/ZonedDateTime/old/construction-and-properties.js b/test/staging/Temporal/ZonedDateTime/old/construction-and-properties.js index 0f38219641..64442e44e9 100644 --- a/test/staging/Temporal/ZonedDateTime/old/construction-and-properties.js +++ b/test/staging/Temporal/ZonedDateTime/old/construction-and-properties.js @@ -15,7 +15,6 @@ var epochNanos = BigInt(epochMillis) * BigInt(1000000) + BigInt(456789); var zdt = new Temporal.ZonedDateTime(epochNanos, tz); assert(zdt instanceof Temporal.ZonedDateTime); assert.sameValue(typeof zdt, "object"); -assert.sameValue(zdt.toInstant().epochSeconds, Math.floor(Date.UTC(1976, 10, 18, 15, 23, 30, 123) / 1000), "epochSeconds"); assert.sameValue(zdt.toInstant().epochMilliseconds, Date.UTC(1976, 10, 18, 15, 23, 30, 123), "epochMilliseconds"); // Temporal.ZonedDateTime for (1976, 11, 18, 15, 23, 30, 123, 456, 789)" @@ -34,9 +33,7 @@ assert.sameValue(zdt.second, 30); assert.sameValue(zdt.millisecond, 123); assert.sameValue(zdt.microsecond, 456); assert.sameValue(zdt.nanosecond, 789); -assert.sameValue(zdt.epochSeconds, 217178610); assert.sameValue(zdt.epochMilliseconds, 217178610123); -assert.sameValue(zdt.epochMicroseconds, 217178610123456n); assert.sameValue(zdt.epochNanoseconds, 217178610123456789n); assert.sameValue(zdt.dayOfWeek, 4); assert.sameValue(zdt.dayOfYear, 323); @@ -96,9 +93,7 @@ assert.sameValue(zdt.second, 30); assert.sameValue(zdt.millisecond, 123); assert.sameValue(zdt.microsecond, 456); assert.sameValue(zdt.nanosecond, 789); -assert.sameValue(zdt.epochSeconds, 217178610); assert.sameValue(zdt.epochMilliseconds, 217178610123); -assert.sameValue(zdt.epochMicroseconds, 217178610123456n); assert.sameValue(zdt.epochNanoseconds, 217178610123456789n); assert.sameValue(zdt.dayOfWeek, 4); assert.sameValue(zdt.dayOfYear, 323);