diff --git a/test/built-ins/Temporal/PlainDate/basic.js b/test/built-ins/Temporal/PlainDate/basic.js index 36f65021b6b..ade4653c7b0 100644 --- a/test/built-ins/Temporal/PlainDate/basic.js +++ b/test/built-ins/Temporal/PlainDate/basic.js @@ -17,9 +17,8 @@ Object.defineProperty(Temporal.Calendar, "from", { const calendar = new Temporal.Calendar("iso8601"); const plainDateWithObject = new Temporal.PlainDate(2020, 12, 24, calendar); TemporalHelpers.assertPlainDate(plainDateWithObject, 2020, 12, "M12", 24, "with object"); -assert.sameValue(plainDateWithObject.getCalendar(), calendar); +assert.sameValue(plainDateWithObject.getISOFields().calendar, calendar); const plainDateWithString = new Temporal.PlainDate(2020, 12, 24, "iso8601"); TemporalHelpers.assertPlainDate(plainDateWithString, 2020, 12, "M12", 24, "with string"); assert.sameValue(plainDateWithString.getISOFields().calendar, "iso8601", "calendar slot should store a string"); -assert.notSameValue(plainDateWithString.getCalendar(), calendar); diff --git a/test/built-ins/Temporal/PlainDate/from/argument-plaindatetime.js b/test/built-ins/Temporal/PlainDate/from/argument-plaindatetime.js index 498037c245f..0f4b69c0613 100644 --- a/test/built-ins/Temporal/PlainDate/from/argument-plaindatetime.js +++ b/test/built-ins/Temporal/PlainDate/from/argument-plaindatetime.js @@ -17,5 +17,5 @@ features: [Temporal] TemporalHelpers.checkPlainDateTimeConversionFastPath((datetime, calendar) => { const result = Temporal.PlainDate.from(datetime); TemporalHelpers.assertPlainDate(result, 2000, 5, "M05", 2); - assert.sameValue(result.getCalendar(), calendar, "calendar result"); + assert.sameValue(result.getISOFields().calendar, calendar, "calendar result"); }); diff --git a/test/built-ins/Temporal/PlainDate/from/argument-zoneddatetime.js b/test/built-ins/Temporal/PlainDate/from/argument-zoneddatetime.js index 6288a5e7822..eee8e4b0c1e 100644 --- a/test/built-ins/Temporal/PlainDate/from/argument-zoneddatetime.js +++ b/test/built-ins/Temporal/PlainDate/from/argument-zoneddatetime.js @@ -19,7 +19,7 @@ TemporalHelpers.assertPlainDate( ); assert.sameValue( - result.getCalendar(), + result.getISOFields().calendar, calendar, "Calendar is copied" ); diff --git a/test/built-ins/Temporal/PlainDate/from/calendar-temporal-object.js b/test/built-ins/Temporal/PlainDate/from/calendar-temporal-object.js index 8960848b0cc..236991f88d0 100644 --- a/test/built-ins/Temporal/PlainDate/from/calendar-temporal-object.js +++ b/test/built-ins/Temporal/PlainDate/from/calendar-temporal-object.js @@ -22,5 +22,5 @@ features: [Temporal] TemporalHelpers.checkToTemporalCalendarFastPath((temporalObject, calendar) => { const result = Temporal.PlainDate.from({ year: 2000, month: 5, day: 2, calendar: temporalObject }); - assert.sameValue(result.getCalendar(), calendar, "Temporal object coerced to calendar"); + assert.sameValue(result.getISOFields().calendar, calendar, "Temporal object coerced to calendar"); }); diff --git a/test/built-ins/Temporal/PlainDate/prototype/getCalendar/branding.js b/test/built-ins/Temporal/PlainDate/prototype/getCalendar/branding.js deleted file mode 100644 index c2b346989fb..00000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/getCalendar/branding.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2023 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.plaindate.prototype.getcalendar -description: Throw a TypeError if the receiver is invalid -features: [Symbol, Temporal] ----*/ - -const getCalendar = Temporal.PlainDate.prototype.getCalendar; - -assert.sameValue(typeof getCalendar, "function"); - -assert.throws(TypeError, () => getCalendar.call(undefined), "undefined"); -assert.throws(TypeError, () => getCalendar.call(null), "null"); -assert.throws(TypeError, () => getCalendar.call(true), "true"); -assert.throws(TypeError, () => getCalendar.call(""), "empty string"); -assert.throws(TypeError, () => getCalendar.call(Symbol()), "symbol"); -assert.throws(TypeError, () => getCalendar.call(1), "1"); -assert.throws(TypeError, () => getCalendar.call({}), "plain object"); -assert.throws(TypeError, () => getCalendar.call(Temporal.PlainDate), "Temporal.PlainDate"); -assert.throws(TypeError, () => getCalendar.call(Temporal.PlainDate.prototype), "Temporal.PlainDate.prototype"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/getCalendar/builtin.js b/test/built-ins/Temporal/PlainDate/prototype/getCalendar/builtin.js deleted file mode 100644 index 08474bc0318..00000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/getCalendar/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.getcalendar -description: > - Tests that Temporal.PlainDate.prototype.getCalendar - 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.getCalendar), - true, "Built-in objects must be extensible."); - -assert.sameValue(Object.prototype.toString.call(Temporal.PlainDate.prototype.getCalendar), - "[object Function]", "Object.prototype.toString"); - -assert.sameValue(Object.getPrototypeOf(Temporal.PlainDate.prototype.getCalendar), - Function.prototype, "prototype"); - -assert.sameValue(Temporal.PlainDate.prototype.getCalendar.hasOwnProperty("prototype"), - false, "prototype property"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/getCalendar/length.js b/test/built-ins/Temporal/PlainDate/prototype/getCalendar/length.js deleted file mode 100644 index 70b9d9017ff..00000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/getCalendar/length.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (C) 2023 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.plaindate.prototype.getcalendar -description: Temporal.PlainDate.prototype.getCalendar.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.getCalendar, "length", { - value: 0, - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainDate/prototype/getCalendar/name.js b/test/built-ins/Temporal/PlainDate/prototype/getCalendar/name.js deleted file mode 100644 index 91189d8e6c7..00000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/getCalendar/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.getcalendar -description: Temporal.PlainDate.prototype.getCalendar.name is "getCalendar". -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.getCalendar, "name", { - value: "getCalendar", - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainDate/prototype/getCalendar/not-a-constructor.js b/test/built-ins/Temporal/PlainDate/prototype/getCalendar/not-a-constructor.js deleted file mode 100644 index 12675be1950..00000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/getCalendar/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.getcalendar -description: > - Temporal.PlainDate.prototype.getCalendar 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.getCalendar(); -}, "Calling as constructor"); - -assert.sameValue(isConstructor(Temporal.PlainDate.prototype.getCalendar), false, - "isConstructor(Temporal.PlainDate.prototype.getCalendar)"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/getCalendar/prop-desc.js b/test/built-ins/Temporal/PlainDate/prototype/getCalendar/prop-desc.js deleted file mode 100644 index 1932c08e2f0..00000000000 --- a/test/built-ins/Temporal/PlainDate/prototype/getCalendar/prop-desc.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2023 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.plaindate.prototype.getcalendar -description: The "getCalendar" property of Temporal.PlainDate.prototype -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -assert.sameValue( - typeof Temporal.PlainDate.prototype.getCalendar, - "function", - "`typeof PlainDate.prototype.getCalendar` is `function`" -); - -verifyProperty(Temporal.PlainDate.prototype, "getCalendar", { - writable: true, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainDate/prototype/toPlainDateTime/custom.js b/test/built-ins/Temporal/PlainDate/prototype/toPlainDateTime/custom.js index 66a3208dd24..d2aa0d0b7ad 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/toPlainDateTime/custom.js +++ b/test/built-ins/Temporal/PlainDate/prototype/toPlainDateTime/custom.js @@ -11,4 +11,4 @@ features: [Temporal] const calendar = TemporalHelpers.calendarThrowEverything(); const plainDate = new Temporal.PlainDate(2000, 5, 2, calendar); const result = plainDate.toPlainDateTime("11:30:23"); -assert.sameValue(result.getCalendar(), calendar, "calendar"); +assert.sameValue(result.getISOFields().calendar, calendar, "calendar"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/calendar.js b/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/calendar.js index e2a3d12d393..5c0e5275e31 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/calendar.js +++ b/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/calendar.js @@ -16,4 +16,4 @@ const result = plainDate.toZonedDateTime({ }); assert.sameValue(result.epochNanoseconds, 957270600_000_000_000n); assert.sameValue(result.timeZoneId, "UTC"); -assert.sameValue(result.getCalendar(), calendar); +assert.sameValue(result.getISOFields().calendar, calendar); diff --git a/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/timezone-getpossibleinstantsfor.js b/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/timezone-getpossibleinstantsfor.js index 9386d117308..1d9a96e0679 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/timezone-getpossibleinstantsfor.js +++ b/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/timezone-getpossibleinstantsfor.js @@ -13,7 +13,7 @@ class CustomTimeZone extends Temporal.TimeZone { super("UTC"); } getPossibleInstantsFor(plainDateTime) { - assert.sameValue(plainDateTime.getCalendar(), calendar); + assert.sameValue(plainDateTime.getISOFields().calendar, calendar); return [new Temporal.Instant(987654321_000_000_000n)]; } } @@ -24,5 +24,5 @@ const result = plainDate.toZonedDateTime({ plainTime: { hour: 12, minute: 30 }, }); assert.sameValue(result.epochNanoseconds, 987654321_000_000_000n); -assert.sameValue(result.getTimeZone(), timeZone); -assert.sameValue(result.getCalendar(), calendar); +assert.sameValue(result.getISOFields().timeZone, timeZone); +assert.sameValue(result.getISOFields().calendar, calendar); diff --git a/test/built-ins/Temporal/PlainDate/prototype/withCalendar/basic.js b/test/built-ins/Temporal/PlainDate/prototype/withCalendar/basic.js index cdf6f3807c0..c6845db76ed 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/withCalendar/basic.js +++ b/test/built-ins/Temporal/PlainDate/prototype/withCalendar/basic.js @@ -14,15 +14,15 @@ const calendar = Temporal.Calendar.from("iso8601"); const objectResult = plainDate.withCalendar(calendar); assert.notSameValue(objectResult, plainDate, "object: new object"); TemporalHelpers.assertPlainDate(objectResult, 1976, 11, "M11", 18, "object"); -assert.sameValue(objectResult.getCalendar(), calendar, "object: calendar"); +assert.sameValue(objectResult.getISOFields().calendar, calendar, "object: calendar"); const stringResult = plainDate.withCalendar("iso8601"); assert.notSameValue(stringResult, plainDate, "string: new object"); TemporalHelpers.assertPlainDate(stringResult, 1976, 11, "M11", 18, "string"); assert.sameValue(stringResult.getISOFields().calendar, "iso8601", "string: calendar slot stores a string"); -const originalCalendar = plainDate.getCalendar(); +const originalCalendar = plainDate.getISOFields().calendar; const sameResult = plainDate.withCalendar(originalCalendar); assert.notSameValue(sameResult, plainDate, "original: new object"); TemporalHelpers.assertPlainDate(sameResult, 1976, 11, "M11", 18, "original"); -assert.sameValue(sameResult.getCalendar(), originalCalendar, "original: calendar slot stores and object"); +assert.sameValue(sameResult.getISOFields().calendar, originalCalendar, "original: calendar slot stores and object"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/withCalendar/subclassing-ignored.js b/test/built-ins/Temporal/PlainDate/prototype/withCalendar/subclassing-ignored.js index 5c0595831dc..2762a40ed80 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/withCalendar/subclassing-ignored.js +++ b/test/built-ins/Temporal/PlainDate/prototype/withCalendar/subclassing-ignored.js @@ -42,6 +42,6 @@ TemporalHelpers.checkSubclassingIgnored( [customCalendar], (result) => { TemporalHelpers.assertPlainDate(result, 1900, 2, "M02", 5); - assert.sameValue(result.getCalendar(), customCalendar, "calendar result"); + assert.sameValue(result.getISOFields().calendar, customCalendar, "calendar result"); }, ); diff --git a/test/built-ins/Temporal/PlainDateTime/constructor-full.js b/test/built-ins/Temporal/PlainDateTime/constructor-full.js index 677ac59c19c..c9cd4f5192c 100644 --- a/test/built-ins/Temporal/PlainDateTime/constructor-full.js +++ b/test/built-ins/Temporal/PlainDateTime/constructor-full.js @@ -17,7 +17,7 @@ TemporalHelpers.assertPlainDateTime(datetime, ); assert.sameValue( - datetime.getCalendar(), + datetime.getISOFields().calendar, calendar, "calendar supplied in constructor can be extracted and is unchanged" ); diff --git a/test/built-ins/Temporal/PlainDateTime/from/argument-plaindate.js b/test/built-ins/Temporal/PlainDateTime/from/argument-plaindate.js index 693abbdb65d..9c91760da6f 100644 --- a/test/built-ins/Temporal/PlainDateTime/from/argument-plaindate.js +++ b/test/built-ins/Temporal/PlainDateTime/from/argument-plaindate.js @@ -17,5 +17,5 @@ features: [Temporal] TemporalHelpers.checkToTemporalPlainDateTimeFastPath((date, calendar) => { const result = Temporal.PlainDateTime.from(date); TemporalHelpers.assertPlainDateTime(result, 2000, 5, "M05", 2, 0, 0, 0, 0, 0, 0, "midnight is assumed"); - assert.sameValue(result.getCalendar(), calendar, "calendar result"); + assert.sameValue(result.getISOFields().calendar, calendar, "calendar result"); }); diff --git a/test/built-ins/Temporal/PlainDateTime/from/calendar-temporal-object.js b/test/built-ins/Temporal/PlainDateTime/from/calendar-temporal-object.js index 3659a257c81..bc3215b13c0 100644 --- a/test/built-ins/Temporal/PlainDateTime/from/calendar-temporal-object.js +++ b/test/built-ins/Temporal/PlainDateTime/from/calendar-temporal-object.js @@ -22,5 +22,5 @@ features: [Temporal] TemporalHelpers.checkToTemporalCalendarFastPath((temporalObject, calendar) => { const result = Temporal.PlainDateTime.from({ year: 2000, month: 5, day: 2, calendar: temporalObject }); - assert.sameValue(result.getCalendar(), calendar, "Temporal object coerced to calendar"); + assert.sameValue(result.getISOFields().calendar, calendar, "Temporal object coerced to calendar"); }); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/getCalendar/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/getCalendar/branding.js deleted file mode 100644 index 556f515cde1..00000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/getCalendar/branding.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2023 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.plaindatetime.prototype.getcalendar -description: Throw a TypeError if the receiver is invalid -features: [Symbol, Temporal] ----*/ - -const getCalendar = Temporal.PlainDateTime.prototype.getCalendar; - -assert.sameValue(typeof getCalendar, "function"); - -assert.throws(TypeError, () => getCalendar.call(undefined), "undefined"); -assert.throws(TypeError, () => getCalendar.call(null), "null"); -assert.throws(TypeError, () => getCalendar.call(true), "true"); -assert.throws(TypeError, () => getCalendar.call(""), "empty string"); -assert.throws(TypeError, () => getCalendar.call(Symbol()), "symbol"); -assert.throws(TypeError, () => getCalendar.call(1), "1"); -assert.throws(TypeError, () => getCalendar.call({}), "plain object"); -assert.throws(TypeError, () => getCalendar.call(Temporal.PlainDateTime), "Temporal.PlainDateTime"); -assert.throws(TypeError, () => getCalendar.call(Temporal.PlainDateTime.prototype), "Temporal.PlainDateTime.prototype"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/getCalendar/builtin.js b/test/built-ins/Temporal/PlainDateTime/prototype/getCalendar/builtin.js deleted file mode 100644 index 8073d1423d3..00000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/getCalendar/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.getcalendar -description: > - Tests that Temporal.PlainDateTime.prototype.getCalendar - 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.getCalendar), - true, "Built-in objects must be extensible."); - -assert.sameValue(Object.prototype.toString.call(Temporal.PlainDateTime.prototype.getCalendar), - "[object Function]", "Object.prototype.toString"); - -assert.sameValue(Object.getPrototypeOf(Temporal.PlainDateTime.prototype.getCalendar), - Function.prototype, "prototype"); - -assert.sameValue(Temporal.PlainDateTime.prototype.getCalendar.hasOwnProperty("prototype"), - false, "prototype property"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/getCalendar/length.js b/test/built-ins/Temporal/PlainDateTime/prototype/getCalendar/length.js deleted file mode 100644 index 4aa0b2f9e58..00000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/getCalendar/length.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (C) 2023 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.plaindatetime.prototype.getcalendar -description: Temporal.PlainDateTime.prototype.getCalendar.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.getCalendar, "length", { - value: 0, - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/getCalendar/name.js b/test/built-ins/Temporal/PlainDateTime/prototype/getCalendar/name.js deleted file mode 100644 index 55a49aa11fb..00000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/getCalendar/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.getcalendar -description: Temporal.PlainDateTime.prototype.getCalendar.name is "getCalendar". -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.getCalendar, "name", { - value: "getCalendar", - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/getCalendar/not-a-constructor.js b/test/built-ins/Temporal/PlainDateTime/prototype/getCalendar/not-a-constructor.js deleted file mode 100644 index 1500ff41ce1..00000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/getCalendar/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.getcalendar -description: > - Temporal.PlainDateTime.prototype.getCalendar 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.getCalendar(); -}, "Calling as constructor"); - -assert.sameValue(isConstructor(Temporal.PlainDateTime.prototype.getCalendar), false, - "isConstructor(Temporal.PlainDateTime.prototype.getCalendar)"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/getCalendar/prop-desc.js b/test/built-ins/Temporal/PlainDateTime/prototype/getCalendar/prop-desc.js deleted file mode 100644 index 0896290df60..00000000000 --- a/test/built-ins/Temporal/PlainDateTime/prototype/getCalendar/prop-desc.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2023 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.plaindatetime.prototype.getcalendar -description: The "getCalendar" property of Temporal.PlainDateTime.prototype -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -assert.sameValue( - typeof Temporal.PlainDateTime.prototype.getCalendar, - "function", - "`typeof PlainDateTime.prototype.getCalendar` is `function`" -); - -verifyProperty(Temporal.PlainDateTime.prototype, "getCalendar", { - writable: true, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/plain-custom-timezone.js b/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/plain-custom-timezone.js index ba2ad70da16..90f61975615 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/plain-custom-timezone.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/plain-custom-timezone.js @@ -42,8 +42,8 @@ const timeZone = TemporalHelpers.timeZoneObserver(actual, "timeZone", { const result = dateTime.toZonedDateTime(timeZone, options); assert.sameValue(result.epochNanoseconds, instant.epochNanoseconds); -assert.sameValue(result.getTimeZone(), timeZone); assert.compareArray(actual, expected); +assert.sameValue(result.getISOFields().timeZone, timeZone); assert.sameValue(result.getISOFields().calendar, dateTime.getISOFields().calendar); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/basic.js b/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/basic.js index 3e5f2f4bc88..1f38678c20c 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/basic.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/basic.js @@ -19,4 +19,4 @@ TemporalHelpers.assertPlainDateTime( "works" ); -assert.sameValue(result.getCalendar(), calendar, "underlying calendar is unchanged"); +assert.sameValue(result.getISOFields().calendar, calendar, "underlying calendar is unchanged"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/subclassing-ignored.js b/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/subclassing-ignored.js index 2cff05a4dc4..4a600e52c8b 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/subclassing-ignored.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/subclassing-ignored.js @@ -42,6 +42,6 @@ TemporalHelpers.checkSubclassingIgnored( [customCalendar], (result) => { TemporalHelpers.assertPlainDateTime(result, 1900, 2, "M02", 5, 12, 34, 56, 987, 654, 321); - assert.sameValue(result.getCalendar(), customCalendar, "calendar result"); + assert.sameValue(result.getISOFields().calendar, customCalendar, "calendar result"); }, ); diff --git a/test/built-ins/Temporal/PlainMonthDay/from/calendar-temporal-object.js b/test/built-ins/Temporal/PlainMonthDay/from/calendar-temporal-object.js index 5746c980150..682a0f081b5 100644 --- a/test/built-ins/Temporal/PlainMonthDay/from/calendar-temporal-object.js +++ b/test/built-ins/Temporal/PlainMonthDay/from/calendar-temporal-object.js @@ -22,5 +22,5 @@ features: [Temporal] TemporalHelpers.checkToTemporalCalendarFastPath((temporalObject, calendar) => { const result = Temporal.PlainMonthDay.from({ monthCode: "M05", day: 2, calendar: temporalObject }); - assert.sameValue(result.getCalendar(), calendar, "Temporal object coerced to calendar"); + assert.sameValue(result.getISOFields().calendar, calendar, "Temporal object coerced to calendar"); }); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/getCalendar/branding.js b/test/built-ins/Temporal/PlainMonthDay/prototype/getCalendar/branding.js deleted file mode 100644 index 91492e579c7..00000000000 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/getCalendar/branding.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2023 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.plainmonthday.prototype.getcalendar -description: Throw a TypeError if the receiver is invalid -features: [Symbol, Temporal] ----*/ - -const getCalendar = Temporal.PlainMonthDay.prototype.getCalendar; - -assert.sameValue(typeof getCalendar, "function"); - -assert.throws(TypeError, () => getCalendar.call(undefined), "undefined"); -assert.throws(TypeError, () => getCalendar.call(null), "null"); -assert.throws(TypeError, () => getCalendar.call(true), "true"); -assert.throws(TypeError, () => getCalendar.call(""), "empty string"); -assert.throws(TypeError, () => getCalendar.call(Symbol()), "symbol"); -assert.throws(TypeError, () => getCalendar.call(1), "1"); -assert.throws(TypeError, () => getCalendar.call({}), "plain object"); -assert.throws(TypeError, () => getCalendar.call(Temporal.PlainMonthDay), "Temporal.PlainMonthDay"); -assert.throws(TypeError, () => getCalendar.call(Temporal.PlainMonthDay.prototype), "Temporal.PlainMonthDay.prototype"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/getCalendar/builtin.js b/test/built-ins/Temporal/PlainMonthDay/prototype/getCalendar/builtin.js deleted file mode 100644 index 8a80d453524..00000000000 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/getCalendar/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.getcalendar -description: > - Tests that Temporal.PlainMonthDay.prototype.getCalendar - 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.getCalendar), - true, "Built-in objects must be extensible."); - -assert.sameValue(Object.prototype.toString.call(Temporal.PlainMonthDay.prototype.getCalendar), - "[object Function]", "Object.prototype.toString"); - -assert.sameValue(Object.getPrototypeOf(Temporal.PlainMonthDay.prototype.getCalendar), - Function.prototype, "prototype"); - -assert.sameValue(Temporal.PlainMonthDay.prototype.getCalendar.hasOwnProperty("prototype"), - false, "prototype property"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/getCalendar/length.js b/test/built-ins/Temporal/PlainMonthDay/prototype/getCalendar/length.js deleted file mode 100644 index a79f3e8b60c..00000000000 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/getCalendar/length.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (C) 2023 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.plainmonthday.prototype.getcalendar -description: Temporal.PlainMonthDay.prototype.getCalendar.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.getCalendar, "length", { - value: 0, - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/getCalendar/name.js b/test/built-ins/Temporal/PlainMonthDay/prototype/getCalendar/name.js deleted file mode 100644 index f02a73ddaf3..00000000000 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/getCalendar/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.getcalendar -description: Temporal.PlainMonthDay.prototype.getCalendar.name is "getCalendar". -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.getCalendar, "name", { - value: "getCalendar", - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/getCalendar/not-a-constructor.js b/test/built-ins/Temporal/PlainMonthDay/prototype/getCalendar/not-a-constructor.js deleted file mode 100644 index 54c34ebb593..00000000000 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/getCalendar/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.getcalendar -description: > - Temporal.PlainMonthDay.prototype.getCalendar 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.getCalendar(); -}, "Calling as constructor"); - -assert.sameValue(isConstructor(Temporal.PlainMonthDay.prototype.getCalendar), false, - "isConstructor(Temporal.PlainMonthDay.prototype.getCalendar)"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/getCalendar/prop-desc.js b/test/built-ins/Temporal/PlainMonthDay/prototype/getCalendar/prop-desc.js deleted file mode 100644 index 70da030514b..00000000000 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/getCalendar/prop-desc.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2023 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.plainmonthday.prototype.getcalendar -description: The "getCalendar" property of Temporal.PlainMonthDay.prototype -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -assert.sameValue( - typeof Temporal.PlainMonthDay.prototype.getCalendar, - "function", - "`typeof PlainMonthDay.prototype.getCalendar` is `function`" -); - -verifyProperty(Temporal.PlainMonthDay.prototype, "getCalendar", { - writable: true, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainYearMonth/from/calendar-temporal-object.js b/test/built-ins/Temporal/PlainYearMonth/from/calendar-temporal-object.js index 050e990a0ff..ff4c215bee0 100644 --- a/test/built-ins/Temporal/PlainYearMonth/from/calendar-temporal-object.js +++ b/test/built-ins/Temporal/PlainYearMonth/from/calendar-temporal-object.js @@ -22,5 +22,5 @@ features: [Temporal] TemporalHelpers.checkToTemporalCalendarFastPath((temporalObject, calendar) => { const result = Temporal.PlainYearMonth.from({ year: 2000, month: 5, calendar: temporalObject }); - assert.sameValue(result.getCalendar(), calendar, "Temporal object coerced to calendar"); + assert.sameValue(result.getISOFields().calendar, calendar, "Temporal object coerced to calendar"); }); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/getCalendar/branding.js b/test/built-ins/Temporal/PlainYearMonth/prototype/getCalendar/branding.js deleted file mode 100644 index 86293ae2500..00000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/getCalendar/branding.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2023 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.plainyearmonth.prototype.getcalendar -description: Throw a TypeError if the receiver is invalid -features: [Symbol, Temporal] ----*/ - -const getCalendar = Temporal.PlainYearMonth.prototype.getCalendar; - -assert.sameValue(typeof getCalendar, "function"); - -assert.throws(TypeError, () => getCalendar.call(undefined), "undefined"); -assert.throws(TypeError, () => getCalendar.call(null), "null"); -assert.throws(TypeError, () => getCalendar.call(true), "true"); -assert.throws(TypeError, () => getCalendar.call(""), "empty string"); -assert.throws(TypeError, () => getCalendar.call(Symbol()), "symbol"); -assert.throws(TypeError, () => getCalendar.call(1), "1"); -assert.throws(TypeError, () => getCalendar.call({}), "plain object"); -assert.throws(TypeError, () => getCalendar.call(Temporal.PlainYearMonth), "Temporal.PlainYearMonth"); -assert.throws(TypeError, () => getCalendar.call(Temporal.PlainYearMonth.prototype), "Temporal.PlainYearMonth.prototype"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/getCalendar/builtin.js b/test/built-ins/Temporal/PlainYearMonth/prototype/getCalendar/builtin.js deleted file mode 100644 index a83fbdabe30..00000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/getCalendar/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.getcalendar -description: > - Tests that Temporal.PlainYearMonth.prototype.getCalendar - 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.getCalendar), - true, "Built-in objects must be extensible."); - -assert.sameValue(Object.prototype.toString.call(Temporal.PlainYearMonth.prototype.getCalendar), - "[object Function]", "Object.prototype.toString"); - -assert.sameValue(Object.getPrototypeOf(Temporal.PlainYearMonth.prototype.getCalendar), - Function.prototype, "prototype"); - -assert.sameValue(Temporal.PlainYearMonth.prototype.getCalendar.hasOwnProperty("prototype"), - false, "prototype property"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/getCalendar/length.js b/test/built-ins/Temporal/PlainYearMonth/prototype/getCalendar/length.js deleted file mode 100644 index 3105dd5b7e7..00000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/getCalendar/length.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (C) 2023 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.plainyearmonth.prototype.getcalendar -description: Temporal.PlainYearMonth.prototype.getCalendar.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.getCalendar, "length", { - value: 0, - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/getCalendar/name.js b/test/built-ins/Temporal/PlainYearMonth/prototype/getCalendar/name.js deleted file mode 100644 index f12a2525d75..00000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/getCalendar/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.getcalendar -description: Temporal.PlainYearMonth.prototype.getCalendar.name is "getCalendar". -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.getCalendar, "name", { - value: "getCalendar", - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/getCalendar/not-a-constructor.js b/test/built-ins/Temporal/PlainYearMonth/prototype/getCalendar/not-a-constructor.js deleted file mode 100644 index a5fd3b5306a..00000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/getCalendar/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.getcalendar -description: > - Temporal.PlainYearMonth.prototype.getCalendar 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.getCalendar(); -}, "Calling as constructor"); - -assert.sameValue(isConstructor(Temporal.PlainYearMonth.prototype.getCalendar), false, - "isConstructor(Temporal.PlainYearMonth.prototype.getCalendar)"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/getCalendar/prop-desc.js b/test/built-ins/Temporal/PlainYearMonth/prototype/getCalendar/prop-desc.js deleted file mode 100644 index 7a2db16e2cf..00000000000 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/getCalendar/prop-desc.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2023 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.plainyearmonth.prototype.getcalendar -description: The "getCalendar" property of Temporal.PlainYearMonth.prototype -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -assert.sameValue( - typeof Temporal.PlainYearMonth.prototype.getCalendar, - "function", - "`typeof PlainYearMonth.prototype.getCalendar` is `function`" -); - -verifyProperty(Temporal.PlainYearMonth.prototype, "getCalendar", { - writable: true, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/TimeZone/from/argument-object.js b/test/built-ins/Temporal/TimeZone/from/argument-object.js index 31d443ba3a9..c6a5a7bd862 100644 --- a/test/built-ins/Temporal/TimeZone/from/argument-object.js +++ b/test/built-ins/Temporal/TimeZone/from/argument-object.js @@ -32,6 +32,6 @@ for (const thisValue of thisValues) { const zdt = new Temporal.ZonedDateTime(0n, "UTC"); const fromZdt = Temporal.TimeZone.from.call(thisValue, zdt); - assert.notSameValue(fromZdt, zdt.getTimeZone(), "from() creates a new object from a string slot value"); + assert.notSameValue(fromZdt, zdt.getISOFields().timeZone, "from() creates a new object from a string slot value"); assert.sameValue(fromZdt.id, "UTC"); } diff --git a/test/built-ins/Temporal/ZonedDateTime/from/calendar-temporal-object.js b/test/built-ins/Temporal/ZonedDateTime/from/calendar-temporal-object.js index 0489c499255..8861ef5300f 100644 --- a/test/built-ins/Temporal/ZonedDateTime/from/calendar-temporal-object.js +++ b/test/built-ins/Temporal/ZonedDateTime/from/calendar-temporal-object.js @@ -22,5 +22,5 @@ features: [Temporal] TemporalHelpers.checkToTemporalCalendarFastPath((temporalObject, calendar) => { const result = Temporal.ZonedDateTime.from({ year: 2000, month: 5, day: 2, timeZone: "UTC", calendar: temporalObject }); - assert.sameValue(result.getCalendar(), calendar, "Temporal object coerced to calendar"); + assert.sameValue(result.getISOFields().calendar, calendar, "Temporal object coerced to calendar"); }); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getCalendar/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getCalendar/branding.js deleted file mode 100644 index 3dfefde3bf3..00000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getCalendar/branding.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2023 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.zoneddatetime.prototype.getcalendar -description: Throw a TypeError if the receiver is invalid -features: [Symbol, Temporal] ----*/ - -const getCalendar = Temporal.ZonedDateTime.prototype.getCalendar; - -assert.sameValue(typeof getCalendar, "function"); - -assert.throws(TypeError, () => getCalendar.call(undefined), "undefined"); -assert.throws(TypeError, () => getCalendar.call(null), "null"); -assert.throws(TypeError, () => getCalendar.call(true), "true"); -assert.throws(TypeError, () => getCalendar.call(""), "empty string"); -assert.throws(TypeError, () => getCalendar.call(Symbol()), "symbol"); -assert.throws(TypeError, () => getCalendar.call(1), "1"); -assert.throws(TypeError, () => getCalendar.call({}), "plain object"); -assert.throws(TypeError, () => getCalendar.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); -assert.throws(TypeError, () => getCalendar.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getCalendar/builtin.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getCalendar/builtin.js deleted file mode 100644 index 65be1d8c8fa..00000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getCalendar/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.getcalendar -description: > - Tests that Temporal.ZonedDateTime.prototype.getCalendar - 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.getCalendar), - true, "Built-in objects must be extensible."); - -assert.sameValue(Object.prototype.toString.call(Temporal.ZonedDateTime.prototype.getCalendar), - "[object Function]", "Object.prototype.toString"); - -assert.sameValue(Object.getPrototypeOf(Temporal.ZonedDateTime.prototype.getCalendar), - Function.prototype, "prototype"); - -assert.sameValue(Temporal.ZonedDateTime.prototype.getCalendar.hasOwnProperty("prototype"), - false, "prototype property"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getCalendar/length.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getCalendar/length.js deleted file mode 100644 index 2fb3cc1ba7c..00000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getCalendar/length.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (C) 2023 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.zoneddatetime.prototype.getcalendar -description: Temporal.ZonedDateTime.prototype.getCalendar.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.getCalendar, "length", { - value: 0, - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getCalendar/name.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getCalendar/name.js deleted file mode 100644 index ad363666038..00000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getCalendar/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.getcalendar -description: Temporal.ZonedDateTime.prototype.getCalendar.name is "getCalendar". -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.getCalendar, "name", { - value: "getCalendar", - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getCalendar/not-a-constructor.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getCalendar/not-a-constructor.js deleted file mode 100644 index 2f7c96899f5..00000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getCalendar/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.getcalendar -description: > - Temporal.ZonedDateTime.prototype.getCalendar 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.getCalendar(); -}, "Calling as constructor"); - -assert.sameValue(isConstructor(Temporal.ZonedDateTime.prototype.getCalendar), false, - "isConstructor(Temporal.ZonedDateTime.prototype.getCalendar)"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getCalendar/prop-desc.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getCalendar/prop-desc.js deleted file mode 100644 index a6346fbccf9..00000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getCalendar/prop-desc.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2023 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.zoneddatetime.prototype.getcalendar -description: The "getCalendar" property of Temporal.ZonedDateTime.prototype -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -assert.sameValue( - typeof Temporal.ZonedDateTime.prototype.getCalendar, - "function", - "`typeof ZonedDateTime.prototype.getCalendar` is `function`" -); - -verifyProperty(Temporal.ZonedDateTime.prototype, "getCalendar", { - writable: true, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZone/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZone/branding.js deleted file mode 100644 index c76788b8c09..00000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZone/branding.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2023 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.zoneddatetime.prototype.gettimezone -description: Throw a TypeError if the receiver is invalid -features: [Symbol, Temporal] ----*/ - -const getTimeZone = Temporal.ZonedDateTime.prototype.getTimeZone; - -assert.sameValue(typeof getTimeZone, "function"); - -assert.throws(TypeError, () => getTimeZone.call(undefined), "undefined"); -assert.throws(TypeError, () => getTimeZone.call(null), "null"); -assert.throws(TypeError, () => getTimeZone.call(true), "true"); -assert.throws(TypeError, () => getTimeZone.call(""), "empty string"); -assert.throws(TypeError, () => getTimeZone.call(Symbol()), "symbol"); -assert.throws(TypeError, () => getTimeZone.call(1), "1"); -assert.throws(TypeError, () => getTimeZone.call({}), "plain object"); -assert.throws(TypeError, () => getTimeZone.call(Temporal.ZonedDateTime), "Temporal.ZonedDateTime"); -assert.throws(TypeError, () => getTimeZone.call(Temporal.ZonedDateTime.prototype), "Temporal.ZonedDateTime.prototype"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZone/builtin.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZone/builtin.js deleted file mode 100644 index 57e6dddd755..00000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZone/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.gettimezone -description: > - Tests that Temporal.ZonedDateTime.prototype.getTimeZone - 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.getTimeZone), - true, "Built-in objects must be extensible."); - -assert.sameValue(Object.prototype.toString.call(Temporal.ZonedDateTime.prototype.getTimeZone), - "[object Function]", "Object.prototype.toString"); - -assert.sameValue(Object.getPrototypeOf(Temporal.ZonedDateTime.prototype.getTimeZone), - Function.prototype, "prototype"); - -assert.sameValue(Temporal.ZonedDateTime.prototype.getTimeZone.hasOwnProperty("prototype"), - false, "prototype property"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZone/length.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZone/length.js deleted file mode 100644 index 20da9dcdc71..00000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZone/length.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (C) 2023 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.zoneddatetime.prototype.gettimezone -description: Temporal.ZonedDateTime.prototype.getTimeZone.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.getTimeZone, "length", { - value: 0, - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZone/name.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZone/name.js deleted file mode 100644 index 4f4af47f7bb..00000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZone/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.gettimezone -description: Temporal.ZonedDateTime.prototype.getTimeZone.name is "getTimeZone". -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.getTimeZone, "name", { - value: "getTimeZone", - writable: false, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZone/not-a-constructor.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZone/not-a-constructor.js deleted file mode 100644 index 56bea9fcd7a..00000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZone/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.gettimezone -description: > - Temporal.ZonedDateTime.prototype.getTimeZone 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.getTimeZone(); -}, "Calling as constructor"); - -assert.sameValue(isConstructor(Temporal.ZonedDateTime.prototype.getTimeZone), false, - "isConstructor(Temporal.ZonedDateTime.prototype.getTimeZone)"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZone/prop-desc.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZone/prop-desc.js deleted file mode 100644 index 074f4345aa0..00000000000 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZone/prop-desc.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2023 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-temporal.zoneddatetime.prototype.gettimezone -description: The "getTimeZone" property of Temporal.ZonedDateTime.prototype -includes: [propertyHelper.js] -features: [Temporal] ----*/ - -assert.sameValue( - typeof Temporal.ZonedDateTime.prototype.getTimeZone, - "function", - "`typeof ZonedDateTime.prototype.getTimeZone` is `function`" -); - -verifyProperty(Temporal.ZonedDateTime.prototype, "getTimeZone", { - writable: true, - enumerable: false, - configurable: true, -}); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/round/rounding-is-noop.js b/test/built-ins/Temporal/ZonedDateTime/prototype/round/rounding-is-noop.js index f0e7787490f..65096c44bc4 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/round/rounding-is-noop.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/round/rounding-is-noop.js @@ -22,8 +22,6 @@ for (const [options, descr] of noopRoundingOperations) { const result = instance.round(options); assert.notSameValue(result, instance, "rounding result should be a new object"); assert.sameValue(result.epochNanoseconds, instance.epochNanoseconds, "instant should be unchanged"); - assert.sameValue(result.getCalendar(), instance.getCalendar(), "calendar should be preserved"); - assert.sameValue(result.getTimeZone(), instance.getTimeZone(), "time zone should be preserved"); } const notNoopRoundingOperations = [ diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/subclassing-ignored.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/subclassing-ignored.js index 1bffb6ac9d4..1dbc8451856 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/subclassing-ignored.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/subclassing-ignored.js @@ -49,6 +49,6 @@ TemporalHelpers.checkSubclassingIgnored( assert.sameValue(result.millisecond, 0, "millisecond result"); assert.sameValue(result.microsecond, 0, "microsecond result"); assert.sameValue(result.nanosecond, 10, "nanosecond result"); - assert.sameValue(result.getCalendar(), customCalendar, "calendar result"); + assert.sameValue(result.getISOFields().calendar, customCalendar, "calendar result"); }, ); diff --git a/test/intl402/Temporal/TimeZone/from/argument-object.js b/test/intl402/Temporal/TimeZone/from/argument-object.js index 235c25f285b..79147dc6c5e 100644 --- a/test/intl402/Temporal/TimeZone/from/argument-object.js +++ b/test/intl402/Temporal/TimeZone/from/argument-object.js @@ -31,6 +31,6 @@ for (const thisValue of thisValues) { const zdt = new Temporal.ZonedDateTime(0n, "Africa/Cairo"); const fromZdt = Temporal.TimeZone.from.call(thisValue, zdt); - assert.notSameValue(fromZdt, zdt.getTimeZone(), "from() creates a new object for a string slot value"); + assert.notSameValue(fromZdt, zdt.getISOFields().timeZone, "from() creates a new object for a string slot value"); assert.sameValue(fromZdt.id, "Africa/Cairo"); } diff --git a/test/staging/Temporal/UserCalendar/old/calendar-extra-fields.js b/test/staging/Temporal/UserCalendar/old/calendar-extra-fields.js index 669bcc21d27..5644489c023 100644 --- a/test/staging/Temporal/UserCalendar/old/calendar-extra-fields.js +++ b/test/staging/Temporal/UserCalendar/old/calendar-extra-fields.js @@ -73,7 +73,7 @@ var monthday = new Temporal.PlainMonthDay(9, 15, calendar); var zoned = new Temporal.ZonedDateTime(1568505600000000000n, "UTC", calendar); var propDesc = { get() { - return this.getCalendar().season(this); + return this.getISOFields().calendar.season(this); }, configurable: true }; diff --git a/test/staging/Temporal/UserCalendar/old/calendar-non-trivial-mergefields.js b/test/staging/Temporal/UserCalendar/old/calendar-non-trivial-mergefields.js index 8c41d56b7b5..b84fefad9d2 100644 --- a/test/staging/Temporal/UserCalendar/old/calendar-non-trivial-mergefields.js +++ b/test/staging/Temporal/UserCalendar/old/calendar-non-trivial-mergefields.js @@ -97,13 +97,13 @@ var zoned = new Temporal.ZonedDateTime(1568505600000000000n, "UTC", calendar); var propDesc = { century: { get() { - return this.getCalendar().century(this); + return this.getISOFields().calendar.century(this); }, configurable: true }, centuryYear: { get() { - return this.getCalendar().centuryYear(this); + return this.getISOFields().calendar.centuryYear(this); }, configurable: true } diff --git a/test/staging/Temporal/UserCalendar/old/trivial-protocol-implementation.js b/test/staging/Temporal/UserCalendar/old/trivial-protocol-implementation.js index de1a92360aa..db2fdeb9dff 100644 --- a/test/staging/Temporal/UserCalendar/old/trivial-protocol-implementation.js +++ b/test/staging/Temporal/UserCalendar/old/trivial-protocol-implementation.js @@ -217,4 +217,4 @@ assert.sameValue(md2.monthCode, "M01"); var tz = Temporal.TimeZone.from("UTC"); var inst = Temporal.Instant.fromEpochMilliseconds(0); var dt = tz.getPlainDateTimeFor(inst, obj); -assert.sameValue(dt.getCalendar(), obj); +assert.sameValue(dt.getISOFields().calendar, obj); diff --git a/test/staging/Temporal/UserCalendar/old/trivial-subclass.js b/test/staging/Temporal/UserCalendar/old/trivial-subclass.js index 36b87e38c8e..ad9d465e38d 100644 --- a/test/staging/Temporal/UserCalendar/old/trivial-subclass.js +++ b/test/staging/Temporal/UserCalendar/old/trivial-subclass.js @@ -153,4 +153,4 @@ assert.sameValue(md2.monthCode, "M02"); var tz = Temporal.TimeZone.from("UTC"); var instant = Temporal.Instant.fromEpochMilliseconds(0); var dt = tz.getPlainDateTimeFor(instant, obj); -assert.sameValue(dt.getCalendar(), obj); +assert.sameValue(dt.getISOFields().calendar, obj); diff --git a/test/staging/Temporal/ZonedDateTime/old/toPlainDate.js b/test/staging/Temporal/ZonedDateTime/old/toPlainDate.js index 1cd3cefa0ef..60cca9273b0 100644 --- a/test/staging/Temporal/ZonedDateTime/old/toPlainDate.js +++ b/test/staging/Temporal/ZonedDateTime/old/toPlainDate.js @@ -38,4 +38,4 @@ const fakeGregorian = { yearOfWeek() {}, }; var zdt = Temporal.Instant.from("2019-10-29T09:46:38.271986102Z").toZonedDateTimeISO(tz).withCalendar(fakeGregorian); -assert.sameValue(zdt.toPlainDate().getCalendar(), fakeGregorian); +assert.sameValue(zdt.toPlainDate().getISOFields().calendar, fakeGregorian); diff --git a/test/staging/Temporal/ZonedDateTime/old/withCalendar.js b/test/staging/Temporal/ZonedDateTime/old/withCalendar.js index db9dec80771..e97d4968e10 100644 --- a/test/staging/Temporal/ZonedDateTime/old/withCalendar.js +++ b/test/staging/Temporal/ZonedDateTime/old/withCalendar.js @@ -39,5 +39,5 @@ assert.sameValue(`${ zdt.withCalendar(cal) }`, "2019-11-18T15:23:30.123456789-08 var zdt = Temporal.ZonedDateTime.from("2019-11-18T15:23:30.123456789+01:00[+01:00][u-ca=iso8601]"); var zdt2 = zdt.withCalendar(cal); assert.sameValue(zdt.epochNanoseconds, zdt2.epochNanoseconds); -assert.sameValue(zdt2.getCalendar(), cal); +assert.sameValue(zdt2.getISOFields().calendar, cal); assert.sameValue(zdt2.timeZoneId, "+01:00"); diff --git a/test/staging/Temporal/ZonedDateTime/old/withTimezone.js b/test/staging/Temporal/ZonedDateTime/old/withTimezone.js index f05c2c52774..3f635bb64c3 100644 --- a/test/staging/Temporal/ZonedDateTime/old/withTimezone.js +++ b/test/staging/Temporal/ZonedDateTime/old/withTimezone.js @@ -34,6 +34,6 @@ var fakeGregorian = { var zdt = Temporal.ZonedDateTime.from("2019-11-18T15:23:30.123456789+01:00[+01:00]").withCalendar(fakeGregorian); var zdt2 = zdt.withTimeZone("-08:00"); assert.sameValue(zdt.epochNanoseconds, zdt2.epochNanoseconds); -assert.sameValue(zdt2.getCalendar(), fakeGregorian); +assert.sameValue(zdt2.getISOFields().calendar, fakeGregorian); assert.sameValue(zdt2.timeZoneId, "-08:00"); assert.notSameValue(`${ zdt.toPlainDateTime() }`, `${ zdt2.toPlainDateTime() }`);