From 7e4de57437f98521bd4c0ca8a14867ca5720a8dd Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Tue, 4 Jun 2024 15:14:22 +0200 Subject: [PATCH] Temporal: Remove tests for getISOFields methods --- .../prototype/getISOFields/branding.js | 22 ---------- .../prototype/getISOFields/builtin.js | 33 -------------- .../prototype/getISOFields/field-names.js | 16 ------- .../prototype/getISOFields/field-prop-desc.js | 27 ------------ .../getISOFields/field-traversal-order.js | 21 --------- .../prototype/getISOFields/length.js | 25 ----------- .../PlainDate/prototype/getISOFields/name.js | 23 ---------- .../getISOFields/not-a-constructor.js | 21 --------- .../prototype/getISOFields/prop-desc.js | 21 --------- .../prototype/getISOFields/prototype.js | 12 ------ .../prototype/getISOFields/branding.js | 22 ---------- .../prototype/getISOFields/builtin.js | 33 -------------- .../prototype/getISOFields/field-names.js | 22 ---------- .../prototype/getISOFields/field-prop-desc.js | 33 -------------- .../getISOFields/field-traversal-order.js | 27 ------------ .../prototype/getISOFields/length.js | 25 ----------- .../prototype/getISOFields/name.js | 23 ---------- .../getISOFields/not-a-constructor.js | 21 --------- .../prototype/getISOFields/prop-desc.js | 21 --------- .../prototype/getISOFields/prototype.js | 12 ------ .../prototype/getISOFields/branding.js | 22 ---------- .../prototype/getISOFields/builtin.js | 33 -------------- .../prototype/getISOFields/field-names.js | 16 ------- .../prototype/getISOFields/field-prop-desc.js | 27 ------------ .../getISOFields/field-traversal-order.js | 21 --------- .../prototype/getISOFields/length.js | 25 ----------- .../prototype/getISOFields/name.js | 23 ---------- .../getISOFields/not-a-constructor.js | 21 --------- .../prototype/getISOFields/prop-desc.js | 21 --------- .../prototype/getISOFields/prototype.js | 12 ------ .../prototype/getISOFields/branding.js | 22 ---------- .../prototype/getISOFields/builtin.js | 33 -------------- .../prototype/getISOFields/field-names.js | 18 -------- .../prototype/getISOFields/field-prop-desc.js | 29 ------------- .../getISOFields/field-traversal-order.js | 23 ---------- .../prototype/getISOFields/length.js | 25 ----------- .../PlainTime/prototype/getISOFields/name.js | 23 ---------- .../getISOFields/not-a-constructor.js | 21 --------- .../prototype/getISOFields/prop-desc.js | 21 --------- .../prototype/getISOFields/prototype.js | 12 ------ .../prototype/getISOFields/branding.js | 22 ---------- .../prototype/getISOFields/builtin.js | 33 -------------- .../prototype/getISOFields/field-names.js | 16 ------- .../prototype/getISOFields/field-prop-desc.js | 27 ------------ .../getISOFields/field-traversal-order.js | 21 --------- .../prototype/getISOFields/length.js | 25 ----------- .../prototype/getISOFields/name.js | 23 ---------- .../getISOFields/not-a-constructor.js | 21 --------- .../prototype/getISOFields/prop-desc.js | 21 --------- .../prototype/getISOFields/prototype.js | 12 ------ .../balance-negative-time-units.js | 43 ------------------- .../prototype/getISOFields/branding.js | 22 ---------- .../prototype/getISOFields/builtin.js | 33 -------------- .../prototype/getISOFields/field-names.js | 24 ----------- .../prototype/getISOFields/field-prop-desc.js | 35 --------------- .../getISOFields/field-traversal-order.js | 29 ------------- .../prototype/getISOFields/length.js | 25 ----------- .../prototype/getISOFields/name.js | 23 ---------- .../getISOFields/negative-epochnanoseconds.js | 35 --------------- .../getISOFields/not-a-constructor.js | 21 --------- .../prototype/getISOFields/offset.js | 18 -------- .../prototype/getISOFields/prop-desc.js | 21 --------- .../prototype/getISOFields/prototype.js | 12 ------ 63 files changed, 1470 deletions(-) delete mode 100644 test/built-ins/Temporal/PlainDate/prototype/getISOFields/branding.js delete mode 100644 test/built-ins/Temporal/PlainDate/prototype/getISOFields/builtin.js delete mode 100644 test/built-ins/Temporal/PlainDate/prototype/getISOFields/field-names.js delete mode 100644 test/built-ins/Temporal/PlainDate/prototype/getISOFields/field-prop-desc.js delete mode 100644 test/built-ins/Temporal/PlainDate/prototype/getISOFields/field-traversal-order.js delete mode 100644 test/built-ins/Temporal/PlainDate/prototype/getISOFields/length.js delete mode 100644 test/built-ins/Temporal/PlainDate/prototype/getISOFields/name.js delete mode 100644 test/built-ins/Temporal/PlainDate/prototype/getISOFields/not-a-constructor.js delete mode 100644 test/built-ins/Temporal/PlainDate/prototype/getISOFields/prop-desc.js delete mode 100644 test/built-ins/Temporal/PlainDate/prototype/getISOFields/prototype.js delete mode 100644 test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/branding.js delete mode 100644 test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/builtin.js delete mode 100644 test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/field-names.js delete mode 100644 test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/field-prop-desc.js delete mode 100644 test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/field-traversal-order.js delete mode 100644 test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/length.js delete mode 100644 test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/name.js delete mode 100644 test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/not-a-constructor.js delete mode 100644 test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/prop-desc.js delete mode 100644 test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/prototype.js delete mode 100644 test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/branding.js delete mode 100644 test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/builtin.js delete mode 100644 test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/field-names.js delete mode 100644 test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/field-prop-desc.js delete mode 100644 test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/field-traversal-order.js delete mode 100644 test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/length.js delete mode 100644 test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/name.js delete mode 100644 test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/not-a-constructor.js delete mode 100644 test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/prop-desc.js delete mode 100644 test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/prototype.js delete mode 100644 test/built-ins/Temporal/PlainTime/prototype/getISOFields/branding.js delete mode 100644 test/built-ins/Temporal/PlainTime/prototype/getISOFields/builtin.js delete mode 100644 test/built-ins/Temporal/PlainTime/prototype/getISOFields/field-names.js delete mode 100644 test/built-ins/Temporal/PlainTime/prototype/getISOFields/field-prop-desc.js delete mode 100644 test/built-ins/Temporal/PlainTime/prototype/getISOFields/field-traversal-order.js delete mode 100644 test/built-ins/Temporal/PlainTime/prototype/getISOFields/length.js delete mode 100644 test/built-ins/Temporal/PlainTime/prototype/getISOFields/name.js delete mode 100644 test/built-ins/Temporal/PlainTime/prototype/getISOFields/not-a-constructor.js delete mode 100644 test/built-ins/Temporal/PlainTime/prototype/getISOFields/prop-desc.js delete mode 100644 test/built-ins/Temporal/PlainTime/prototype/getISOFields/prototype.js delete mode 100644 test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/branding.js delete mode 100644 test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/builtin.js delete mode 100644 test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/field-names.js delete mode 100644 test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/field-prop-desc.js delete mode 100644 test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/field-traversal-order.js delete mode 100644 test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/length.js delete mode 100644 test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/name.js delete mode 100644 test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/not-a-constructor.js delete mode 100644 test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/prop-desc.js delete mode 100644 test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/prototype.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/balance-negative-time-units.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/branding.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/builtin.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/field-names.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/field-prop-desc.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/field-traversal-order.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/length.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/name.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/negative-epochnanoseconds.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/not-a-constructor.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/offset.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/prop-desc.js delete mode 100644 test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/prototype.js diff --git a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/branding.js b/test/built-ins/Temporal/PlainDate/prototype/getISOFields/branding.js deleted file mode 100644 index f24b13c225..0000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/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-temporal.plaindate.prototype.getisofields -description: Throw a TypeError if the receiver is invalid -features: [Symbol, Temporal] ----*/ - -const getISOFields = Temporal.PlainDate.prototype.getISOFields; - -assert.sameValue(typeof getISOFields, "function"); - -assert.throws(TypeError, () => getISOFields.call(undefined), "undefined"); -assert.throws(TypeError, () => getISOFields.call(null), "null"); -assert.throws(TypeError, () => getISOFields.call(true), "true"); -assert.throws(TypeError, () => getISOFields.call(""), "empty string"); -assert.throws(TypeError, () => getISOFields.call(Symbol()), "symbol"); -assert.throws(TypeError, () => getISOFields.call(1), "1"); -assert.throws(TypeError, () => getISOFields.call({}), "plain object"); -assert.throws(TypeError, () => getISOFields.call(Temporal.PlainDate), "Temporal.PlainDate"); -assert.throws(TypeError, () => getISOFields.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/builtin.js b/test/built-ins/Temporal/PlainDate/prototype/getISOFields/builtin.js deleted file mode 100644 index 1d51121d4d..0000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/builtin.js +++ /dev/null @@ -1,33 +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.plaindate.prototype.getisofields -description: > - Tests that Temporal.PlainDate.prototype.getISOFields - meets the requirements for built-in objects defined by the - introduction of chapter 17 of the ECMAScript Language Specification. -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.PlainDate.prototype.getISOFields), - true, "Built-in objects must be extensible."); - -assert.sameValue(Object.prototype.toString.call(Temporal.PlainDate.prototype.getISOFields), - "[object Function]", "Object.prototype.toString"); - -assert.sameValue(Object.getPrototypeOf(Temporal.PlainDate.prototype.getISOFields), - Function.prototype, "prototype"); - -assert.sameValue(Temporal.PlainDate.prototype.getISOFields.hasOwnProperty("prototype"), - false, "prototype property"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/field-names.js b/test/built-ins/Temporal/PlainDate/prototype/getISOFields/field-names.js deleted file mode 100644 index 405459ab06..0000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/field-names.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-temporal.plaindate.prototype.getisofields -description: Correct field names on the object returned from getISOFields -features: [Temporal] ----*/ - -const date = new Temporal.PlainDate(2000, 5, 2); - -const result = date.getISOFields(); -assert.sameValue(result.isoYear, 2000, "isoYear result"); -assert.sameValue(result.isoMonth, 5, "isoMonth result"); -assert.sameValue(result.isoDay, 2, "isoDay result"); -assert.sameValue(result.calendar, "iso8601", "calendar result"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/field-prop-desc.js b/test/built-ins/Temporal/PlainDate/prototype/getISOFields/field-prop-desc.js deleted file mode 100644 index 139af2c021..0000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/field-prop-desc.js +++ /dev/null @@ -1,27 +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.plaindate.prototype.getisofields -description: Properties on the returned object have the correct descriptor -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -const expected = [ - "calendar", - "isoDay", - "isoMonth", - "isoYear", -]; - -const date = new Temporal.PlainDate(2000, 5, 2); -const result = date.getISOFields(); - -for (const property of expected) { - verifyProperty(result, property, { - writable: true, - enumerable: true, - configurable: true, - }); -} diff --git a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/field-traversal-order.js b/test/built-ins/Temporal/PlainDate/prototype/getISOFields/field-traversal-order.js deleted file mode 100644 index 10b631991c..0000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/field-traversal-order.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.plaindate.prototype.getisofields -description: Properties added in correct order to object returned from getISOFields -includes: [compareArray.js] -features: [Temporal] ----*/ - -const expected = [ - "calendar", - "isoDay", - "isoMonth", - "isoYear", -]; - -const date = new Temporal.PlainDate(2000, 5, 2); -const result = date.getISOFields(); - -assert.compareArray(Object.keys(result), expected); diff --git a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/length.js b/test/built-ins/Temporal/PlainDate/prototype/getISOFields/length.js deleted file mode 100644 index 679f49fec8..0000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/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.plaindate.prototype.getisofields -description: Temporal.PlainDate.prototype.getISOFields.length is 0 -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.PlainDate.prototype.getISOFields, "length", { - value: 0, - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/name.js b/test/built-ins/Temporal/PlainDate/prototype/getISOFields/name.js deleted file mode 100644 index 67e6a28e50..0000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/name.js +++ /dev/null @@ -1,23 +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.plaindate.prototype.getisofields -description: Temporal.PlainDate.prototype.getISOFields.name is "getISOFields". -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.PlainDate.prototype.getISOFields, "name", { - value: "getISOFields", - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/not-a-constructor.js b/test/built-ins/Temporal/PlainDate/prototype/getISOFields/not-a-constructor.js deleted file mode 100644 index 265576e0cb..0000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/not-a-constructor.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.plaindate.prototype.getisofields -description: > - Temporal.PlainDate.prototype.getISOFields 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.PlainDate.prototype.getISOFields(); -}, "Calling as constructor"); - -assert.sameValue(isConstructor(Temporal.PlainDate.prototype.getISOFields), false, - "isConstructor(Temporal.PlainDate.prototype.getISOFields)"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/prop-desc.js b/test/built-ins/Temporal/PlainDate/prototype/getISOFields/prop-desc.js deleted file mode 100644 index 89d42869c1..0000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/prop-desc.js +++ /dev/null @@ -1,21 +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.plaindate.prototype.getisofields -description: The "getISOFields" property of Temporal.PlainDate.prototype -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -assert.sameValue( - typeof Temporal.PlainDate.prototype.getISOFields, - "function", - "`typeof PlainDate.prototype.getISOFields` is `function`" -); - -verifyProperty(Temporal.PlainDate.prototype, "getISOFields", { - writable: true, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/prototype.js b/test/built-ins/Temporal/PlainDate/prototype/getISOFields/prototype.js deleted file mode 100644 index 769df656d9..0000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/getISOFields/prototype.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (C) 2022 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.plaindate.prototype.getisofields -description: Correct prototype on the object returned from getISOFields -features: [Temporal] ----*/ - -const instance = new Temporal.PlainDate(2000, 5, 2); -const result = instance.getISOFields(); -assert.sameValue(Object.getPrototypeOf(result), Object.prototype, "prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/branding.js deleted file mode 100644 index d4a26742b3..0000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/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-temporal.plaindatetime.prototype.getisofields -description: Throw a TypeError if the receiver is invalid -features: [Symbol, Temporal] ----*/ - -const getISOFields = Temporal.PlainDateTime.prototype.getISOFields; - -assert.sameValue(typeof getISOFields, "function"); - -assert.throws(TypeError, () => getISOFields.call(undefined), "undefined"); -assert.throws(TypeError, () => getISOFields.call(null), "null"); -assert.throws(TypeError, () => getISOFields.call(true), "true"); -assert.throws(TypeError, () => getISOFields.call(""), "empty string"); -assert.throws(TypeError, () => getISOFields.call(Symbol()), "symbol"); -assert.throws(TypeError, () => getISOFields.call(1), "1"); -assert.throws(TypeError, () => getISOFields.call({}), "plain object"); -assert.throws(TypeError, () => getISOFields.call(Temporal.PlainDateTime), "Temporal.PlainDateTime"); -assert.throws(TypeError, () => getISOFields.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/builtin.js b/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/builtin.js deleted file mode 100644 index 6e17b1b5f6..0000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/builtin.js +++ /dev/null @@ -1,33 +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.plaindatetime.prototype.getisofields -description: > - Tests that Temporal.PlainDateTime.prototype.getISOFields - meets the requirements for built-in objects defined by the - introduction of chapter 17 of the ECMAScript Language Specification. -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.PlainDateTime.prototype.getISOFields), - true, "Built-in objects must be extensible."); - -assert.sameValue(Object.prototype.toString.call(Temporal.PlainDateTime.prototype.getISOFields), - "[object Function]", "Object.prototype.toString"); - -assert.sameValue(Object.getPrototypeOf(Temporal.PlainDateTime.prototype.getISOFields), - Function.prototype, "prototype"); - -assert.sameValue(Temporal.PlainDateTime.prototype.getISOFields.hasOwnProperty("prototype"), - false, "prototype property"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/field-names.js b/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/field-names.js deleted file mode 100644 index d34f56f6d5..0000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/field-names.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-temporal.plaindatetime.prototype.getisofields -description: Correct field names on the object returned from getISOFields -features: [Temporal] ----*/ - -const datetime = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); - -const result = datetime.getISOFields(); -assert.sameValue(result.isoYear, 2000, "isoYear result"); -assert.sameValue(result.isoMonth, 5, "isoMonth result"); -assert.sameValue(result.isoDay, 2, "isoDay result"); -assert.sameValue(result.isoHour, 12, "isoHour result"); -assert.sameValue(result.isoMinute, 34, "isoMinute result"); -assert.sameValue(result.isoSecond, 56, "isoSecond result"); -assert.sameValue(result.isoMillisecond, 987, "isoMillisecond result"); -assert.sameValue(result.isoMicrosecond, 654, "isoMicrosecond result"); -assert.sameValue(result.isoNanosecond, 321, "isoNanosecond result"); -assert.sameValue(result.calendar, "iso8601", "calendar result"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/field-prop-desc.js b/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/field-prop-desc.js deleted file mode 100644 index fdad48faf1..0000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/field-prop-desc.js +++ /dev/null @@ -1,33 +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.plaindatetime.prototype.getisofields -description: Properties on the returned object have the correct descriptor -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -const expected = [ - "calendar", - "isoDay", - "isoHour", - "isoMicrosecond", - "isoMillisecond", - "isoMinute", - "isoMonth", - "isoNanosecond", - "isoSecond", - "isoYear", -]; - -const datetime = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); -const result = datetime.getISOFields(); - -for (const property of expected) { - verifyProperty(result, property, { - writable: true, - enumerable: true, - configurable: true, - }); -} diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/field-traversal-order.js b/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/field-traversal-order.js deleted file mode 100644 index ba6f19faf2..0000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/field-traversal-order.js +++ /dev/null @@ -1,27 +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.plaindatetime.prototype.getisofields -description: Properties added in correct order to object returned from getISOFields -includes: [compareArray.js] -features: [Temporal] ----*/ - -const expected = [ - "calendar", - "isoDay", - "isoHour", - "isoMicrosecond", - "isoMillisecond", - "isoMinute", - "isoMonth", - "isoNanosecond", - "isoSecond", - "isoYear", -]; - -const datetime = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); -const result = datetime.getISOFields(); - -assert.compareArray(Object.keys(result), expected); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/length.js b/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/length.js deleted file mode 100644 index 463e3b0b16..0000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/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.plaindatetime.prototype.getisofields -description: Temporal.PlainDateTime.prototype.getISOFields.length is 0 -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.PlainDateTime.prototype.getISOFields, "length", { - value: 0, - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/name.js b/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/name.js deleted file mode 100644 index ec6793d108..0000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/name.js +++ /dev/null @@ -1,23 +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.plaindatetime.prototype.getisofields -description: Temporal.PlainDateTime.prototype.getISOFields.name is "getISOFields". -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.PlainDateTime.prototype.getISOFields, "name", { - value: "getISOFields", - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/not-a-constructor.js b/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/not-a-constructor.js deleted file mode 100644 index 7c459d11d4..0000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/not-a-constructor.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.plaindatetime.prototype.getisofields -description: > - Temporal.PlainDateTime.prototype.getISOFields 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.PlainDateTime.prototype.getISOFields(); -}, "Calling as constructor"); - -assert.sameValue(isConstructor(Temporal.PlainDateTime.prototype.getISOFields), false, - "isConstructor(Temporal.PlainDateTime.prototype.getISOFields)"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/prop-desc.js b/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/prop-desc.js deleted file mode 100644 index c77649c9c4..0000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/prop-desc.js +++ /dev/null @@ -1,21 +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.plaindatetime.prototype.getisofields -description: The "getISOFields" property of Temporal.PlainDateTime.prototype -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -assert.sameValue( - typeof Temporal.PlainDateTime.prototype.getISOFields, - "function", - "`typeof PlainDateTime.prototype.getISOFields` is `function`" -); - -verifyProperty(Temporal.PlainDateTime.prototype, "getISOFields", { - writable: true, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/prototype.js b/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/prototype.js deleted file mode 100644 index 1e00cd2300..0000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/getISOFields/prototype.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (C) 2022 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.plaindatetime.prototype.getisofields -description: Correct prototype on the object returned from getISOFields -features: [Temporal] ----*/ - -const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); -const result = instance.getISOFields(); -assert.sameValue(Object.getPrototypeOf(result), Object.prototype, "prototype"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/branding.js b/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/branding.js deleted file mode 100644 index 9a9805250c..0000000000 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/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-temporal.plainmonthday.prototype.getisofields -description: Throw a TypeError if the receiver is invalid -features: [Symbol, Temporal] ----*/ - -const getISOFields = Temporal.PlainMonthDay.prototype.getISOFields; - -assert.sameValue(typeof getISOFields, "function"); - -assert.throws(TypeError, () => getISOFields.call(undefined), "undefined"); -assert.throws(TypeError, () => getISOFields.call(null), "null"); -assert.throws(TypeError, () => getISOFields.call(true), "true"); -assert.throws(TypeError, () => getISOFields.call(""), "empty string"); -assert.throws(TypeError, () => getISOFields.call(Symbol()), "symbol"); -assert.throws(TypeError, () => getISOFields.call(1), "1"); -assert.throws(TypeError, () => getISOFields.call({}), "plain object"); -assert.throws(TypeError, () => getISOFields.call(Temporal.PlainMonthDay), "Temporal.PlainMonthDay"); -assert.throws(TypeError, () => getISOFields.call(Temporal.PlainMonthDay.prototype), "Temporal.PlainMonthDay.prototype"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/builtin.js b/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/builtin.js deleted file mode 100644 index c42bb6002c..0000000000 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/builtin.js +++ /dev/null @@ -1,33 +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.plainmonthday.prototype.getisofields -description: > - Tests that Temporal.PlainMonthDay.prototype.getISOFields - meets the requirements for built-in objects defined by the - introduction of chapter 17 of the ECMAScript Language Specification. -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.PlainMonthDay.prototype.getISOFields), - true, "Built-in objects must be extensible."); - -assert.sameValue(Object.prototype.toString.call(Temporal.PlainMonthDay.prototype.getISOFields), - "[object Function]", "Object.prototype.toString"); - -assert.sameValue(Object.getPrototypeOf(Temporal.PlainMonthDay.prototype.getISOFields), - Function.prototype, "prototype"); - -assert.sameValue(Temporal.PlainMonthDay.prototype.getISOFields.hasOwnProperty("prototype"), - false, "prototype property"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/field-names.js b/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/field-names.js deleted file mode 100644 index 9b99f014e6..0000000000 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/field-names.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-temporal.plainmonthday.prototype.getisofields -description: Correct field names on the object returned from getISOFields -features: [Temporal] ----*/ - -const md = new Temporal.PlainMonthDay(5, 2); - -const result = md.getISOFields(); -assert.sameValue(result.isoYear, 1972, "isoYear result"); -assert.sameValue(result.isoMonth, 5, "isoMonth result"); -assert.sameValue(result.isoDay, 2, "isoDay result"); -assert.sameValue(result.calendar, "iso8601", "calendar result"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/field-prop-desc.js b/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/field-prop-desc.js deleted file mode 100644 index e74b10df94..0000000000 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/field-prop-desc.js +++ /dev/null @@ -1,27 +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.plainmonthday.prototype.getisofields -description: Properties on the returned object have the correct descriptor -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -const expected = [ - "calendar", - "isoDay", - "isoMonth", - "isoYear", -]; - -const md = new Temporal.PlainMonthDay(5, 2); -const result = md.getISOFields(); - -for (const property of expected) { - verifyProperty(result, property, { - writable: true, - enumerable: true, - configurable: true, - }); -} diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/field-traversal-order.js b/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/field-traversal-order.js deleted file mode 100644 index 9d668403fe..0000000000 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/field-traversal-order.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.plainmonthday.prototype.getisofields -description: Properties added in correct order to object returned from getISOFields -includes: [compareArray.js] -features: [Temporal] ----*/ - -const expected = [ - "calendar", - "isoDay", - "isoMonth", - "isoYear", -]; - -const md = new Temporal.PlainMonthDay(5, 2); -const result = md.getISOFields(); - -assert.compareArray(Object.keys(result), expected); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/length.js b/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/length.js deleted file mode 100644 index 2777d1aa0d..0000000000 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/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.plainmonthday.prototype.getisofields -description: Temporal.PlainMonthDay.prototype.getISOFields.length is 0 -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.PlainMonthDay.prototype.getISOFields, "length", { - value: 0, - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/name.js b/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/name.js deleted file mode 100644 index 62b63c4be0..0000000000 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/name.js +++ /dev/null @@ -1,23 +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.plainmonthday.prototype.getisofields -description: Temporal.PlainMonthDay.prototype.getISOFields.name is "getISOFields". -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.PlainMonthDay.prototype.getISOFields, "name", { - value: "getISOFields", - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/not-a-constructor.js b/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/not-a-constructor.js deleted file mode 100644 index 4d422b1df3..0000000000 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/not-a-constructor.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.plainmonthday.prototype.getisofields -description: > - Temporal.PlainMonthDay.prototype.getISOFields 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.PlainMonthDay.prototype.getISOFields(); -}, "Calling as constructor"); - -assert.sameValue(isConstructor(Temporal.PlainMonthDay.prototype.getISOFields), false, - "isConstructor(Temporal.PlainMonthDay.prototype.getISOFields)"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/prop-desc.js b/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/prop-desc.js deleted file mode 100644 index 3edb7a1429..0000000000 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/prop-desc.js +++ /dev/null @@ -1,21 +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.plainmonthday.prototype.getisofields -description: The "getISOFields" property of Temporal.PlainMonthDay.prototype -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -assert.sameValue( - typeof Temporal.PlainMonthDay.prototype.getISOFields, - "function", - "`typeof PlainMonthDay.prototype.getISOFields` is `function`" -); - -verifyProperty(Temporal.PlainMonthDay.prototype, "getISOFields", { - writable: true, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/prototype.js b/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/prototype.js deleted file mode 100644 index dc43ace9a7..0000000000 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/getISOFields/prototype.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (C) 2022 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.plainmonthday.prototype.getisofields -description: Correct prototype on the object returned from getISOFields -features: [Temporal] ----*/ - -const instance = new Temporal.PlainMonthDay(5, 2); -const result = instance.getISOFields(); -assert.sameValue(Object.getPrototypeOf(result), Object.prototype, "prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/branding.js b/test/built-ins/Temporal/PlainTime/prototype/getISOFields/branding.js deleted file mode 100644 index 523925b7b8..0000000000 --- a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/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-temporal.plaintime.prototype.getisofields -description: Throw a TypeError if the receiver is invalid -features: [Symbol, Temporal] ----*/ - -const getISOFields = Temporal.PlainTime.prototype.getISOFields; - -assert.sameValue(typeof getISOFields, "function"); - -assert.throws(TypeError, () => getISOFields.call(undefined), "undefined"); -assert.throws(TypeError, () => getISOFields.call(null), "null"); -assert.throws(TypeError, () => getISOFields.call(true), "true"); -assert.throws(TypeError, () => getISOFields.call(""), "empty string"); -assert.throws(TypeError, () => getISOFields.call(Symbol()), "symbol"); -assert.throws(TypeError, () => getISOFields.call(1), "1"); -assert.throws(TypeError, () => getISOFields.call({}), "plain object"); -assert.throws(TypeError, () => getISOFields.call(Temporal.PlainTime), "Temporal.PlainTime"); -assert.throws(TypeError, () => getISOFields.call(Temporal.PlainTime.prototype), "Temporal.PlainTime.prototype"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/builtin.js b/test/built-ins/Temporal/PlainTime/prototype/getISOFields/builtin.js deleted file mode 100644 index 352d8b55c0..0000000000 --- a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/builtin.js +++ /dev/null @@ -1,33 +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.plaintime.prototype.getisofields -description: > - Tests that Temporal.PlainTime.prototype.getISOFields - meets the requirements for built-in objects defined by the - introduction of chapter 17 of the ECMAScript Language Specification. -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.PlainTime.prototype.getISOFields), - true, "Built-in objects must be extensible."); - -assert.sameValue(Object.prototype.toString.call(Temporal.PlainTime.prototype.getISOFields), - "[object Function]", "Object.prototype.toString"); - -assert.sameValue(Object.getPrototypeOf(Temporal.PlainTime.prototype.getISOFields), - Function.prototype, "prototype"); - -assert.sameValue(Temporal.PlainTime.prototype.getISOFields.hasOwnProperty("prototype"), - false, "prototype property"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/field-names.js b/test/built-ins/Temporal/PlainTime/prototype/getISOFields/field-names.js deleted file mode 100644 index 4ea80a535f..0000000000 --- a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/field-names.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.plaintime.prototype.getisofields -description: Correct field names on the object returned from getISOFields -features: [Temporal] ----*/ - -const time = new Temporal.PlainTime(12, 34, 56, 987, 654, 321); - -const result = time.getISOFields(); -assert.sameValue(result.isoHour, 12, "isoHour result"); -assert.sameValue(result.isoMinute, 34, "isoMinute result"); -assert.sameValue(result.isoSecond, 56, "isoSecond result"); -assert.sameValue(result.isoMillisecond, 987, "isoMillisecond result"); -assert.sameValue(result.isoMicrosecond, 654, "isoMicrosecond result"); -assert.sameValue(result.isoNanosecond, 321, "isoNanosecond result"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/field-prop-desc.js b/test/built-ins/Temporal/PlainTime/prototype/getISOFields/field-prop-desc.js deleted file mode 100644 index 4b81951bf4..0000000000 --- a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/field-prop-desc.js +++ /dev/null @@ -1,29 +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.plaintime.prototype.getisofields -description: Properties on the returned object have the correct descriptor -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -const expected = [ - "isoHour", - "isoMicrosecond", - "isoMillisecond", - "isoMinute", - "isoNanosecond", - "isoSecond", -]; - -const time = new Temporal.PlainTime(12, 34, 56, 987, 654, 321); -const result = time.getISOFields(); - -for (const property of expected) { - verifyProperty(result, property, { - writable: true, - enumerable: true, - configurable: true, - }); -} diff --git a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/field-traversal-order.js b/test/built-ins/Temporal/PlainTime/prototype/getISOFields/field-traversal-order.js deleted file mode 100644 index 55afd2c4d8..0000000000 --- a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/field-traversal-order.js +++ /dev/null @@ -1,23 +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.plaintime.prototype.getisofields -description: Properties added in correct order to object returned from getISOFields -includes: [compareArray.js] -features: [Temporal] ----*/ - -const expected = [ - "isoHour", - "isoMicrosecond", - "isoMillisecond", - "isoMinute", - "isoNanosecond", - "isoSecond", -]; - -const time = new Temporal.PlainTime(12, 34, 56, 987, 654, 321); -const result = time.getISOFields(); - -assert.compareArray(Object.keys(result), expected); diff --git a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/length.js b/test/built-ins/Temporal/PlainTime/prototype/getISOFields/length.js deleted file mode 100644 index 8e71933c38..0000000000 --- a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/length.js +++ /dev/null @@ -1,25 +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.plaintime.prototype.getisofields -description: Temporal.PlainTime.prototype.getISOFields.length is 0 -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.PlainTime.prototype.getISOFields, "length", { - value: 0, - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/name.js b/test/built-ins/Temporal/PlainTime/prototype/getISOFields/name.js deleted file mode 100644 index 9ad9e6438b..0000000000 --- a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/name.js +++ /dev/null @@ -1,23 +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.plaintime.prototype.getisofields -description: Temporal.PlainTime.prototype.getISOFields.name is "getISOFields". -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.PlainTime.prototype.getISOFields, "name", { - value: "getISOFields", - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/not-a-constructor.js b/test/built-ins/Temporal/PlainTime/prototype/getISOFields/not-a-constructor.js deleted file mode 100644 index 1160d5f9e1..0000000000 --- a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/not-a-constructor.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.plaintime.prototype.getisofields -description: > - Temporal.PlainTime.prototype.getISOFields 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.PlainTime.prototype.getISOFields(); -}, "Calling as constructor"); - -assert.sameValue(isConstructor(Temporal.PlainTime.prototype.getISOFields), false, - "isConstructor(Temporal.PlainTime.prototype.getISOFields)"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/prop-desc.js b/test/built-ins/Temporal/PlainTime/prototype/getISOFields/prop-desc.js deleted file mode 100644 index 534c3d0172..0000000000 --- a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/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.plaintime.prototype.getisofields -description: The "getISOFields" property of Temporal.PlainTime.prototype -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -assert.sameValue( - typeof Temporal.PlainTime.prototype.getISOFields, - "function", - "`typeof PlainTime.prototype.getISOFields` is `function`" -); - -verifyProperty(Temporal.PlainTime.prototype, "getISOFields", { - writable: true, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/prototype.js b/test/built-ins/Temporal/PlainTime/prototype/getISOFields/prototype.js deleted file mode 100644 index db4982a550..0000000000 --- a/test/built-ins/Temporal/PlainTime/prototype/getISOFields/prototype.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (C) 2022 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.plaintime.prototype.getisofields -description: Correct prototype on the object returned from getISOFields -features: [Temporal] ----*/ - -const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321); -const result = instance.getISOFields(); -assert.sameValue(Object.getPrototypeOf(result), Object.prototype, "prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/branding.js deleted file mode 100644 index 88fe8f8e85..0000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/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-temporal.plainyearmonth.prototype.getisofields -description: Throw a TypeError if the receiver is invalid -features: [Symbol, Temporal] ----*/ - -const getISOFields = Temporal.PlainYearMonth.prototype.getISOFields; - -assert.sameValue(typeof getISOFields, "function"); - -assert.throws(TypeError, () => getISOFields.call(undefined), "undefined"); -assert.throws(TypeError, () => getISOFields.call(null), "null"); -assert.throws(TypeError, () => getISOFields.call(true), "true"); -assert.throws(TypeError, () => getISOFields.call(""), "empty string"); -assert.throws(TypeError, () => getISOFields.call(Symbol()), "symbol"); -assert.throws(TypeError, () => getISOFields.call(1), "1"); -assert.throws(TypeError, () => getISOFields.call({}), "plain object"); -assert.throws(TypeError, () => getISOFields.call(Temporal.PlainYearMonth), "Temporal.PlainYearMonth"); -assert.throws(TypeError, () => getISOFields.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/builtin.js b/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/builtin.js deleted file mode 100644 index 190136a05c..0000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/builtin.js +++ /dev/null @@ -1,33 +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.plainyearmonth.prototype.getisofields -description: > - Tests that Temporal.PlainYearMonth.prototype.getISOFields - meets the requirements for built-in objects defined by the - introduction of chapter 17 of the ECMAScript Language Specification. -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.PlainYearMonth.prototype.getISOFields), - true, "Built-in objects must be extensible."); - -assert.sameValue(Object.prototype.toString.call(Temporal.PlainYearMonth.prototype.getISOFields), - "[object Function]", "Object.prototype.toString"); - -assert.sameValue(Object.getPrototypeOf(Temporal.PlainYearMonth.prototype.getISOFields), - Function.prototype, "prototype"); - -assert.sameValue(Temporal.PlainYearMonth.prototype.getISOFields.hasOwnProperty("prototype"), - false, "prototype property"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/field-names.js b/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/field-names.js deleted file mode 100644 index 9684bb591e..0000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/field-names.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-temporal.plainyearmonth.prototype.getisofields -description: Correct field names on the object returned from getISOFields -features: [Temporal] ----*/ - -const ym = new Temporal.PlainYearMonth(2000, 5); - -const result = ym.getISOFields(); -assert.sameValue(result.isoYear, 2000, "isoYear result"); -assert.sameValue(result.isoMonth, 5, "isoMonth result"); -assert.sameValue(result.isoDay, 1, "isoDay result"); -assert.sameValue(result.calendar, "iso8601", "calendar result"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/field-prop-desc.js b/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/field-prop-desc.js deleted file mode 100644 index 260fb52982..0000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/field-prop-desc.js +++ /dev/null @@ -1,27 +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.plainyearmonth.prototype.getisofields -description: Properties on the returned object have the correct descriptor -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -const expected = [ - "calendar", - "isoDay", - "isoMonth", - "isoYear", -]; - -const ym = new Temporal.PlainYearMonth(2000, 5); -const result = ym.getISOFields(); - -for (const property of expected) { - verifyProperty(result, property, { - writable: true, - enumerable: true, - configurable: true, - }); -} diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/field-traversal-order.js b/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/field-traversal-order.js deleted file mode 100644 index e2b1099f1b..0000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/field-traversal-order.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.plainyearmonth.prototype.getisofields -description: Properties added in correct order to object returned from getISOFields -includes: [compareArray.js] -features: [Temporal] ----*/ - -const expected = [ - "calendar", - "isoDay", - "isoMonth", - "isoYear", -]; - -const ym = new Temporal.PlainYearMonth(2000, 5); -const result = ym.getISOFields(); - -assert.compareArray(Object.keys(result), expected); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/length.js b/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/length.js deleted file mode 100644 index 4037863e6e..0000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/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.plainyearmonth.prototype.getisofields -description: Temporal.PlainYearMonth.prototype.getISOFields.length is 0 -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.PlainYearMonth.prototype.getISOFields, "length", { - value: 0, - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/name.js b/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/name.js deleted file mode 100644 index 5b38b8809a..0000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/name.js +++ /dev/null @@ -1,23 +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.plainyearmonth.prototype.getisofields -description: Temporal.PlainYearMonth.prototype.getISOFields.name is "getISOFields". -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.PlainYearMonth.prototype.getISOFields, "name", { - value: "getISOFields", - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/not-a-constructor.js b/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/not-a-constructor.js deleted file mode 100644 index ee99732e40..0000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/not-a-constructor.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.plainyearmonth.prototype.getisofields -description: > - Temporal.PlainYearMonth.prototype.getISOFields 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.PlainYearMonth.prototype.getISOFields(); -}, "Calling as constructor"); - -assert.sameValue(isConstructor(Temporal.PlainYearMonth.prototype.getISOFields), false, - "isConstructor(Temporal.PlainYearMonth.prototype.getISOFields)"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/prop-desc.js b/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/prop-desc.js deleted file mode 100644 index ae6d524077..0000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/prop-desc.js +++ /dev/null @@ -1,21 +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.plainyearmonth.prototype.getisofields -description: The "getISOFields" property of Temporal.PlainYearMonth.prototype -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -assert.sameValue( - typeof Temporal.PlainYearMonth.prototype.getISOFields, - "function", - "`typeof PlainYearMonth.prototype.getISOFields` is `function`" -); - -verifyProperty(Temporal.PlainYearMonth.prototype, "getISOFields", { - writable: true, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/prototype.js b/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/prototype.js deleted file mode 100644 index 6df8852103..0000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/getISOFields/prototype.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (C) 2022 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.plainyearmonth.prototype.getisofields -description: Correct prototype on the object returned from getISOFields -features: [Temporal] ----*/ - -const instance = new Temporal.PlainYearMonth(2000, 5); -const result = instance.getISOFields(); -assert.sameValue(Object.getPrototypeOf(result), Object.prototype, "prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/balance-negative-time-units.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/balance-negative-time-units.js deleted file mode 100644 index 8cc1119f9e..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/balance-negative-time-units.js +++ /dev/null @@ -1,43 +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.zoneddatetime.prototype.getisofields -description: Negative time fields are balanced upwards -info: | - sec-temporal-balancetime steps 3–14: - 3. Set _microsecond_ to _microsecond_ + floor(_nanosecond_ / 1000). - 4. Set _nanosecond_ to _nanosecond_ modulo 1000. - 5. Set _millisecond_ to _millisecond_ + floor(_microsecond_ / 1000). - 6. Set _microsecond_ to _microsecond_ modulo 1000. - 7. Set _second_ to _second_ + floor(_millisecond_ / 1000). - 8. Set _millisecond_ to _millisecond_ modulo 1000. - 9. Set _minute_ to _minute_ + floor(_second_ / 60). - 10. Set _second_ to _second_ modulo 60. - 11. Set _hour_ to _hour_ + floor(_minute_ / 60). - 12. Set _minute_ to _minute_ modulo 60. - 13. Let _days_ be floor(_hour_ / 24). - 14. Set _hour_ to _hour_ modulo 24. - sec-temporal-balanceisodatetime step 1: - 1. Let _balancedTime_ be ? BalanceTime(_hour_, _minute_, _second_, _millisecond_, _microsecond_, _nanosecond_). - sec-temporal-builtintimezonegetplaindatetimefor step 3: - 3. Set _result_ to ? BalanceISODateTime(_result_.[[Year]], _result_.[[Month]], _result_.[[Day]], _result_.[[Hour]], _result_.[[Minute]], _result_.[[Second]], _result_.[[Millisecond]], _result_.[[Microsecond]], _result_.[[Nanosecond]] + _offsetNanoseconds_). - sec-get-temporal.zoneddatetime.prototype.getisofields step 7: - 7. Let _dateTime_ be ? BuiltinTimeZoneGetPlainDateTimeFor(_timeZone_, _instant_, _calendar_). -includes: [temporalHelpers.js] -features: [Temporal] ----*/ - -// This code path is encountered if the time zone offset is negative and its -// absolute value in nanoseconds is greater than the nanosecond field of the -// ZonedDateTime -const datetime = new Temporal.ZonedDateTime(1001n, "-00:02"); - -const fields = datetime.getISOFields(); - -assert.sameValue(fields.isoHour, 23); -assert.sameValue(fields.isoMinute, 58); -assert.sameValue(fields.isoSecond, 0); -assert.sameValue(fields.isoMillisecond, 0); -assert.sameValue(fields.isoMicrosecond, 1); -assert.sameValue(fields.isoNanosecond, 1); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/branding.js deleted file mode 100644 index 9524ed7e60..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/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-temporal.zoneddatetime.prototype.getisofields -description: Throw a TypeError if the receiver is invalid -features: [Symbol, Temporal] ----*/ - -const getISOFields = Temporal.ZonedDateTime.prototype.getISOFields; - -assert.sameValue(typeof getISOFields, "function"); - -assert.throws(TypeError, () => getISOFields.call(undefined), "undefined"); -assert.throws(TypeError, () => getISOFields.call(null), "null"); -assert.throws(TypeError, () => getISOFields.call(true), "true"); -assert.throws(TypeError, () => getISOFields.call(""), "empty string"); -assert.throws(TypeError, () => getISOFields.call(Symbol()), "symbol"); -assert.throws(TypeError, () => getISOFields.call(1), "1"); -assert.throws(TypeError, () => getISOFields.call({}), "plain object"); -assert.throws(TypeError, () => getISOFields.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); -assert.throws(TypeError, () => getISOFields.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/builtin.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/builtin.js deleted file mode 100644 index ed925e1e4e..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/builtin.js +++ /dev/null @@ -1,33 +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.zoneddatetime.prototype.getisofields -description: > - Tests that Temporal.ZonedDateTime.prototype.getISOFields - meets the requirements for built-in objects defined by the - introduction of chapter 17 of the ECMAScript Language Specification. -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.ZonedDateTime.prototype.getISOFields), - true, "Built-in objects must be extensible."); - -assert.sameValue(Object.prototype.toString.call(Temporal.ZonedDateTime.prototype.getISOFields), - "[object Function]", "Object.prototype.toString"); - -assert.sameValue(Object.getPrototypeOf(Temporal.ZonedDateTime.prototype.getISOFields), - Function.prototype, "prototype"); - -assert.sameValue(Temporal.ZonedDateTime.prototype.getISOFields.hasOwnProperty("prototype"), - false, "prototype property"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/field-names.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/field-names.js deleted file mode 100644 index 10861de182..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/field-names.js +++ /dev/null @@ -1,24 +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.zoneddatetime.prototype.getisofields -description: Correct field names on the object returned from getISOFields -features: [Temporal] ----*/ - -const datetime = new Temporal.ZonedDateTime(1_000_086_400_987_654_321n, "UTC"); - -const result = datetime.getISOFields(); -assert.sameValue(result.isoYear, 2001, "isoYear result"); -assert.sameValue(result.isoMonth, 9, "isoMonth result"); -assert.sameValue(result.isoDay, 10, "isoDay result"); -assert.sameValue(result.isoHour, 1, "isoHour result"); -assert.sameValue(result.isoMinute, 46, "isoMinute result"); -assert.sameValue(result.isoSecond, 40, "isoSecond result"); -assert.sameValue(result.isoMillisecond, 987, "isoMillisecond result"); -assert.sameValue(result.isoMicrosecond, 654, "isoMicrosecond result"); -assert.sameValue(result.isoNanosecond, 321, "isoNanosecond result"); -assert.sameValue(result.offset, "+00:00", "offset result"); -assert.sameValue(result.calendar, "iso8601", "calendar result"); -assert.sameValue(result.timeZone, "UTC", "timeZone result"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/field-prop-desc.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/field-prop-desc.js deleted file mode 100644 index 30afae9093..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/field-prop-desc.js +++ /dev/null @@ -1,35 +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.zoneddatetime.prototype.getisofields -description: Properties on the returned object have the correct descriptor -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -const expected = [ - "calendar", - "isoDay", - "isoHour", - "isoMicrosecond", - "isoMillisecond", - "isoMinute", - "isoMonth", - "isoNanosecond", - "isoSecond", - "isoYear", - "offset", - "timeZone", -]; - -const datetime = new Temporal.ZonedDateTime(1_000_086_400_987_654_321n, "UTC"); -const result = datetime.getISOFields(); - -for (const property of expected) { - verifyProperty(result, property, { - writable: true, - enumerable: true, - configurable: true, - }); -} diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/field-traversal-order.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/field-traversal-order.js deleted file mode 100644 index a7b600d118..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/field-traversal-order.js +++ /dev/null @@ -1,29 +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.zoneddatetime.prototype.getisofields -description: Properties added in correct order to object returned from getISOFields -includes: [compareArray.js] -features: [Temporal] ----*/ - -const expected = [ - "calendar", - "isoDay", - "isoHour", - "isoMicrosecond", - "isoMillisecond", - "isoMinute", - "isoMonth", - "isoNanosecond", - "isoSecond", - "isoYear", - "offset", - "timeZone", -]; - -const datetime = new Temporal.ZonedDateTime(1_000_086_400_987_654_321n, "UTC"); -const result = datetime.getISOFields(); - -assert.compareArray(Object.keys(result), expected); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/length.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/length.js deleted file mode 100644 index 0a99d6dcc5..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/length.js +++ /dev/null @@ -1,25 +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.zoneddatetime.prototype.getisofields -description: Temporal.ZonedDateTime.prototype.getISOFields.length is 0 -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.ZonedDateTime.prototype.getISOFields, "length", { - value: 0, - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/name.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/name.js deleted file mode 100644 index e68c8bdc4e..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/name.js +++ /dev/null @@ -1,23 +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.zoneddatetime.prototype.getisofields -description: Temporal.ZonedDateTime.prototype.getISOFields.name is "getISOFields". -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.ZonedDateTime.prototype.getISOFields, "name", { - value: "getISOFields", - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/negative-epochnanoseconds.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/negative-epochnanoseconds.js deleted file mode 100644 index 93a14d3483..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/negative-epochnanoseconds.js +++ /dev/null @@ -1,35 +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.zoneddatetime.prototype.getisofields -description: A pre-epoch value is handled correctly by the modulo operation in GetISOPartsFromEpoch -info: | - sec-temporal-getisopartsfromepoch step 1: - 1. Let _remainderNs_ be the mathematical value whose sign is the sign of _epochNanoseconds_ and whose magnitude is abs(_epochNanoseconds_) modulo 106. - sec-temporal-builtintimezonegetplaindatetimefor step 2: - 2. Let _result_ be ! GetISOPartsFromEpoch(_instant_.[[Nanoseconds]]). -features: [Temporal] -includes: [deepEqual.js] ----*/ - -const datetime = new Temporal.ZonedDateTime(-13849764_999_999_999n, "UTC"); - -// This code path shows up anywhere we convert an exact time, before the Unix -// epoch, with nonzero microseconds or nanoseconds, into a wall time. - -const result = datetime.getISOFields(); -assert.deepEqual(result, { - calendar: "iso8601", - isoDay: 24, - isoHour: 16, - isoMicrosecond: 0, - isoMillisecond: 0, - isoMinute: 50, - isoMonth: 7, - isoNanosecond: 1, - isoSecond: 35, - isoYear: 1969, - offset: "+00:00", - timeZone: "UTC" -}); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/not-a-constructor.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/not-a-constructor.js deleted file mode 100644 index 7ebdadf8a5..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/not-a-constructor.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.zoneddatetime.prototype.getisofields -description: > - Temporal.ZonedDateTime.prototype.getISOFields 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.ZonedDateTime.prototype.getISOFields(); -}, "Calling as constructor"); - -assert.sameValue(isConstructor(Temporal.ZonedDateTime.prototype.getISOFields), false, - "isConstructor(Temporal.ZonedDateTime.prototype.getISOFields)"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/offset.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/offset.js deleted file mode 100644 index 45924564a7..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/offset.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.zoneddatetime.prototype.getisofields -description: The offset property of returned object -features: [BigInt, Temporal] ----*/ - -function test(timeZoneIdentifier, expectedOffsetString, description) { - const datetime = new Temporal.ZonedDateTime(0n, timeZoneIdentifier); - const fields = datetime.getISOFields(); - assert.sameValue(fields.offset, expectedOffsetString, description); -} - -test("UTC", "+00:00", "offset of UTC is +00:00"); -test("+01:00", "+01:00", "positive offset"); -test("-05:00", "-05:00", "negative offset"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/prop-desc.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/prop-desc.js deleted file mode 100644 index 4a7416a658..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/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.zoneddatetime.prototype.getisofields -description: The "getISOFields" property of Temporal.ZonedDateTime.prototype -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -assert.sameValue( - typeof Temporal.ZonedDateTime.prototype.getISOFields, - "function", - "`typeof ZonedDateTime.prototype.getISOFields` is `function`" -); - -verifyProperty(Temporal.ZonedDateTime.prototype, "getISOFields", { - writable: true, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/prototype.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/prototype.js deleted file mode 100644 index 83988ce431..0000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/prototype.js +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (C) 2022 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.zoneddatetime.prototype.getisofields -description: Correct prototype on the object returned from getISOFields -features: [Temporal] ----*/ - -const instance = new Temporal.ZonedDateTime(1_000_086_400_987_654_321n, "UTC"); -const result = instance.getISOFields(); -assert.sameValue(Object.getPrototypeOf(result), Object.prototype, "prototype");