diff --git a/harness/temporalHelpers.js b/harness/temporalHelpers.js index 4fe2ca1258..78f20a0d59 100644 --- a/harness/temporalHelpers.js +++ b/harness/temporalHelpers.js @@ -342,7 +342,7 @@ var TemporalHelpers = { const actual = []; const expected = []; - const calendar = new Temporal.Calendar("iso8601"); + const calendar = "iso8601"; const datetime = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321, calendar); const prototypeDescrs = Object.getOwnPropertyDescriptors(Temporal.PlainDateTime.prototype); ["year", "month", "monthCode", "day", "hour", "minute", "second", "millisecond", "microsecond", "nanosecond"].forEach((property) => { @@ -964,8 +964,7 @@ var TemporalHelpers = { const actual = []; const expected = []; - const calendar = new Temporal.Calendar("iso8601"); - const date = new Temporal.PlainDate(2000, 5, 2, calendar); + const date = new Temporal.PlainDate(2000, 5, 2, "iso8601"); const prototypeDescrs = Object.getOwnPropertyDescriptors(Temporal.PlainDate.prototype); ["year", "month", "monthCode", "day"].forEach((property) => { Object.defineProperty(date, property, { diff --git a/test/built-ins/Temporal/Duration/compare/relativeto-propertybag-invalid-offset-string.js b/test/built-ins/Temporal/Duration/compare/relativeto-propertybag-invalid-offset-string.js index c1dfe588e1..42deeb54db 100644 --- a/test/built-ins/Temporal/Duration/compare/relativeto-propertybag-invalid-offset-string.js +++ b/test/built-ins/Temporal/Duration/compare/relativeto-propertybag-invalid-offset-string.js @@ -7,7 +7,6 @@ description: relativeTo property bag with offset property is rejected if offset features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); const d1 = new Temporal.Duration(0, 1, 0, 280); const d2 = new Temporal.Duration(0, 1, 0, 281); @@ -21,7 +20,7 @@ const badOffsets = [ 1000n, // must be a string ]; badOffsets.forEach((offset) => { - const relativeTo = { year: 2021, month: 10, day: 28, offset, timeZone }; + const relativeTo = { year: 2021, month: 10, day: 28, offset, timeZone: "UTC" }; assert.throws( typeof(offset) === 'string' ? RangeError : TypeError, () => Temporal.Duration.compare(d1, d2, { relativeTo }), diff --git a/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-calendar-wrong-type.js index ee0b727846..8fd96253b3 100644 --- a/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-calendar-wrong-type.js @@ -9,7 +9,7 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.Duration(1, 0, 0, 0, 24); const primitiveTests = [ diff --git a/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-invalid-offset-string.js b/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-invalid-offset-string.js index 92729decd6..ee038cd8b4 100644 --- a/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-invalid-offset-string.js +++ b/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-invalid-offset-string.js @@ -7,7 +7,7 @@ description: relativeTo property bag with offset property is rejected if offset features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.Duration(1, 0, 0, 0, 24); const badOffsets = [ diff --git a/test/built-ins/Temporal/Duration/prototype/round/relativeto-wrong-type.js b/test/built-ins/Temporal/Duration/prototype/round/relativeto-wrong-type.js index d4b7af3f67..22fc458dec 100644 --- a/test/built-ins/Temporal/Duration/prototype/round/relativeto-wrong-type.js +++ b/test/built-ins/Temporal/Duration/prototype/round/relativeto-wrong-type.js @@ -9,7 +9,7 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone('UTC'); +const timeZone = "UTC"; const instance = new Temporal.Duration(1, 0, 0, 0, 24); const primitiveTests = [ diff --git a/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-calendar-wrong-type.js index aba5db54ef..89d8002d2a 100644 --- a/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-calendar-wrong-type.js @@ -9,7 +9,7 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.Duration(1, 0, 0, 0, 24); const primitiveTests = [ diff --git a/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-invalid-offset-string.js b/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-invalid-offset-string.js index 50b44cb62a..f5adc67f93 100644 --- a/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-invalid-offset-string.js +++ b/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-invalid-offset-string.js @@ -7,7 +7,7 @@ description: relativeTo property bag with offset property is rejected if offset features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.Duration(1, 0, 0, 0, 24); const badOffsets = [ diff --git a/test/built-ins/Temporal/Duration/prototype/total/relativeto-wrong-type.js b/test/built-ins/Temporal/Duration/prototype/total/relativeto-wrong-type.js index d90ba1dc14..29541d661e 100644 --- a/test/built-ins/Temporal/Duration/prototype/total/relativeto-wrong-type.js +++ b/test/built-ins/Temporal/Duration/prototype/total/relativeto-wrong-type.js @@ -9,7 +9,7 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone('UTC'); +const timeZone = "UTC"; const instance = new Temporal.Duration(1, 0, 0, 0, 24); const primitiveTests = [ diff --git a/test/built-ins/Temporal/Instant/prototype/toString/timezone-offset.js b/test/built-ins/Temporal/Instant/prototype/toString/timezone-offset.js index 1914167cf0..f2e4f93327 100644 --- a/test/built-ins/Temporal/Instant/prototype/toString/timezone-offset.js +++ b/test/built-ins/Temporal/Instant/prototype/toString/timezone-offset.js @@ -10,8 +10,7 @@ features: [BigInt, Temporal] const instant = new Temporal.Instant(0n); function test(timeZoneIdentifier, expected, description) { - const timeZone = new Temporal.TimeZone(timeZoneIdentifier); - assert.sameValue(instant.toString({ timeZone }), expected, description); + assert.sameValue(instant.toString({ timeZone: timeZoneIdentifier }), expected, description); } test("UTC", "1970-01-01T00:00:00+00:00", "offset of UTC is +00:00"); diff --git a/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/branding.js b/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/branding.js index a5997e2f01..021dbb0d81 100644 --- a/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/branding.js +++ b/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/branding.js @@ -11,7 +11,7 @@ const toZonedDateTimeISO = Temporal.Instant.prototype.toZonedDateTimeISO; assert.sameValue(typeof toZonedDateTimeISO, "function"); -const args = [{ timeZone: new Temporal.TimeZone("UTC") }]; +const args = [{ timeZone: "UTC" }]; assert.throws(TypeError, () => toZonedDateTimeISO.apply(undefined, args), "undefined"); assert.throws(TypeError, () => toZonedDateTimeISO.apply(null, args), "null"); diff --git a/test/built-ins/Temporal/PlainDate/from/argument-propertybag-calendar.js b/test/built-ins/Temporal/PlainDate/from/argument-propertybag-calendar.js index c1b6eb5de3..618bbfb15d 100644 --- a/test/built-ins/Temporal/PlainDate/from/argument-propertybag-calendar.js +++ b/test/built-ins/Temporal/PlainDate/from/argument-propertybag-calendar.js @@ -8,7 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const calendar = new Temporal.Calendar("iso8601"); +const calendar = "iso8601"; const plainDate = Temporal.PlainDate.from({ year: 1976, month: 11, day: 18, calendar }); TemporalHelpers.assertPlainDate(plainDate, 1976, 11, "M11", 18); assert.sameValue(plainDate.getISOFields().calendar, "iso8601", "calendar slot should store a string"); diff --git a/test/built-ins/Temporal/PlainDate/from/argument-zoneddatetime.js b/test/built-ins/Temporal/PlainDate/from/argument-zoneddatetime.js index eee8e4b0c1..3caa472f66 100644 --- a/test/built-ins/Temporal/PlainDate/from/argument-zoneddatetime.js +++ b/test/built-ins/Temporal/PlainDate/from/argument-zoneddatetime.js @@ -8,7 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const calendar = new Temporal.Calendar("iso8601"); +const calendar = "iso8601"; const zdt = new Temporal.ZonedDateTime(1_000_000_000_987_654_321n, "UTC", calendar); const result = Temporal.PlainDate.from(zdt); diff --git a/test/built-ins/Temporal/PlainDate/prototype/equals/argument-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/PlainDate/prototype/equals/argument-propertybag-calendar-wrong-type.js index 1cab7c1e23..a91bbe8e2d 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/equals/argument-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/PlainDate/prototype/equals/argument-propertybag-calendar-wrong-type.js @@ -9,7 +9,7 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.PlainDate(2000, 5, 2); const primitiveTests = [ diff --git a/test/built-ins/Temporal/PlainDate/prototype/since/argument-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/PlainDate/prototype/since/argument-propertybag-calendar-wrong-type.js index cabc64bba1..d6fa356f70 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/since/argument-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/PlainDate/prototype/since/argument-propertybag-calendar-wrong-type.js @@ -9,7 +9,6 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); const instance = new Temporal.PlainDate(2000, 5, 2); const primitiveTests = [ diff --git a/test/built-ins/Temporal/PlainDate/prototype/toPlainMonthDay/basic.js b/test/built-ins/Temporal/PlainDate/prototype/toPlainMonthDay/basic.js index c64b637bc3..219942a325 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/toPlainMonthDay/basic.js +++ b/test/built-ins/Temporal/PlainDate/prototype/toPlainMonthDay/basic.js @@ -8,8 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const calendar = new Temporal.Calendar("iso8601"); -const pd = new Temporal.PlainDate(1970, 12, 24, calendar); +const pd = new Temporal.PlainDate(1970, 12, 24, "iso8601"); const pmd = pd.toPlainMonthDay(); TemporalHelpers.assertPlainMonthDay(pmd, "M12", 24); assert.sameValue(pmd.getISOFields().calendar, "iso8601"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/toPlainYearMonth/basic.js b/test/built-ins/Temporal/PlainDate/prototype/toPlainYearMonth/basic.js index d2c722c514..01c41f225f 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/toPlainYearMonth/basic.js +++ b/test/built-ins/Temporal/PlainDate/prototype/toPlainYearMonth/basic.js @@ -8,8 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const calendar = new Temporal.Calendar("iso8601"); -const pd = new Temporal.PlainDate(1970, 12, 24, calendar); +const pd = new Temporal.PlainDate(1970, 12, 24, "iso8601"); const pym = pd.toPlainYearMonth(); TemporalHelpers.assertPlainYearMonth(pym, 1970, 12, "M12"); assert.sameValue(pym.getISOFields().calendar, "iso8601"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/basic.js b/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/basic.js index 99591700ca..47c909eef3 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/basic.js +++ b/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/basic.js @@ -8,7 +8,7 @@ features: [Temporal] ---*/ const plainDate = Temporal.PlainDate.from("2020-01-01"); -const timeZone = Temporal.TimeZone.from("UTC"); +const timeZone = "UTC"; const plainTime = Temporal.PlainTime.from("12:00"); let result = plainDate.toZonedDateTime({ timeZone, plainTime }); @@ -17,13 +17,7 @@ assert.sameValue(result.toString(), "2020-01-01T12:00:00+00:00[UTC]", "objects p result = plainDate.toZonedDateTime(timeZone); assert.sameValue(result.toString(), "2020-01-01T00:00:00+00:00[UTC]", "time zone object argument"); -result = plainDate.toZonedDateTime("UTC"); -assert.sameValue(result.toString(), "2020-01-01T00:00:00+00:00[UTC]", "time zone string argument"); - -result = plainDate.toZonedDateTime({ timeZone }); -assert.sameValue(result.toString(), "2020-01-01T00:00:00+00:00[UTC]", "time zone object property"); - -result = plainDate.toZonedDateTime({ timeZone: "UTC", plainTime }); +result = plainDate.toZonedDateTime({ timeZone, plainTime }); assert.sameValue(result.toString(), "2020-01-01T12:00:00+00:00[UTC]", "time zone string property"); result = plainDate.toZonedDateTime({ timeZone, plainTime: "12:00" }); diff --git a/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/branding.js b/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/branding.js index 6ef14dad48..e035cdfbec 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/branding.js +++ b/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/branding.js @@ -11,7 +11,7 @@ const toZonedDateTime = Temporal.PlainDate.prototype.toZonedDateTime; assert.sameValue(typeof toZonedDateTime, "function"); -const args = [new Temporal.TimeZone("UTC")]; +const args = ["UTC"]; assert.throws(TypeError, () => toZonedDateTime.apply(undefined, args), "undefined"); assert.throws(TypeError, () => toZonedDateTime.apply(null, args), "null"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/until/argument-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/PlainDate/prototype/until/argument-propertybag-calendar-wrong-type.js index e0383ce83e..8c8d042319 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/until/argument-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/PlainDate/prototype/until/argument-propertybag-calendar-wrong-type.js @@ -9,7 +9,7 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.PlainDate(2000, 5, 2); const primitiveTests = [ diff --git a/test/built-ins/Temporal/PlainDate/prototype/withCalendar/basic.js b/test/built-ins/Temporal/PlainDate/prototype/withCalendar/basic.js index c6845db76e..cabe8538d2 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/withCalendar/basic.js +++ b/test/built-ins/Temporal/PlainDate/prototype/withCalendar/basic.js @@ -9,20 +9,9 @@ features: [Temporal] ---*/ const plainDate = Temporal.PlainDate.from("1976-11-18"); -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.getISOFields().calendar, calendar, "object: calendar"); +const calendar = "iso8601"; 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.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.getISOFields().calendar, originalCalendar, "original: calendar slot stores and object"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/withCalendar/branding.js b/test/built-ins/Temporal/PlainDate/prototype/withCalendar/branding.js index 964b62ac28..3b25999099 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/withCalendar/branding.js +++ b/test/built-ins/Temporal/PlainDate/prototype/withCalendar/branding.js @@ -11,7 +11,7 @@ const withCalendar = Temporal.PlainDate.prototype.withCalendar; assert.sameValue(typeof withCalendar, "function"); -const args = [new Temporal.Calendar("iso8601")]; +const args = ["iso8601"]; assert.throws(TypeError, () => withCalendar.apply(undefined, args), "undefined"); assert.throws(TypeError, () => withCalendar.apply(null, args), "null"); diff --git a/test/built-ins/Temporal/PlainDateTime/constructor-full.js b/test/built-ins/Temporal/PlainDateTime/constructor-full.js index c9cd4f5192..ac549099a9 100644 --- a/test/built-ins/Temporal/PlainDateTime/constructor-full.js +++ b/test/built-ins/Temporal/PlainDateTime/constructor-full.js @@ -8,8 +8,7 @@ features: [Temporal] includes: [temporalHelpers.js] ---*/ -const calendar = Temporal.Calendar.from("iso8601"); -const datetime = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789, calendar); +const datetime = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789, "iso8601"); TemporalHelpers.assertPlainDateTime(datetime, 1976, 11, "M11", 18, 15, 23, 30, 123, 456, 789, @@ -18,6 +17,6 @@ TemporalHelpers.assertPlainDateTime(datetime, assert.sameValue( datetime.getISOFields().calendar, - calendar, + "iso8601", "calendar supplied in constructor can be extracted and is unchanged" ); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/dayOfWeek/basic.js b/test/built-ins/Temporal/PlainDateTime/prototype/dayOfWeek/basic.js index 437ac74b60..de897ea3a4 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/dayOfWeek/basic.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/dayOfWeek/basic.js @@ -7,6 +7,5 @@ description: Checking day of week for a "normal" case (non-undefined, non-bounda features: [Temporal] ---*/ -const calendar = Temporal.Calendar.from("iso8601"); -const datetime = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789, calendar); +const datetime = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789, "iso8601"); assert.sameValue(datetime.dayOfWeek, 4, "check day of week information"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/dayOfYear/basic.js b/test/built-ins/Temporal/PlainDateTime/prototype/dayOfYear/basic.js index 98ee0fbef0..3d5735fd42 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/dayOfYear/basic.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/dayOfYear/basic.js @@ -7,6 +7,5 @@ description: Checking day of year for a "normal" case (non-undefined, non-bounda features: [Temporal] ---*/ -const calendar = Temporal.Calendar.from("iso8601"); -const datetime = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789, calendar); +const datetime = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789, "iso8601"); assert.sameValue(datetime.dayOfYear, 323, "check day of year information"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/equals/argument-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/PlainDateTime/prototype/equals/argument-propertybag-calendar-wrong-type.js index 6825ff3d19..b5a21e8622 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/equals/argument-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/equals/argument-propertybag-calendar-wrong-type.js @@ -9,7 +9,7 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); const primitiveTests = [ diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/monthsInYear/basic.js b/test/built-ins/Temporal/PlainDateTime/prototype/monthsInYear/basic.js index f918a25355..579b6e619b 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/monthsInYear/basic.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/monthsInYear/basic.js @@ -7,6 +7,5 @@ description: Checking months in year for a "normal" case (non-undefined, non-bou features: [Temporal] ---*/ -const calendar = Temporal.Calendar.from("iso8601"); -const datetime = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789, calendar); +const datetime = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789, "iso8601"); assert.sameValue(datetime.monthsInYear, 12, "check months in year information"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-wrong-type.js index 6e17c616a0..1817dc7ebb 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/since/argument-propertybag-calendar-wrong-type.js @@ -9,7 +9,6 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); const primitiveTests = [ diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/toString/basic.js b/test/built-ins/Temporal/PlainDateTime/prototype/toString/basic.js index 5e5b7596a4..2930e0e76e 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/toString/basic.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/toString/basic.js @@ -7,7 +7,6 @@ description: Checking the string form of an explicitly constructed instance with features: [Temporal] ---*/ -const calendar = Temporal.Calendar.from("iso8601"); -const datetime = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789, calendar); +const datetime = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789, "iso8601"); assert.sameValue(datetime.toString(), "1976-11-18T15:23:30.123456789", "check string value"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/branding.js index d58915e726..47d7efb3aa 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/branding.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/branding.js @@ -11,7 +11,7 @@ const toZonedDateTime = Temporal.PlainDateTime.prototype.toZonedDateTime; assert.sameValue(typeof toZonedDateTime, "function"); -const args = [new Temporal.TimeZone("UTC")]; +const args = ["UTC"]; assert.throws(TypeError, () => toZonedDateTime.apply(undefined, args), "undefined"); assert.throws(TypeError, () => toZonedDateTime.apply(null, args), "null"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/disambiguation-invalid-string.js b/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/disambiguation-invalid-string.js index ab7127ce59..0c767c50e2 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/disambiguation-invalid-string.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/disambiguation-invalid-string.js @@ -15,12 +15,11 @@ features: [Temporal] ---*/ const datetime = new Temporal.PlainDateTime(2001, 9, 9, 1, 46, 40, 987, 654, 321); -const timeZone = new Temporal.TimeZone("UTC"); const invalidStrings = ["obviously bad", "", "EARLIER", "earlıer", "late\u0131r", "reject\0"]; invalidStrings.forEach((s) => { assert.throws( RangeError, - () => datetime.toZonedDateTime(timeZone, { disambiguation: s }), + () => datetime.toZonedDateTime("UTC", { disambiguation: s }), `invalid disambiguation string (${s})`); }); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/disambiguation-wrong-type.js b/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/disambiguation-wrong-type.js index bf7d4dbb17..86a95283ed 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/disambiguation-wrong-type.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/disambiguation-wrong-type.js @@ -16,8 +16,7 @@ features: [Temporal] ---*/ const datetime = new Temporal.PlainDateTime(2001, 9, 9, 1, 46, 40, 987, 654, 321); -const timeZone = new Temporal.TimeZone("UTC"); TemporalHelpers.checkStringOptionWrongType("disambiguation", "compatible", - (disambiguation) => datetime.toZonedDateTime(timeZone, { disambiguation }), + (disambiguation) => datetime.toZonedDateTime("UTC", { disambiguation }), (result, descr) => assert.sameValue(result.epochNanoseconds, 1_000_000_000_987_654_321n, descr), ); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-wrong-type.js index 0f1dd41ef1..42545efbea 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/until/argument-propertybag-calendar-wrong-type.js @@ -9,7 +9,7 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); const primitiveTests = [ diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/weekOfYear/basic.js b/test/built-ins/Temporal/PlainDateTime/prototype/weekOfYear/basic.js index 6273dbc54c..4d8c71fd68 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/weekOfYear/basic.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/weekOfYear/basic.js @@ -7,6 +7,5 @@ description: Checking week of year for a "normal" case (non-undefined, non-bound features: [Temporal] ---*/ -const calendar = Temporal.Calendar.from("iso8601"); -const datetime = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789, calendar); +const datetime = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789, "iso8601"); assert.sameValue(datetime.weekOfYear, 47, "check week of year information"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/basic.js b/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/basic.js index 1f38678c20..ad23448fb5 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/basic.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/basic.js @@ -9,7 +9,7 @@ includes: [temporalHelpers.js] ---*/ const dt = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789); -const calendar = new Temporal.Calendar("iso8601"); +const calendar = "iso8601"; const result = dt.withCalendar(calendar); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/branding.js b/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/branding.js index 911f96a77f..7363ee0946 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/branding.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/branding.js @@ -11,7 +11,7 @@ const withCalendar = Temporal.PlainDateTime.prototype.withCalendar; assert.sameValue(typeof withCalendar, "function"); -const args = [new Temporal.Calendar("iso8601")]; +const args = ["iso8601"]; assert.throws(TypeError, () => withCalendar.apply(undefined, args), "undefined"); assert.throws(TypeError, () => withCalendar.apply(null, args), "null"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/yearOfWeek/basic.js b/test/built-ins/Temporal/PlainDateTime/prototype/yearOfWeek/basic.js index ec1a834b40..41f3aaf453 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/yearOfWeek/basic.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/yearOfWeek/basic.js @@ -7,6 +7,5 @@ description: Checking yearOfWeek for a "normal" case (non-undefined, non-boundar features: [Temporal] ---*/ -const calendar = Temporal.Calendar.from("iso8601"); -const datetime = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789, calendar); +const datetime = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 30, 123, 456, 789, "iso8601"); assert.sameValue(datetime.yearOfWeek, 1976, "check yearOfWeek information"); diff --git a/test/built-ins/Temporal/PlainMonthDay/infinity-throws-rangeerror.js b/test/built-ins/Temporal/PlainMonthDay/infinity-throws-rangeerror.js index a96544f0bd..c4ba779580 100644 --- a/test/built-ins/Temporal/PlainMonthDay/infinity-throws-rangeerror.js +++ b/test/built-ins/Temporal/PlainMonthDay/infinity-throws-rangeerror.js @@ -8,11 +8,9 @@ includes: [compareArray.js, temporalHelpers.js] features: [Temporal] ---*/ -const isoCalendar = Temporal.Calendar.from('iso8601'); - assert.throws(RangeError, () => new Temporal.PlainMonthDay(Infinity, 1)); assert.throws(RangeError, () => new Temporal.PlainMonthDay(1, Infinity)); -assert.throws(RangeError, () => new Temporal.PlainMonthDay(1, 1, isoCalendar, Infinity)); +assert.throws(RangeError, () => new Temporal.PlainMonthDay(1, 1, "iso8601", Infinity)); const O = (primitiveValue, propertyName) => (calls) => TemporalHelpers.toPrimitiveObserver(calls, primitiveValue, propertyName); const tests = [ diff --git a/test/built-ins/Temporal/PlainMonthDay/negative-infinity-throws-rangeerror.js b/test/built-ins/Temporal/PlainMonthDay/negative-infinity-throws-rangeerror.js index 1944f9c666..2908e327fb 100644 --- a/test/built-ins/Temporal/PlainMonthDay/negative-infinity-throws-rangeerror.js +++ b/test/built-ins/Temporal/PlainMonthDay/negative-infinity-throws-rangeerror.js @@ -8,11 +8,9 @@ includes: [compareArray.js, temporalHelpers.js] features: [Temporal] ---*/ -const isoCalendar = Temporal.Calendar.from('iso8601'); - assert.throws(RangeError, () => new Temporal.PlainMonthDay(-Infinity, 1)); assert.throws(RangeError, () => new Temporal.PlainMonthDay(1, -Infinity)); -assert.throws(RangeError, () => new Temporal.PlainMonthDay(1, 1, isoCalendar, -Infinity)); +assert.throws(RangeError, () => new Temporal.PlainMonthDay(1, 1, "iso8601", -Infinity)); const O = (primitiveValue, propertyName) => (calls) => TemporalHelpers.toPrimitiveObserver(calls, primitiveValue, propertyName); const tests = [ diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-propertybag-calendar-wrong-type.js index 850d900824..13831fb728 100644 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/equals/argument-propertybag-calendar-wrong-type.js @@ -9,7 +9,7 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.PlainMonthDay(5, 2); const primitiveTests = [ diff --git a/test/built-ins/Temporal/PlainMonthDay/refisoyear-out-of-range.js b/test/built-ins/Temporal/PlainMonthDay/refisoyear-out-of-range.js index 63e7e9d4e0..4a6e63c73b 100644 --- a/test/built-ins/Temporal/PlainMonthDay/refisoyear-out-of-range.js +++ b/test/built-ins/Temporal/PlainMonthDay/refisoyear-out-of-range.js @@ -7,7 +7,5 @@ description: referenceISOYear argument, if given, can cause RangeError features: [Temporal] ---*/ -const calendar = new Temporal.Calendar("iso8601"); - -assert.throws(RangeError, () => new Temporal.PlainMonthDay(9, 14, calendar, 275760), "after the maximum ISO date"); -assert.throws(RangeError, () => new Temporal.PlainMonthDay(4, 18, calendar, -271821), "before the minimum ISO date") +assert.throws(RangeError, () => new Temporal.PlainMonthDay(9, 14, "iso8601", 275760), "after the maximum ISO date"); +assert.throws(RangeError, () => new Temporal.PlainMonthDay(4, 18, "iso8601", -271821), "before the minimum ISO date") diff --git a/test/built-ins/Temporal/PlainMonthDay/refisoyear-undefined.js b/test/built-ins/Temporal/PlainMonthDay/refisoyear-undefined.js index f9671ba848..062d7d3622 100644 --- a/test/built-ins/Temporal/PlainMonthDay/refisoyear-undefined.js +++ b/test/built-ins/Temporal/PlainMonthDay/refisoyear-undefined.js @@ -7,8 +7,7 @@ description: referenceISOYear argument defaults to 1972 if not given features: [Temporal] ---*/ -const calendar = new Temporal.Calendar("iso8601"); -const args = [5, 2, calendar]; +const args = [5, 2, "iso8601"]; const dateExplicit = new Temporal.PlainMonthDay(...args, undefined); assert.sameValue(dateExplicit.getISOFields().isoYear, 1972, "default referenceISOYear is 1972"); diff --git a/test/built-ins/Temporal/PlainYearMonth/compare/compare-reference-day.js b/test/built-ins/Temporal/PlainYearMonth/compare/compare-reference-day.js index 29a9c48661..d7e41068ac 100644 --- a/test/built-ins/Temporal/PlainYearMonth/compare/compare-reference-day.js +++ b/test/built-ins/Temporal/PlainYearMonth/compare/compare-reference-day.js @@ -7,7 +7,6 @@ description: compare() takes the reference day into account features: [Temporal] ---*/ -const iso = Temporal.Calendar.from("iso8601"); -const ym1 = new Temporal.PlainYearMonth(2000, 1, iso, 1); -const ym2 = new Temporal.PlainYearMonth(2000, 1, iso, 2); +const ym1 = new Temporal.PlainYearMonth(2000, 1, "iso8601", 1); +const ym2 = new Temporal.PlainYearMonth(2000, 1, "iso8601", 2); assert.sameValue(Temporal.PlainYearMonth.compare(ym1, ym2), -1); diff --git a/test/built-ins/Temporal/PlainYearMonth/infinity-throws-rangeerror.js b/test/built-ins/Temporal/PlainYearMonth/infinity-throws-rangeerror.js index b81f09b70e..521c631489 100644 --- a/test/built-ins/Temporal/PlainYearMonth/infinity-throws-rangeerror.js +++ b/test/built-ins/Temporal/PlainYearMonth/infinity-throws-rangeerror.js @@ -8,11 +8,9 @@ includes: [compareArray.js, temporalHelpers.js] features: [Temporal] ---*/ -const isoCalendar = Temporal.Calendar.from('iso8601'); - assert.throws(RangeError, () => new Temporal.PlainYearMonth(Infinity, 1)); assert.throws(RangeError, () => new Temporal.PlainYearMonth(1970, Infinity)); -assert.throws(RangeError, () => new Temporal.PlainYearMonth(1970, 1, isoCalendar, Infinity)); +assert.throws(RangeError, () => new Temporal.PlainYearMonth(1970, 1, "iso8601", Infinity)); const O = (primitiveValue, propertyName) => (calls) => TemporalHelpers.toPrimitiveObserver(calls, primitiveValue, propertyName); const tests = [ diff --git a/test/built-ins/Temporal/PlainYearMonth/negative-infinity-throws-rangeerror.js b/test/built-ins/Temporal/PlainYearMonth/negative-infinity-throws-rangeerror.js index 0f65524ae8..b49d79c077 100644 --- a/test/built-ins/Temporal/PlainYearMonth/negative-infinity-throws-rangeerror.js +++ b/test/built-ins/Temporal/PlainYearMonth/negative-infinity-throws-rangeerror.js @@ -8,11 +8,10 @@ includes: [compareArray.js, temporalHelpers.js] features: [Temporal] ---*/ -const isoCalendar = Temporal.Calendar.from('iso8601'); assert.throws(RangeError, () => new Temporal.PlainYearMonth(-Infinity, 1)); assert.throws(RangeError, () => new Temporal.PlainYearMonth(1970, -Infinity)); -assert.throws(RangeError, () => new Temporal.PlainYearMonth(1970, 1, isoCalendar, -Infinity)); +assert.throws(RangeError, () => new Temporal.PlainYearMonth(1970, 1, "iso8601", -Infinity)); const O = (primitiveValue, propertyName) => (calls) => TemporalHelpers.toPrimitiveObserver(calls, primitiveValue, propertyName); const tests = [ diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-propertybag-calendar-wrong-type.js index e55cb3cee8..9b37beb412 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/equals/argument-propertybag-calendar-wrong-type.js @@ -9,7 +9,7 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.PlainYearMonth(2000, 5); const primitiveTests = [ diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/equals/compare-reference-day.js b/test/built-ins/Temporal/PlainYearMonth/prototype/equals/compare-reference-day.js index 3c40f5031e..8cf550fa4b 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/equals/compare-reference-day.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/equals/compare-reference-day.js @@ -7,7 +7,6 @@ description: equals() takes the reference day into account features: [Temporal] ---*/ -const iso = Temporal.Calendar.from("iso8601"); -const ym1 = new Temporal.PlainYearMonth(2000, 1, iso, 1); -const ym2 = new Temporal.PlainYearMonth(2000, 1, iso, 2); +const ym1 = new Temporal.PlainYearMonth(2000, 1, "iso8601", 1); +const ym2 = new Temporal.PlainYearMonth(2000, 1, "iso8601", 2); assert.sameValue(ym1.equals(ym2), false); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-wrong-type.js index 1368ad4ebd..4ed5d1450d 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/since/argument-propertybag-calendar-wrong-type.js @@ -9,7 +9,6 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); const instance = new Temporal.PlainYearMonth(2000, 5); const primitiveTests = [ diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-wrong-type.js index e26fb72820..f83308449a 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/until/argument-propertybag-calendar-wrong-type.js @@ -9,7 +9,7 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.PlainYearMonth(2000, 5); const primitiveTests = [ diff --git a/test/built-ins/Temporal/PlainYearMonth/refisoday-undefined.js b/test/built-ins/Temporal/PlainYearMonth/refisoday-undefined.js index 95496c7764..3172cdb86f 100644 --- a/test/built-ins/Temporal/PlainYearMonth/refisoday-undefined.js +++ b/test/built-ins/Temporal/PlainYearMonth/refisoday-undefined.js @@ -7,8 +7,7 @@ description: referenceISODay argument defaults to 1 if not given features: [Temporal] ---*/ -const calendar = new Temporal.Calendar("iso8601"); -const args = [2000, 5, calendar]; +const args = [2000, 5]; const dateExplicit = new Temporal.PlainYearMonth(...args, undefined); assert.sameValue(dateExplicit.getISOFields().isoDay, 1, "default referenceISODay is 1"); diff --git a/test/built-ins/Temporal/ZonedDateTime/calendar-undefined.js b/test/built-ins/Temporal/ZonedDateTime/calendar-undefined.js index 0de531db8a..6851efd813 100644 --- a/test/built-ins/Temporal/ZonedDateTime/calendar-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/calendar-undefined.js @@ -7,13 +7,13 @@ description: Calendar argument defaults to the built-in ISO 8601 calendar features: [BigInt, Temporal] ---*/ -const args = [957270896987654321n, new Temporal.TimeZone("UTC")]; Object.defineProperty(Temporal.Calendar, "from", { get() { throw new Test262Error("Should not get Calendar.from"); }, }); +const args = [957270896987654321n, "UTC"]; const explicit = new Temporal.ZonedDateTime(...args, undefined); assert.sameValue(explicit.getISOFields().calendar, "iso8601", "calendar slot should store a string"); diff --git a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-case-insensitive.js index ca19916005..5642ae718a 100644 --- a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-case-insensitive.js @@ -7,7 +7,7 @@ description: The calendar name is case-insensitive features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const datetime = new Temporal.ZonedDateTime(0n, timeZone); const arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar: "IsO8601" }; diff --git a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-leap-second.js b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-leap-second.js index 0bf607c323..a9671e128a 100644 --- a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-leap-second.js +++ b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-leap-second.js @@ -7,7 +7,7 @@ description: Leap second is a valid ISO string for a calendar in a property bag features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const datetime = new Temporal.ZonedDateTime(217_123_200_000_000_000n, timeZone); const calendar = "2016-12-31T23:59:60+00:00[UTC]"; diff --git a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-number.js b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-number.js index e01d722949..c681c39c30 100644 --- a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-number.js +++ b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-number.js @@ -7,7 +7,7 @@ description: A number as calendar in a property bag is not accepted features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const datetime = new Temporal.ZonedDateTime(0n, timeZone); const numbers = [ diff --git a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-string.js b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-string.js index d0208d5419..7918945d00 100644 --- a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-string.js @@ -19,7 +19,7 @@ Object.defineProperty(Temporal.Calendar.prototype, "dateFromFields", { const calendar = "iso8601"; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const datetime = new Temporal.ZonedDateTime(0n, timeZone); const arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar }; diff --git a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-wrong-type.js index 3641ce8f63..a7093dae20 100644 --- a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-wrong-type.js @@ -5,11 +5,11 @@ esid: sec-temporal.zoneddatetime.compare description: > Appropriate error thrown when a calendar property from a property bag cannot - be converted to a calendar object or string + be converted to a calendar ID features: [BigInt, Symbol, Temporal] ---*/ -const datetime = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone("UTC")); +const datetime = new Temporal.ZonedDateTime(0n, "UTC"); const primitiveTests = [ [null, "null"], diff --git a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-year-zero.js b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-year-zero.js index 26a1253b18..cb98229a28 100644 --- a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-year-zero.js +++ b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-calendar-year-zero.js @@ -7,7 +7,7 @@ description: Negative zero, as an extended year, is rejected features: [Temporal, arrow-function] ---*/ -const datetime = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone("UTC")); +const datetime = new Temporal.ZonedDateTime(0n, "UTC"); const invalidStrings = [ "-000000-10-31", "-000000-10-31T17:45", diff --git a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-invalid-offset-string.js b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-invalid-offset-string.js index 63baaa1af7..3d16895806 100644 --- a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-invalid-offset-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-invalid-offset-string.js @@ -7,7 +7,7 @@ description: Property bag with offset property is rejected if offset is in the w features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const datetime = new Temporal.ZonedDateTime(1_000_000_000_987_654_321n, timeZone); const badOffsets = [ diff --git a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-offset-not-agreeing-with-timezone.js b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-offset-not-agreeing-with-timezone.js index 79f6346c1f..7dd409de6c 100644 --- a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-offset-not-agreeing-with-timezone.js +++ b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-offset-not-agreeing-with-timezone.js @@ -7,7 +7,7 @@ description: Property bag with offset property is rejected if offset does not ag features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("+01:00"); +const timeZone = "+01:00"; const datetime = new Temporal.ZonedDateTime(0n, timeZone); const properties = { year: 2021, month: 10, day: 28, offset: "-07:00", timeZone }; diff --git a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-string-year-zero.js b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-string-year-zero.js index b5a4de63df..6c9e55b6cd 100644 --- a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-string-year-zero.js +++ b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-string-year-zero.js @@ -7,7 +7,7 @@ description: Negative zero, as an extended year, is rejected features: [Temporal, arrow-function] ---*/ -const datetime = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone("UTC")); +const datetime = new Temporal.ZonedDateTime(0n, "UTC"); const invalidStrings = [ "-000000-10-31T17:45Z", "-000000-10-31T17:45+00:00[UTC]", diff --git a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-string.js b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-string.js index e5f1be57ff..60b84e507c 100644 --- a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-string.js @@ -26,7 +26,7 @@ Object.defineProperty(Temporal.TimeZone.prototype, "getOffsetNanosecondsFor", { }); ["UTC", "+01:30"].forEach((timeZone) => { - const epoch = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone(timeZone)); + const epoch = new Temporal.ZonedDateTime(0n, timeZone); // These should be valid input and not throw Temporal.ZonedDateTime.compare({ year: 2020, month: 5, day: 2, timeZone }, epoch); diff --git a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-wrong-type.js b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-wrong-type.js index 7c6ec7d0ef..78ee6ad600 100644 --- a/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-wrong-type.js +++ b/test/built-ins/Temporal/ZonedDateTime/compare/argument-propertybag-timezone-wrong-type.js @@ -9,7 +9,7 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const datetime = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone("UTC")); +const datetime = new Temporal.ZonedDateTime(0n, "UTC"); const primitiveTests = [ [null, "null"], diff --git a/test/built-ins/Temporal/ZonedDateTime/compare/argument-wrong-type.js b/test/built-ins/Temporal/ZonedDateTime/compare/argument-wrong-type.js index 6e8600fdaf..3cb808a6bb 100644 --- a/test/built-ins/Temporal/ZonedDateTime/compare/argument-wrong-type.js +++ b/test/built-ins/Temporal/ZonedDateTime/compare/argument-wrong-type.js @@ -9,7 +9,7 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const other = new Temporal.ZonedDateTime(0n, timeZone); const primitiveTests = [ diff --git a/test/built-ins/Temporal/ZonedDateTime/compare/leap-second.js b/test/built-ins/Temporal/ZonedDateTime/compare/leap-second.js index cdd1368336..c2783a7396 100644 --- a/test/built-ins/Temporal/ZonedDateTime/compare/leap-second.js +++ b/test/built-ins/Temporal/ZonedDateTime/compare/leap-second.js @@ -7,7 +7,7 @@ description: Leap second is a valid ISO string for ZonedDateTime features: [Temporal] ---*/ -const datetime = new Temporal.ZonedDateTime(1_483_228_799_000_000_000n, new Temporal.TimeZone("UTC")); +const datetime = new Temporal.ZonedDateTime(1_483_228_799_000_000_000n, "UTC"); let arg = "2016-12-31T23:59:60+00:00[UTC]"; const result1 = Temporal.ZonedDateTime.compare(arg, datetime); diff --git a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-case-insensitive.js index 3baa8ff31f..fb3ce13833 100644 --- a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-case-insensitive.js @@ -7,7 +7,7 @@ description: The calendar name is case-insensitive features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar: "IsO8601" }; const result = Temporal.ZonedDateTime.from(arg); assert.sameValue(result.calendarId, "iso8601", "Calendar is case-insensitive"); diff --git a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-iso-string.js b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-iso-string.js index f26955131d..5e2cabddc8 100644 --- a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-iso-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-iso-string.js @@ -17,7 +17,7 @@ for (const calendar of [ "2020-01", "2020-01[u-ca=iso8601]", ]) { - const timeZone = new Temporal.TimeZone("UTC"); + const timeZone = "UTC"; const arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar }; const result = Temporal.ZonedDateTime.from(arg); assert.sameValue(result.calendarId, "iso8601", `Calendar created from string "${calendar}"`); diff --git a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-leap-second.js b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-leap-second.js index 338a162ad5..a31b570f8f 100644 --- a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-leap-second.js +++ b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-leap-second.js @@ -7,7 +7,7 @@ description: Leap second is a valid ISO string for a calendar in a property bag features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const calendar = "2016-12-31T23:59:60+00:00[UTC]"; const arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar }; diff --git a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-number.js b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-number.js index fc9dbcb170..97dc4d646f 100644 --- a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-number.js +++ b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-number.js @@ -6,8 +6,7 @@ esid: sec-temporal.zoneddatetime.from description: A number as calendar in a property bag is not accepted features: [Temporal] ---*/ - -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const numbers = [ 1, diff --git a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-string.js b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-string.js index c9d1b7bddb..d2f252e72d 100644 --- a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-calendar-string.js @@ -9,7 +9,7 @@ features: [Temporal] const calendar = "iso8601"; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar }; const result = Temporal.ZonedDateTime.from(arg); assert.sameValue(result.calendarId, "iso8601", `Calendar created from string "${calendar}"`); diff --git a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-invalid-offset-string.js b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-invalid-offset-string.js index daf623d3b0..9603bda486 100644 --- a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-invalid-offset-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-invalid-offset-string.js @@ -7,7 +7,7 @@ description: Property bag with offset property is rejected if offset is in the w features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const offsetOptions = ['use', 'prefer', 'ignore', 'reject']; diff --git a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-offset-not-agreeing-with-timezone.js b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-offset-not-agreeing-with-timezone.js index 4bce6c887d..4f82b9a08a 100644 --- a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-offset-not-agreeing-with-timezone.js +++ b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-offset-not-agreeing-with-timezone.js @@ -7,7 +7,7 @@ description: Property bag with offset property is rejected if offset does not ag features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("+01:00"); +const timeZone = "+01:00"; const properties = { year: 2021, month: 10, day: 28, offset: "-07:00", timeZone }; assert.throws(RangeError, () => Temporal.ZonedDateTime.from(properties), "offset property not matching time zone is rejected"); diff --git a/test/built-ins/Temporal/ZonedDateTime/from/argument-zoneddatetime.js b/test/built-ins/Temporal/ZonedDateTime/from/argument-zoneddatetime.js index d1452483ce..b8b669175d 100644 --- a/test/built-ins/Temporal/ZonedDateTime/from/argument-zoneddatetime.js +++ b/test/built-ins/Temporal/ZonedDateTime/from/argument-zoneddatetime.js @@ -7,7 +7,7 @@ description: A ZonedDateTime object is copied, not returned directly features: [Temporal] ---*/ -const orig = new Temporal.ZonedDateTime(946684800_000_000_010n, new Temporal.TimeZone("UTC")); +const orig = new Temporal.ZonedDateTime(946684800_000_000_010n, "UTC"); const result = Temporal.ZonedDateTime.from(orig); assert.sameValue(result.epochNanoseconds, 946684800_000_000_010n, "ZonedDateTime is copied"); diff --git a/test/built-ins/Temporal/ZonedDateTime/from/disambiguation-invalid-string.js b/test/built-ins/Temporal/ZonedDateTime/from/disambiguation-invalid-string.js index b9529653e0..31eefbda2e 100644 --- a/test/built-ins/Temporal/ZonedDateTime/from/disambiguation-invalid-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/from/disambiguation-invalid-string.js @@ -24,6 +24,5 @@ features: [Temporal] const datetime = new Temporal.ZonedDateTime(1_000_000_000_987_654_321n, "UTC"); assert.throws(RangeError, () => Temporal.ZonedDateTime.from(datetime, { disambiguation: "other string" })); -const timeZone = new Temporal.TimeZone("UTC"); -const propertyBag = { timeZone, year: 2001, month: 9, day: 9, hour: 1, minute: 46, second: 40, millisecond: 987, microsecond: 654, nanosecond: 321 }; +const propertyBag = { timeZone: "UTC", year: 2001, month: 9, day: 9, hour: 1, minute: 46, second: 40, millisecond: 987, microsecond: 654, nanosecond: 321 }; assert.throws(RangeError, () => Temporal.ZonedDateTime.from(propertyBag, { disambiguation: "other string" })); diff --git a/test/built-ins/Temporal/ZonedDateTime/from/disambiguation-wrong-type.js b/test/built-ins/Temporal/ZonedDateTime/from/disambiguation-wrong-type.js index f997510dc8..842c3afa4e 100644 --- a/test/built-ins/Temporal/ZonedDateTime/from/disambiguation-wrong-type.js +++ b/test/built-ins/Temporal/ZonedDateTime/from/disambiguation-wrong-type.js @@ -28,8 +28,7 @@ TemporalHelpers.checkStringOptionWrongType("disambiguation", "compatible", (result, descr) => assert.sameValue(result.epochNanoseconds, 1_000_000_000_987_654_321n, descr), ); -const timeZone = new Temporal.TimeZone("UTC"); -const propertyBag = { timeZone, year: 2001, month: 9, day: 9, hour: 1, minute: 46, second: 40, millisecond: 987, microsecond: 654, nanosecond: 321 }; +const propertyBag = { timeZone: "UTC", year: 2001, month: 9, day: 9, hour: 1, minute: 46, second: 40, millisecond: 987, microsecond: 654, nanosecond: 321 }; TemporalHelpers.checkStringOptionWrongType("disambiguation", "compatible", (disambiguation) => Temporal.ZonedDateTime.from(propertyBag, { disambiguation }), (result, descr) => assert.sameValue(result.epochNanoseconds, 1_000_000_000_987_654_321n, descr), diff --git a/test/built-ins/Temporal/ZonedDateTime/from/offset-invalid-string.js b/test/built-ins/Temporal/ZonedDateTime/from/offset-invalid-string.js index 730cbc0147..588e469f1f 100644 --- a/test/built-ins/Temporal/ZonedDateTime/from/offset-invalid-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/from/offset-invalid-string.js @@ -23,6 +23,5 @@ features: [Temporal] const datetime = new Temporal.ZonedDateTime(1_000_000_000_987_654_321n, "UTC"); assert.throws(RangeError, () => Temporal.ZonedDateTime.from(datetime, { offset: "other string" })); -const timeZone = new Temporal.TimeZone("UTC"); -const propertyBag = { timeZone, year: 2001, month: 9, day: 9, hour: 1, minute: 46, second: 40, millisecond: 987, microsecond: 654, nanosecond: 321 }; +const propertyBag = { timeZone: "UTC", year: 2001, month: 9, day: 9, hour: 1, minute: 46, second: 40, millisecond: 987, microsecond: 654, nanosecond: 321 }; assert.throws(RangeError, () => Temporal.ZonedDateTime.from(propertyBag, { offset: "other string" })); diff --git a/test/built-ins/Temporal/ZonedDateTime/from/offset-undefined.js b/test/built-ins/Temporal/ZonedDateTime/from/offset-undefined.js index 1939303ec0..a3c67e1b52 100644 --- a/test/built-ins/Temporal/ZonedDateTime/from/offset-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/from/offset-undefined.js @@ -20,8 +20,7 @@ info: | features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("-04:00"); -const propertyBag = { timeZone, offset: "+01:00", year: 2020, month: 2, day: 16, hour: 23, minute: 45 }; +const propertyBag = { timeZone: "-04:00", offset: "+01:00", year: 2020, month: 2, day: 16, hour: 23, minute: 45 }; assert.throws(RangeError, () => Temporal.ZonedDateTime.from(propertyBag, { offset: undefined }), "default offset is reject"); // See options-undefined.js for {} diff --git a/test/built-ins/Temporal/ZonedDateTime/from/offset-wrong-type.js b/test/built-ins/Temporal/ZonedDateTime/from/offset-wrong-type.js index 5c5bc1f70c..6c3df817ed 100644 --- a/test/built-ins/Temporal/ZonedDateTime/from/offset-wrong-type.js +++ b/test/built-ins/Temporal/ZonedDateTime/from/offset-wrong-type.js @@ -27,8 +27,7 @@ TemporalHelpers.checkStringOptionWrongType("offset", "reject", (result, descr) => assert.sameValue(result.epochNanoseconds, 1_000_000_000_987_654_321n, descr), ); -const timeZone = new Temporal.TimeZone("UTC"); -const propertyBag = { timeZone, offset: "+00:00", year: 2001, month: 9, day: 9, hour: 1, minute: 46, second: 40, millisecond: 987, microsecond: 654, nanosecond: 321 }; +const propertyBag = { timeZone: "UTC", offset: "+00:00", year: 2001, month: 9, day: 9, hour: 1, minute: 46, second: 40, millisecond: 987, microsecond: 654, nanosecond: 321 }; TemporalHelpers.checkStringOptionWrongType("offset", "reject", (offset) => Temporal.ZonedDateTime.from(propertyBag, { offset }), (result, descr) => assert.sameValue(result.epochNanoseconds, 1_000_000_000_987_654_321n, descr), diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-case-insensitive.js index fe11b2b851..e4b80cb513 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-case-insensitive.js @@ -7,7 +7,7 @@ description: The calendar name is case-insensitive features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar: "IsO8601" }; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-iso-string.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-iso-string.js index 3012fc4a3b..5b754d6a3d 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-iso-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-iso-string.js @@ -7,7 +7,7 @@ description: An ISO 8601 string can be converted to a calendar ID in Calendar features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); for (const calendar of [ diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-leap-second.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-leap-second.js index 43fca0aa85..e1f96d3e0a 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-leap-second.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-leap-second.js @@ -7,7 +7,7 @@ description: Leap second is a valid ISO string for a calendar in a property bag features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const calendar = "2016-12-31T23:59:60+00:00[UTC]"; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-number.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-number.js index 06248b267f..a975129dfb 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-number.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-number.js @@ -7,7 +7,7 @@ description: A number as calendar in a property bag is not accepted features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const numbers = [ diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-string.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-string.js index f9d8641d73..c36e2a675f 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-string.js @@ -7,7 +7,7 @@ description: A calendar ID is valid input for Calendar features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const calendar = "iso8601"; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-wrong-type.js index 794e1d6125..8eddd1de7d 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-wrong-type.js @@ -5,11 +5,11 @@ esid: sec-temporal.zoneddatetime.prototype.equals description: > Appropriate error thrown when a calendar property from a property bag cannot - be converted to a calendar object or string + be converted to a calendar ID features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const primitiveTests = [ diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-year-zero.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-year-zero.js index dd1eae6d6a..c6d9dae35c 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-year-zero.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-calendar-year-zero.js @@ -14,7 +14,7 @@ const invalidStrings = [ "-000000-10-31T17:45+01:00", "-000000-10-31T17:45+00:00[UTC]", ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); invalidStrings.forEach((str) => { const arg = { year: 1976, month: 11, day: 18, calendar: str }; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-invalid-offset-string.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-invalid-offset-string.js index 18538ce5ab..0ca261212f 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-invalid-offset-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-invalid-offset-string.js @@ -7,7 +7,7 @@ description: Property bag with offset property is rejected if offset is in the w features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const badOffsets = [ diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-offset-not-agreeing-with-timezone.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-offset-not-agreeing-with-timezone.js index 2605577967..72bbf07005 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-offset-not-agreeing-with-timezone.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-offset-not-agreeing-with-timezone.js @@ -7,7 +7,7 @@ description: Property bag with offset property is rejected if offset does not ag features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("+01:00"); +const timeZone = "+01:00"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const properties = { year: 2021, month: 10, day: 28, offset: "-07:00", timeZone }; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-timezone-string-leap-second.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-timezone-string-leap-second.js index 4095674ad2..1ce2e31113 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-timezone-string-leap-second.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-timezone-string-leap-second.js @@ -7,7 +7,7 @@ description: Leap second is a valid ISO string for TimeZone features: [Temporal] ---*/ -const instance = new Temporal.ZonedDateTime(1588377600_000_000_000n, new Temporal.TimeZone("UTC")); +const instance = new Temporal.ZonedDateTime(1588377600_000_000_000n, "UTC"); let timeZone = "2016-12-31T23:59:60+00:00[UTC]"; assert(instance.equals({ year: 2020, month: 5, day: 2, timeZone }), "leap second is a valid ISO string for TimeZone"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-timezone-string-year-zero.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-timezone-string-year-zero.js index 54780e6540..c83c6562e8 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-timezone-string-year-zero.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-timezone-string-year-zero.js @@ -11,7 +11,7 @@ const invalidStrings = [ "-000000-10-31T17:45Z", "-000000-10-31T17:45+00:00[UTC]", ]; -const instance = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone("UTC")); +const instance = new Temporal.ZonedDateTime(0n, "UTC"); invalidStrings.forEach((timeZone) => { assert.throws( RangeError, diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-timezone-string.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-timezone-string.js index 57de6c0244..5925d5a045 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-timezone-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-timezone-string.js @@ -25,10 +25,10 @@ Object.defineProperty(Temporal.TimeZone.prototype, "getOffsetNanosecondsFor", { }, }); -const instance1 = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone("UTC")); +const instance1 = new Temporal.ZonedDateTime(0n, "UTC"); assert(instance1.equals({ year: 1970, month: 1, day: 1, timeZone: "UTC" }), "Time zone created from string 'UTC'"); -const instance2 = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone("-01:30")); +const instance2 = new Temporal.ZonedDateTime(0n, "-01:30"); assert(instance2.equals({ year: 1969, month: 12, day: 31, hour: 22, minute: 30, timeZone: "-01:30" }), "Time zone created from string '-01:30'"); Object.defineProperty(Temporal.TimeZone.prototype, "getPossibleInstantsFor", getPossibleInstantsForOriginal); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-timezone-wrong-type.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-timezone-wrong-type.js index 5f8aa22f5e..494a7414b7 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-timezone-wrong-type.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-propertybag-timezone-wrong-type.js @@ -5,11 +5,11 @@ esid: sec-temporal.zoneddatetime.prototype.equals description: > Appropriate error thrown when argument cannot be converted to a valid string - or object for TimeZone + for time zone features: [BigInt, Symbol, Temporal] ---*/ -const instance = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone("UTC")); +const instance = new Temporal.ZonedDateTime(0n, "UTC"); const primitiveTests = [ [null, "null"], diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-calendar-annotation.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-calendar-annotation.js index 72352bbc3b..c724776955 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-calendar-annotation.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-calendar-annotation.js @@ -13,8 +13,7 @@ const tests = [ ["1970-01-01T00:00[UTC][u-ca=iso8601][u-ca=discord]", "second annotation ignored"], ]; -const timeZone = new Temporal.TimeZone("UTC"); -const instance = new Temporal.ZonedDateTime(0n, timeZone); +const instance = new Temporal.ZonedDateTime(0n, "UTC"); tests.forEach(([arg, description]) => { const result = instance.equals(arg); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-critical-unknown-annotation.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-critical-unknown-annotation.js index c1fcd5403a..08e2e68651 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-critical-unknown-annotation.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-critical-unknown-annotation.js @@ -13,8 +13,7 @@ const invalidStrings = [ "1970-01-01T00:00[UTC][u-ca=iso8601][!foo=bar]", "1970-01-01T00:00[foo=bar][!_foo-bar0=Dont-Ignore-This-99999999999]", ]; -const timeZone = new Temporal.TimeZone("UTC"); -const instance = new Temporal.ZonedDateTime(0n, timeZone); +const instance = new Temporal.ZonedDateTime(0n, "UTC"); invalidStrings.forEach((arg) => { assert.throws( RangeError, diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-date-with-utc-offset.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-date-with-utc-offset.js index 6892a97105..6062e4df27 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-date-with-utc-offset.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-date-with-utc-offset.js @@ -7,8 +7,7 @@ description: UTC offset not valid with format that does not include a time features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); -const instance = new Temporal.ZonedDateTime(0n, timeZone); +const instance = new Temporal.ZonedDateTime(0n, "UTC"); const validStrings = [ "1970-01-01T00Z[UTC]", diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-multiple-calendar.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-multiple-calendar.js index 7627303897..2826b7f24a 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-multiple-calendar.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-multiple-calendar.js @@ -14,8 +14,7 @@ const invalidStrings = [ "1970-01-01T00:00[UTC][!u-ca=iso8601][u-ca=iso8601]", "1970-01-01T00:00[UTC][u-ca=iso8601][foo=bar][!u-ca=iso8601]", ]; -const timeZone = new Temporal.TimeZone("UTC"); -const instance = new Temporal.ZonedDateTime(0n, timeZone); +const instance = new Temporal.ZonedDateTime(0n, "UTC"); invalidStrings.forEach((arg) => { assert.throws( RangeError, diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-multiple-time-zone.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-multiple-time-zone.js index 642bb280c2..b33bf53fd1 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-multiple-time-zone.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-multiple-time-zone.js @@ -14,8 +14,7 @@ const invalidStrings = [ "1970-01-01T00:00[UTC][u-ca=iso8601][UTC]", "1970-01-01T00:00[UTC][foo=bar][UTC]", ]; -const timeZone = new Temporal.TimeZone("UTC"); -const instance = new Temporal.ZonedDateTime(0n, timeZone); +const instance = new Temporal.ZonedDateTime(0n, "UTC"); invalidStrings.forEach((arg) => { assert.throws( RangeError, diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-time-separators.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-time-separators.js index 3c5f4f802a..fc8d5a4032 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-time-separators.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-time-separators.js @@ -13,8 +13,7 @@ const tests = [ ["1970-01-01 00:00+00:00[UTC]", "space between date and time"], ]; -const timeZone = new Temporal.TimeZone("UTC"); -const instance = new Temporal.ZonedDateTime(0n, timeZone); +const instance = new Temporal.ZonedDateTime(0n, "UTC"); tests.forEach(([arg, description]) => { const result = instance.equals(arg); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-time-zone-annotation.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-time-zone-annotation.js index 3de8846476..871fae193c 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-time-zone-annotation.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-time-zone-annotation.js @@ -23,8 +23,7 @@ const tests = [ ]; tests.forEach(([arg, expectedZone, description]) => { - const timeZone = new Temporal.TimeZone(expectedZone); - const instance = new Temporal.ZonedDateTime(0n, timeZone); + const instance = new Temporal.ZonedDateTime(0n, expectedZone); const result = instance.equals(arg); assert.sameValue( diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-unknown-annotation.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-unknown-annotation.js index eb815b4d71..5b1b95123b 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-unknown-annotation.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-string-unknown-annotation.js @@ -14,8 +14,7 @@ const tests = [ ["1970-01-01T00:00[UTC][foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"], ]; -const timeZone = new Temporal.TimeZone("UTC"); -const instance = new Temporal.ZonedDateTime(0n, timeZone); +const instance = new Temporal.ZonedDateTime(0n, "UTC"); tests.forEach(([arg, description]) => { const result = instance.equals(arg); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-wrong-type.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-wrong-type.js index 4cf570fd74..e3170621ff 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-wrong-type.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/argument-wrong-type.js @@ -9,7 +9,7 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const primitiveTests = [ diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/branding.js index 3d135a3d38..aad00b4013 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/branding.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/branding.js @@ -11,7 +11,7 @@ const equals = Temporal.ZonedDateTime.prototype.equals; assert.sameValue(typeof equals, "function"); -const args = [new Temporal.ZonedDateTime(123456n, new Temporal.TimeZone("UTC"))]; +const args = [new Temporal.ZonedDateTime(123456n, "UTC")]; assert.throws(TypeError, () => equals.apply(undefined, args), "undefined"); assert.throws(TypeError, () => equals.apply(null, args), "null"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/leap-second.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/leap-second.js index cc57129d4e..2363650929 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/leap-second.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/leap-second.js @@ -7,7 +7,7 @@ description: Leap second is a valid ISO string for ZonedDateTime features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(1_483_228_799_000_000_000n, timeZone); let arg = "2016-12-31T23:59:60+00:00[UTC]"; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/year-zero.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/year-zero.js index 3e87ae8893..6fd3a52368 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/year-zero.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/year-zero.js @@ -12,8 +12,7 @@ const invalidStrings = [ "-0000000-01-01T00:02+00:00[UTC]", "-0000000-01-01T00:02:00.000000000+00:00[UTC]", ]; -const timeZone = new Temporal.TimeZone("UTC"); -const instance = new Temporal.ZonedDateTime(0n, timeZone); +const instance = new Temporal.ZonedDateTime(0n, "UTC"); invalidStrings.forEach((arg) => { assert.throws( RangeError, diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/zoneddatetime-string-multiple-offsets.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/zoneddatetime-string-multiple-offsets.js index 72686fb969..f0044989a0 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/zoneddatetime-string-multiple-offsets.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/zoneddatetime-string-multiple-offsets.js @@ -7,7 +7,7 @@ description: Sub-minute offset trailing zeroes allowed in ISO string but not in features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("+01:35"); +const timeZone = "+01:35"; const instance = new Temporal.ZonedDateTime(0n, timeZone); let str = "1970-01-01T01:35:30+01:35:00.000000000[+01:35]"; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/zoneddatetime-string.js b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/zoneddatetime-string.js index 68202ab8b8..9a7e7f4f96 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/equals/zoneddatetime-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/equals/zoneddatetime-string.js @@ -7,7 +7,7 @@ description: Conversion of ISO date-time strings to Temporal.ZonedDateTime insta features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("+01:00"); +const timeZone = "+01:00"; const instance = new Temporal.ZonedDateTime(0n, timeZone); let str = "1970-01-01T00:00"; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/negative-epochnanoseconds.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/negative-epochnanoseconds.js index 7a4350cecc..93a14d3483 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/negative-epochnanoseconds.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/negative-epochnanoseconds.js @@ -13,16 +13,14 @@ features: [Temporal] includes: [deepEqual.js] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); -const calendar = new Temporal.Calendar("iso8601"); -const datetime = new Temporal.ZonedDateTime(-13849764_999_999_999n, timeZone, calendar); +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, + calendar: "iso8601", isoDay: 24, isoHour: 16, isoMicrosecond: 0, @@ -33,5 +31,5 @@ assert.deepEqual(result, { isoSecond: 35, isoYear: 1969, offset: "+00:00", - timeZone, + timeZone: "UTC" }); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/offset.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/offset.js index 96fa20c61f..45924564a7 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/offset.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/getISOFields/offset.js @@ -8,8 +8,7 @@ features: [BigInt, Temporal] ---*/ function test(timeZoneIdentifier, expectedOffsetString, description) { - const timeZone = new Temporal.TimeZone(timeZoneIdentifier); - const datetime = new Temporal.ZonedDateTime(0n, timeZone); + const datetime = new Temporal.ZonedDateTime(0n, timeZoneIdentifier); const fields = datetime.getISOFields(); assert.sameValue(fields.offset, expectedOffsetString, description); } diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/offset/basic.js b/test/built-ins/Temporal/ZonedDateTime/prototype/offset/basic.js index 6c104323ed..16d2ddb3bf 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/offset/basic.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/offset/basic.js @@ -8,8 +8,7 @@ features: [BigInt, Temporal] ---*/ function test(timeZoneIdentifier, expectedOffsetString, description) { - const timeZone = new Temporal.TimeZone(timeZoneIdentifier); - const datetime = new Temporal.ZonedDateTime(0n, timeZone); + const datetime = new Temporal.ZonedDateTime(0n, timeZoneIdentifier); assert.sameValue(datetime.offset, expectedOffsetString, description); } diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-case-insensitive.js index bc37379656..c9ff89c434 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-case-insensitive.js @@ -8,7 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar: "IsO8601" }; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-iso-string.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-iso-string.js index 8d6e9b9e09..57cd4b962e 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-iso-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-iso-string.js @@ -8,7 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); for (const calendar of [ diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-leap-second.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-leap-second.js index c2c39d97de..3b428fc2ac 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-leap-second.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-leap-second.js @@ -8,7 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const calendar = "2016-12-31T23:59:60+00:00[UTC]"; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-number.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-number.js index 7b318fbf4d..49ce7c5ad9 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-number.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-number.js @@ -7,7 +7,7 @@ description: A number as calendar in a property bag is not accepted features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const numbers = [ diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-string.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-string.js index ba81bd841d..bf1138e0b1 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-string.js @@ -8,7 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const calendar = "iso8601"; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-wrong-type.js index 7b9aa6dccf..b07b2a3880 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-wrong-type.js @@ -9,7 +9,7 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const primitiveTests = [ diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-year-zero.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-year-zero.js index 5c294a5373..d6ea39cb34 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-year-zero.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-calendar-year-zero.js @@ -14,7 +14,7 @@ const invalidStrings = [ "-000000-10-31T17:45+01:00", "-000000-10-31T17:45+00:00[UTC]", ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); invalidStrings.forEach((str) => { const arg = { year: 1976, month: 11, day: 18, calendar: str }; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-invalid-offset-string.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-invalid-offset-string.js index 8aa2efceb5..5ac866e413 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-invalid-offset-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-invalid-offset-string.js @@ -7,7 +7,7 @@ description: Property bag with offset property is rejected if offset is in the w features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const badOffsets = [ diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-offset-not-agreeing-with-timezone.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-offset-not-agreeing-with-timezone.js index e7c2b3fe33..97b1b07cef 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-offset-not-agreeing-with-timezone.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-offset-not-agreeing-with-timezone.js @@ -7,7 +7,7 @@ description: Property bag with offset property is rejected if offset does not ag features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("+01:00"); +const timeZone = "+01:00"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const properties = { year: 2021, month: 10, day: 28, offset: "-07:00", timeZone }; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-timezone-string-year-zero.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-timezone-string-year-zero.js index 27e043ae0e..4f2dce8ab4 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-timezone-string-year-zero.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-timezone-string-year-zero.js @@ -11,7 +11,7 @@ const invalidStrings = [ "-000000-10-31T17:45Z", "-000000-10-31T17:45+00:00[UTC]", ]; -const instance = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone("UTC")); +const instance = new Temporal.ZonedDateTime(0n, "UTC"); invalidStrings.forEach((timeZone) => { assert.throws( RangeError, diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-timezone-wrong-type.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-timezone-wrong-type.js index 5278a935d7..ae7a2324f8 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-timezone-wrong-type.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-propertybag-timezone-wrong-type.js @@ -9,7 +9,7 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const instance = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone("UTC")); +const instance = new Temporal.ZonedDateTime(0n, "UTC"); const primitiveTests = [ [null, "null"], diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-calendar-annotation-invalid-key.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-calendar-annotation-invalid-key.js index c1705471d4..444b8c473a 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-calendar-annotation-invalid-key.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-calendar-annotation-invalid-key.js @@ -12,7 +12,7 @@ const invalidStrings = [ ["1970-01-01T00:00[UTC][u-CA=iso8601]", "invalid partially-capitalized key"], ["1970-01-01T00:00[UTC][FOO=bar]", "invalid capitalized unrecognized key"], ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); invalidStrings.forEach(([arg, descr]) => { assert.throws( diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-calendar-annotation.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-calendar-annotation.js index 575382d8ed..e86d3f5b5e 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-calendar-annotation.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-calendar-annotation.js @@ -14,7 +14,7 @@ const tests = [ ["1970-01-01T00:00[UTC][u-ca=iso8601][u-ca=discord]", "second annotation ignored"], ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); tests.forEach(([arg, description]) => { diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-critical-unknown-annotation.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-critical-unknown-annotation.js index b7b184ddd0..32d1c29a59 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-critical-unknown-annotation.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-critical-unknown-annotation.js @@ -13,7 +13,7 @@ const invalidStrings = [ "1970-01-01T00:00[UTC][u-ca=iso8601][!foo=bar]", "1970-01-01T00:00[foo=bar][!_foo-bar0=Dont-Ignore-This-99999999999]", ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); invalidStrings.forEach((arg) => { assert.throws( diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-date-with-utc-offset.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-date-with-utc-offset.js index 6ceb051eb3..f1dfa246d0 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-date-with-utc-offset.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-date-with-utc-offset.js @@ -8,7 +8,7 @@ features: [Temporal] includes: [temporalHelpers.js] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const validStrings = [ diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-multiple-calendar.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-multiple-calendar.js index 4e6737e183..4154f1e92d 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-multiple-calendar.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-multiple-calendar.js @@ -14,7 +14,7 @@ const invalidStrings = [ "1970-01-01T00:00[UTC][!u-ca=iso8601][u-ca=iso8601]", "1970-01-01T00:00[UTC][u-ca=iso8601][foo=bar][!u-ca=iso8601]", ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); invalidStrings.forEach((arg) => { assert.throws( diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-multiple-time-zone.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-multiple-time-zone.js index c5c328d3c6..c98ac91db8 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-multiple-time-zone.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-multiple-time-zone.js @@ -14,7 +14,7 @@ const invalidStrings = [ "1970-01-01T00:00[UTC][u-ca=iso8601][UTC]", "1970-01-01T00:00[UTC][foo=bar][UTC]", ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); invalidStrings.forEach((arg) => { assert.throws( diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-time-separators.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-time-separators.js index 1e5915d4ec..81560e5ae6 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-time-separators.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-time-separators.js @@ -14,7 +14,7 @@ const tests = [ ["1970-01-01 00:00+00:00[UTC]", "space between date and time"], ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); tests.forEach(([arg, description]) => { diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-time-zone-annotation.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-time-zone-annotation.js index cdf5de9ff5..ac780489ca 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-time-zone-annotation.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-time-zone-annotation.js @@ -23,7 +23,7 @@ const tests = [ ["1970-01-01T00:00+00:00[!+00:00]", "numeric, with offset and !"], ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); tests.forEach(([arg, description]) => { diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-unknown-annotation.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-unknown-annotation.js index 8e3b643be9..b42a0960d9 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-unknown-annotation.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-string-unknown-annotation.js @@ -15,7 +15,7 @@ const tests = [ ["1970-01-01T00:00[UTC][foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"], ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); tests.forEach(([arg, description]) => { diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-wrong-type.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-wrong-type.js index 65793e8dec..253d4a1a11 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-wrong-type.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/argument-wrong-type.js @@ -9,7 +9,7 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const primitiveTests = [ diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/balance-negative-time-units.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/balance-negative-time-units.js index 801b00cd19..bface19af8 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/balance-negative-time-units.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/balance-negative-time-units.js @@ -30,7 +30,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const datetime = new Temporal.ZonedDateTime(830998861_001_001_001n, timeZone); const options = { largestUnit: "days" }; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/branding.js index 5695e13f2e..4c1efdf444 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/branding.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/branding.js @@ -11,7 +11,7 @@ const since = Temporal.ZonedDateTime.prototype.since; assert.sameValue(typeof since, "function"); -const args = [new Temporal.ZonedDateTime(123456n, new Temporal.TimeZone("UTC"))]; +const args = [new Temporal.ZonedDateTime(123456n, "UTC")]; assert.throws(TypeError, () => since.apply(undefined, args), "undefined"); assert.throws(TypeError, () => since.apply(null, args), "null"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/leap-second.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/leap-second.js index e3611500bb..cc1e4ec3b7 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/leap-second.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/leap-second.js @@ -8,7 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(1_483_228_799_000_000_000n, timeZone); let arg = "2016-12-31T23:59:60+00:00[UTC]"; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/year-zero.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/year-zero.js index a33e732fba..0d246a0732 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/year-zero.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/year-zero.js @@ -12,7 +12,7 @@ const invalidStrings = [ "-0000000-01-01T00:02+00:00[UTC]", "-0000000-01-01T00:02:00.000000000+00:00[UTC]", ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); invalidStrings.forEach((arg) => { assert.throws( diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/zoneddatetime-string-multiple-offsets.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/zoneddatetime-string-multiple-offsets.js index d973fd768c..54388a33a6 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/zoneddatetime-string-multiple-offsets.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/zoneddatetime-string-multiple-offsets.js @@ -8,7 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("+01:35"); +const timeZone = "+01:35"; const instance = new Temporal.ZonedDateTime(0n, timeZone); let str = "1970-01-01T01:35:30+01:35:00.000000000[+01:35]"; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/zoneddatetime-string.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/zoneddatetime-string.js index 6d641e291a..6886504ad9 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/zoneddatetime-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/zoneddatetime-string.js @@ -8,7 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); let str = "1970-01-01T00:00"; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/toJSON/offset.js b/test/built-ins/Temporal/ZonedDateTime/prototype/toJSON/offset.js index e3246b9946..36d1f8a47b 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/toJSON/offset.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/toJSON/offset.js @@ -8,8 +8,7 @@ features: [BigInt, Temporal] ---*/ function test(timeZoneIdentifier, expected, description) { - const timeZone = new Temporal.TimeZone(timeZoneIdentifier); - const datetime = new Temporal.ZonedDateTime(0n, timeZone); + const datetime = new Temporal.ZonedDateTime(0n, timeZoneIdentifier); assert.sameValue(datetime.toJSON(), expected, description); } diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/toJSON/year-format.js b/test/built-ins/Temporal/ZonedDateTime/prototype/toJSON/year-format.js index d532f99c4a..64bdf8d41d 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/toJSON/year-format.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/toJSON/year-format.js @@ -13,43 +13,41 @@ function epochNsInYear(year) { return (year - 1970n) * avgNsPerYear + (avgNsPerYear / 2n); } -const utc = new Temporal.TimeZone("UTC"); - -let instance = new Temporal.ZonedDateTime(epochNsInYear(-100000n), utc); +let instance = new Temporal.ZonedDateTime(epochNsInYear(-100000n), "UTC"); assert.sameValue(instance.toJSON(), "-100000-07-01T21:30:36+00:00[UTC]", "large negative year formatted as 6-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(-10000n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(-10000n), "UTC"); assert.sameValue(instance.toJSON(), "-010000-07-01T21:30:36+00:00[UTC]", "smallest 5-digit negative year formatted as 6-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(-9999n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(-9999n), "UTC"); assert.sameValue(instance.toJSON(), "-009999-07-02T03:19:48+00:00[UTC]", "largest 4-digit negative year formatted as 6-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(-1000n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(-1000n), "UTC"); assert.sameValue(instance.toJSON(), "-001000-07-02T09:30:36+00:00[UTC]", "smallest 4-digit negative year formatted as 6-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(-999n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(-999n), "UTC"); assert.sameValue(instance.toJSON(), "-000999-07-02T15:19:48+00:00[UTC]", "largest 3-digit negative year formatted as 6-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(-1n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(-1n), "UTC"); assert.sameValue(instance.toJSON(), "-000001-07-02T15:41:24+00:00[UTC]", "year -1 formatted as 6-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(0n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(0n), "UTC"); assert.sameValue(instance.toJSON(), "0000-07-01T21:30:36+00:00[UTC]", "year 0 formatted as 4-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(1n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(1n), "UTC"); assert.sameValue(instance.toJSON(), "0001-07-02T03:19:48+00:00[UTC]", "year 1 formatted as 4-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(999n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(999n), "UTC"); assert.sameValue(instance.toJSON(), "0999-07-02T03:41:24+00:00[UTC]", "largest 3-digit positive year formatted as 4-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(1000n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(1000n), "UTC"); assert.sameValue(instance.toJSON(), "1000-07-02T09:30:36+00:00[UTC]", "smallest 4-digit positive year formatted as 4-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(9999n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(9999n), "UTC"); assert.sameValue(instance.toJSON(), "9999-07-02T15:41:24+00:00[UTC]", "largest 4-digit positive year formatted as 4-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(10000n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(10000n), "UTC"); assert.sameValue(instance.toJSON(), "+010000-07-01T21:30:36+00:00[UTC]", "smallest 5-digit positive year formatted as 6-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(100000n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(100000n), "UTC"); assert.sameValue(instance.toJSON(), "+100000-07-01T21:30:36+00:00[UTC]", "large positive year formatted as 6-digit"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/toString/offset.js b/test/built-ins/Temporal/ZonedDateTime/prototype/toString/offset.js index 5ff25b6c71..69905f17c6 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/toString/offset.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/toString/offset.js @@ -8,8 +8,7 @@ features: [BigInt, Temporal] ---*/ function test(timeZoneIdentifier, expected, description) { - const timeZone = new Temporal.TimeZone(timeZoneIdentifier); - const datetime = new Temporal.ZonedDateTime(0n, timeZone); + const datetime = new Temporal.ZonedDateTime(0n, timeZoneIdentifier); assert.sameValue(datetime.toString(), expected, description); } diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/toString/year-format.js b/test/built-ins/Temporal/ZonedDateTime/prototype/toString/year-format.js index 1532bf1fec..7b4e51ac5a 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/toString/year-format.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/toString/year-format.js @@ -13,43 +13,41 @@ function epochNsInYear(year) { return (year - 1970n) * avgNsPerYear + (avgNsPerYear / 2n); } -const utc = new Temporal.TimeZone("UTC"); - -let instance = new Temporal.ZonedDateTime(epochNsInYear(-100000n), utc); +let instance = new Temporal.ZonedDateTime(epochNsInYear(-100000n), "UTC"); assert.sameValue(instance.toString(), "-100000-07-01T21:30:36+00:00[UTC]", "large negative year formatted as 6-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(-10000n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(-10000n), "UTC"); assert.sameValue(instance.toString(), "-010000-07-01T21:30:36+00:00[UTC]", "smallest 5-digit negative year formatted as 6-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(-9999n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(-9999n), "UTC"); assert.sameValue(instance.toString(), "-009999-07-02T03:19:48+00:00[UTC]", "largest 4-digit negative year formatted as 6-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(-1000n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(-1000n), "UTC"); assert.sameValue(instance.toString(), "-001000-07-02T09:30:36+00:00[UTC]", "smallest 4-digit negative year formatted as 6-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(-999n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(-999n), "UTC"); assert.sameValue(instance.toString(), "-000999-07-02T15:19:48+00:00[UTC]", "largest 3-digit negative year formatted as 6-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(-1n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(-1n), "UTC"); assert.sameValue(instance.toString(), "-000001-07-02T15:41:24+00:00[UTC]", "year -1 formatted as 6-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(0n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(0n), "UTC"); assert.sameValue(instance.toString(), "0000-07-01T21:30:36+00:00[UTC]", "year 0 formatted as 4-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(1n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(1n), "UTC"); assert.sameValue(instance.toString(), "0001-07-02T03:19:48+00:00[UTC]", "year 1 formatted as 4-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(999n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(999n), "UTC"); assert.sameValue(instance.toString(), "0999-07-02T03:41:24+00:00[UTC]", "largest 3-digit positive year formatted as 4-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(1000n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(1000n), "UTC"); assert.sameValue(instance.toString(), "1000-07-02T09:30:36+00:00[UTC]", "smallest 4-digit positive year formatted as 4-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(9999n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(9999n), "UTC"); assert.sameValue(instance.toString(), "9999-07-02T15:41:24+00:00[UTC]", "largest 4-digit positive year formatted as 4-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(10000n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(10000n), "UTC"); assert.sameValue(instance.toString(), "+010000-07-01T21:30:36+00:00[UTC]", "smallest 5-digit positive year formatted as 6-digit"); -instance = new Temporal.ZonedDateTime(epochNsInYear(100000n), utc); +instance = new Temporal.ZonedDateTime(epochNsInYear(100000n), "UTC"); assert.sameValue(instance.toString(), "+100000-07-01T21:30:36+00:00[UTC]", "large positive year formatted as 6-digit"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-case-insensitive.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-case-insensitive.js index 1dd8006d86..0ca4690f92 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-case-insensitive.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-case-insensitive.js @@ -8,7 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar: "IsO8601" }; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-iso-string.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-iso-string.js index b3dac55ef3..4b16970970 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-iso-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-iso-string.js @@ -8,7 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); for (const calendar of [ diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-leap-second.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-leap-second.js index 3d98103d93..2330baf215 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-leap-second.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-leap-second.js @@ -8,7 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const calendar = "2016-12-31T23:59:60+00:00[UTC]"; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-number.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-number.js index c3e14bef3f..c3a0450817 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-number.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-number.js @@ -7,7 +7,7 @@ description: A number as calendar in a property bag is not accepted features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const numbers = [ diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-string.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-string.js index 792f99d3e2..2236448ccf 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-string.js @@ -8,7 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const calendar = "iso8601"; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-wrong-type.js index fea32897da..7e61e42a92 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-wrong-type.js @@ -5,11 +5,11 @@ esid: sec-temporal.zoneddatetime.prototype.until description: > Appropriate error thrown when a calendar property from a property bag cannot - be converted to a calendar object or string + be converted to a calendar ID features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const primitiveTests = [ diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-year-zero.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-year-zero.js index be524e3ecb..34a8809268 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-year-zero.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-calendar-year-zero.js @@ -14,7 +14,7 @@ const invalidStrings = [ "-000000-10-31T17:45+01:00", "-000000-10-31T17:45+00:00[UTC]", ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); invalidStrings.forEach((str) => { const arg = { year: 1976, month: 11, day: 18, calendar: str }; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-invalid-offset-string.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-invalid-offset-string.js index 65c1091f9b..09a001384a 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-invalid-offset-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-invalid-offset-string.js @@ -7,7 +7,7 @@ description: Property bag with offset property is rejected if offset is in the w features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const badOffsets = [ diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-offset-not-agreeing-with-timezone.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-offset-not-agreeing-with-timezone.js index 1895808b8c..692451011d 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-offset-not-agreeing-with-timezone.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-offset-not-agreeing-with-timezone.js @@ -7,7 +7,7 @@ description: Property bag with offset property is rejected if offset does not ag features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("+01:00"); +const timeZone = "+01:00"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const properties = { year: 2021, month: 10, day: 28, offset: "-07:00", timeZone }; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-timezone-string-year-zero.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-timezone-string-year-zero.js index 3e01e23583..90604c9d5b 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-timezone-string-year-zero.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-timezone-string-year-zero.js @@ -11,7 +11,7 @@ const invalidStrings = [ "-000000-10-31T17:45Z", "-000000-10-31T17:45+00:00[UTC]", ]; -const instance = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone("UTC")); +const instance = new Temporal.ZonedDateTime(0n, "UTC"); invalidStrings.forEach((timeZone) => { assert.throws( RangeError, diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-timezone-string.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-timezone-string.js index 3e6f906f49..2e49c2d59e 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-timezone-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-timezone-string.js @@ -25,10 +25,10 @@ Object.defineProperty(Temporal.TimeZone.prototype, "getOffsetNanosecondsFor", { }, }); -const instance1 = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone("UTC")); +const instance1 = new Temporal.ZonedDateTime(0n, "UTC"); assert(instance1.until({ year: 1970, month: 1, day: 1, timeZone: "UTC" }).blank, "Time zone created from string 'UTC'"); -const instance2 = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone("-01:30")); +const instance2 = new Temporal.ZonedDateTime(0n, "-01:30"); assert(instance2.until({ year: 1969, month: 12, day: 31, hour: 22, minute: 30, timeZone: "-01:30" }).blank, "Time zone created from string '-01:30'"); Object.defineProperty(Temporal.TimeZone.prototype, "getPossibleInstantsFor", getPossibleInstantsForOriginal); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-timezone-wrong-type.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-timezone-wrong-type.js index 479d405086..31db013f80 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-timezone-wrong-type.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-propertybag-timezone-wrong-type.js @@ -5,11 +5,11 @@ esid: sec-temporal.zoneddatetime.prototype.until description: > Appropriate error thrown when argument cannot be converted to a valid string - or object for TimeZone + for time zone features: [BigInt, Symbol, Temporal] ---*/ -const instance = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone("UTC")); +const instance = new Temporal.ZonedDateTime(0n, "UTC"); const primitiveTests = [ [null, "null"], diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-calendar-annotation-invalid-key.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-calendar-annotation-invalid-key.js index 4375637118..4a71e7829a 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-calendar-annotation-invalid-key.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-calendar-annotation-invalid-key.js @@ -12,7 +12,7 @@ const invalidStrings = [ ["1970-01-01T00:00[UTC][u-CA=iso8601]", "invalid partially-capitalized key"], ["1970-01-01T00:00[UTC][FOO=bar]", "invalid capitalized unrecognized key"], ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); invalidStrings.forEach(([arg, descr]) => { assert.throws( diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-calendar-annotation.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-calendar-annotation.js index 832a57b7c5..8f2fda4fea 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-calendar-annotation.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-calendar-annotation.js @@ -14,7 +14,7 @@ const tests = [ ["1970-01-01T00:00[UTC][u-ca=iso8601][u-ca=discord]", "second annotation ignored"], ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); tests.forEach(([arg, description]) => { diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-critical-unknown-annotation.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-critical-unknown-annotation.js index a29b7bc4c8..4b1fdb5b9c 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-critical-unknown-annotation.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-critical-unknown-annotation.js @@ -13,7 +13,7 @@ const invalidStrings = [ "1970-01-01T00:00[UTC][u-ca=iso8601][!foo=bar]", "1970-01-01T00:00[foo=bar][!_foo-bar0=Dont-Ignore-This-99999999999]", ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); invalidStrings.forEach((arg) => { assert.throws( diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-date-with-utc-offset.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-date-with-utc-offset.js index 5e36bdaf70..2c9709e78f 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-date-with-utc-offset.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-date-with-utc-offset.js @@ -8,7 +8,7 @@ features: [Temporal] includes: [temporalHelpers.js] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const validStrings = [ diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-multiple-calendar.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-multiple-calendar.js index 1d028c5482..e79b2980c1 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-multiple-calendar.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-multiple-calendar.js @@ -14,7 +14,7 @@ const invalidStrings = [ "1970-01-01T00:00[UTC][!u-ca=iso8601][u-ca=iso8601]", "1970-01-01T00:00[UTC][u-ca=iso8601][foo=bar][!u-ca=iso8601]", ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); invalidStrings.forEach((arg) => { assert.throws( diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-multiple-time-zone.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-multiple-time-zone.js index 5a9d0c16bc..b9810322c3 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-multiple-time-zone.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-multiple-time-zone.js @@ -14,7 +14,7 @@ const invalidStrings = [ "1970-01-01T00:00[UTC][u-ca=iso8601][UTC]", "1970-01-01T00:00[UTC][foo=bar][UTC]", ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); invalidStrings.forEach((arg) => { assert.throws( diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-time-separators.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-time-separators.js index 10cf351352..9e4cd13d99 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-time-separators.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-time-separators.js @@ -14,7 +14,7 @@ const tests = [ ["1970-01-01 00:00+00:00[UTC]", "space between date and time"], ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); tests.forEach(([arg, description]) => { diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-time-zone-annotation.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-time-zone-annotation.js index 37ed65f309..8c2a81a2cf 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-time-zone-annotation.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-time-zone-annotation.js @@ -23,7 +23,7 @@ const tests = [ ["1970-01-01T00:00+00:00[!+00:00]", "numeric, with offset and !"], ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); tests.forEach(([arg, description]) => { diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-unknown-annotation.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-unknown-annotation.js index 471ef89415..9b3e67b272 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-unknown-annotation.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-string-unknown-annotation.js @@ -15,7 +15,7 @@ const tests = [ ["1970-01-01T00:00[UTC][foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"], ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); tests.forEach(([arg, description]) => { diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-wrong-type.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-wrong-type.js index 528825459d..d534310635 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-wrong-type.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/argument-wrong-type.js @@ -9,7 +9,7 @@ description: > features: [BigInt, Symbol, Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const primitiveTests = [ diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/balance-negative-time-units.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/balance-negative-time-units.js index 2005406753..376d45f575 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/balance-negative-time-units.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/balance-negative-time-units.js @@ -30,25 +30,24 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); -const datetime = new Temporal.ZonedDateTime(830998861_001_001_001n, timeZone); +const datetime = new Temporal.ZonedDateTime(830998861_001_001_001n, "UTC"); const options = { largestUnit: "days" }; -const result1 = new Temporal.ZonedDateTime(830995200_000_000_002n, timeZone).until(datetime, options); +const result1 = new Temporal.ZonedDateTime(830995200_000_000_002n, "UTC").until(datetime, options); TemporalHelpers.assertDuration(result1, 0, 0, 0, 0, 1, 1, 1, 1, 0, 999, "nanoseconds balance"); -const result2 = new Temporal.ZonedDateTime(830995200_000_002_000n, timeZone).until(datetime, options); +const result2 = new Temporal.ZonedDateTime(830995200_000_002_000n, "UTC").until(datetime, options); TemporalHelpers.assertDuration(result2, 0, 0, 0, 0, 1, 1, 1, 0, 999, 1, "microseconds balance"); -const result3 = new Temporal.ZonedDateTime(830995200_002_000_000n, timeZone).until(datetime, options); +const result3 = new Temporal.ZonedDateTime(830995200_002_000_000n, "UTC").until(datetime, options); TemporalHelpers.assertDuration(result3, 0, 0, 0, 0, 1, 1, 0, 999, 1, 1, "milliseconds balance"); -const result4 = new Temporal.ZonedDateTime(830995202_000_000_000n, timeZone).until(datetime, options); +const result4 = new Temporal.ZonedDateTime(830995202_000_000_000n, "UTC").until(datetime, options); TemporalHelpers.assertDuration(result4, 0, 0, 0, 0, 1, 0, 59, 1, 1, 1, "seconds balance"); -const result5 = new Temporal.ZonedDateTime(830995320_000_000_000n, timeZone).until(datetime, options); +const result5 = new Temporal.ZonedDateTime(830995320_000_000_000n, "UTC").until(datetime, options); TemporalHelpers.assertDuration(result5, 0, 0, 0, 0, 0, 59, 1, 1, 1, 1, "minutes balance"); // This one is different because hours are later balanced again in BalanceDuration -const result6 = new Temporal.ZonedDateTime(831002400_000_000_000n, timeZone).until(datetime, options); +const result6 = new Temporal.ZonedDateTime(831002400_000_000_000n, "UTC").until(datetime, options); TemporalHelpers.assertDuration(result6, 0, 0, 0, 0, 0, -58, -58, -998, -998, -999, "hours balance"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/branding.js index a84b29e76b..e5cc9d8077 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/branding.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/branding.js @@ -11,7 +11,7 @@ const until = Temporal.ZonedDateTime.prototype.until; assert.sameValue(typeof until, "function"); -const args = [new Temporal.ZonedDateTime(123456n, new Temporal.TimeZone("UTC"))]; +const args = [new Temporal.ZonedDateTime(123456n, "UTC")]; assert.throws(TypeError, () => until.apply(undefined, args), "undefined"); assert.throws(TypeError, () => until.apply(null, args), "null"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/leap-second.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/leap-second.js index ffa342eff0..4517b535df 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/leap-second.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/leap-second.js @@ -8,7 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(1_483_228_799_000_000_000n, timeZone); let arg = "2016-12-31T23:59:60+00:00[UTC]"; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/year-zero.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/year-zero.js index fb6e140e22..5fcece628f 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/year-zero.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/year-zero.js @@ -12,7 +12,7 @@ const invalidStrings = [ "-0000000-01-01T00:02+00:00[UTC]", "-0000000-01-01T00:02:00.000000000+00:00[UTC]", ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); invalidStrings.forEach((arg) => { assert.throws( diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/zoneddatetime-string-multiple-offsets.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/zoneddatetime-string-multiple-offsets.js index 6330d8710b..988ade63ce 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/zoneddatetime-string-multiple-offsets.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/zoneddatetime-string-multiple-offsets.js @@ -8,7 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("+01:35"); +const timeZone = "+01:35"; const instance = new Temporal.ZonedDateTime(0n, timeZone); let str = "1970-01-01T01:35:30+01:35:00.000000000[+01:35]"; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/zoneddatetime-string.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/zoneddatetime-string.js index 1cf959aa4e..25e392b676 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/zoneddatetime-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/zoneddatetime-string.js @@ -8,7 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); let str = "1970-01-01T00:00"; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/with/offset-property-invalid-string.js b/test/built-ins/Temporal/ZonedDateTime/prototype/with/offset-property-invalid-string.js index 432a00c595..8d9bdb0f3b 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/with/offset-property-invalid-string.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/with/offset-property-invalid-string.js @@ -7,8 +7,7 @@ description: Property bag with offset property is rejected if offset is in the w features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); -const instance = new Temporal.ZonedDateTime(0n, timeZone); +const instance = new Temporal.ZonedDateTime(0n, "UTC"); const offsetOptions = ['use', 'prefer', 'ignore', 'reject']; diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/with/offset-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/with/offset-undefined.js index f1b6b8423e..0d96c9aacc 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/with/offset-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/with/offset-undefined.js @@ -14,9 +14,7 @@ info: | features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("-03:30"); - -const datetime = new Temporal.ZonedDateTime(1572757201_000_000_000n, timeZone); +const datetime = new Temporal.ZonedDateTime(1572757201_000_000_000n, "-03:30"); const explicit = datetime.with({ minute: 31 }, { offset: undefined }); assert.sameValue(explicit.epochNanoseconds, 1572757261_000_000_000n, "default offset is prefer"); const implicit = datetime.with({ minute: 31 }, {}); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/branding.js index 1533200c97..b68d98bef9 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/branding.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/branding.js @@ -11,7 +11,7 @@ const withCalendar = Temporal.ZonedDateTime.prototype.withCalendar; assert.sameValue(typeof withCalendar, "function"); -const args = [new Temporal.Calendar("iso8601")]; +const args = ["iso8601"]; assert.throws(TypeError, () => withCalendar.apply(undefined, args), "undefined"); assert.throws(TypeError, () => withCalendar.apply(null, args), "null"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-calendar-annotation-invalid-key.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-calendar-annotation-invalid-key.js index 32b59887c0..1ff0de2d06 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-calendar-annotation-invalid-key.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-calendar-annotation-invalid-key.js @@ -18,7 +18,7 @@ const invalidStrings = [ ["T00:00[FOO=bar]", "invalid capitalized unrecognized key, time designator"], ["1970-01-01T00:00[FOO=bar]", "invalid capitalized unrecognized key"], ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); invalidStrings.forEach(([arg, descr]) => { assert.throws( diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-calendar-annotation.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-calendar-annotation.js index fc696e7975..073e2d7ad1 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-calendar-annotation.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-calendar-annotation.js @@ -26,7 +26,7 @@ const tests = [ ["1970-01-01T12:34:56.987654321[u-ca=iso8601][u-ca=discord]", "second annotation ignored"], ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); tests.forEach(([arg, description]) => { diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-critical-unknown-annotation.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-critical-unknown-annotation.js index 3ae28dfd0c..cde62d40c9 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-critical-unknown-annotation.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-critical-unknown-annotation.js @@ -16,7 +16,7 @@ const invalidStrings = [ "1970-01-01T00:00[UTC][!foo=bar][u-ca=iso8601]", "1970-01-01T00:00[foo=bar][!_foo-bar0=Dont-Ignore-This-99999999999]", ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); invalidStrings.forEach((arg) => { assert.throws( diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-date-with-utc-offset.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-date-with-utc-offset.js index d50b266807..07c1e8ebc3 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-date-with-utc-offset.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-date-with-utc-offset.js @@ -7,7 +7,7 @@ description: UTC offset not valid with format that does not include a time features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); const validStrings = [ diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-multiple-calendar.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-multiple-calendar.js index 7b83150ee5..ced0b5925b 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-multiple-calendar.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-multiple-calendar.js @@ -19,7 +19,7 @@ const invalidStrings = [ "1970-01-01T00:00[UTC][u-ca=iso8601][!u-ca=iso8601]", "1970-01-01T00:00[u-ca=iso8601][foo=bar][!u-ca=iso8601]", ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); invalidStrings.forEach((arg) => { assert.throws( diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-multiple-time-zone.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-multiple-time-zone.js index 56a8c76342..5398e4c54e 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-multiple-time-zone.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-multiple-time-zone.js @@ -16,7 +16,7 @@ const invalidStrings = [ "1970-01-01T00:00[UTC][u-ca=iso8601][UTC]", "1970-01-01T00:00[UTC][foo=bar][UTC]", ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); invalidStrings.forEach((arg) => { assert.throws( diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-time-separators.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-time-separators.js index cb37471609..5e492936ae 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-time-separators.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-time-separators.js @@ -15,7 +15,7 @@ const tests = [ ["t12:34:56.987654321", "time-only lowercase T"], ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); tests.forEach(([arg, description]) => { diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-time-zone-annotation.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-time-zone-annotation.js index 08abc6d058..01b10c3f20 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-time-zone-annotation.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-time-zone-annotation.js @@ -34,7 +34,7 @@ const tests = [ ["1970-01-01T12:34:56.987654321+00:00[!-08:00]", "numeric, with date, offset, and !"], ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); tests.forEach(([arg, description]) => { diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-unknown-annotation.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-unknown-annotation.js index f5e4e9395c..7eb4ef2251 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-unknown-annotation.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-string-unknown-annotation.js @@ -23,7 +23,7 @@ const tests = [ ["1970-01-01T12:34:56.987654321[foo=bar][_foo-bar0=Ignore-This-999999999999]", "with another unknown annotation"], ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); tests.forEach(([arg, description]) => { diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-zoneddatetime-balance-negative-time-units.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-zoneddatetime-balance-negative-time-units.js index 8ece6fc605..7101425811 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-zoneddatetime-balance-negative-time-units.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/argument-zoneddatetime-balance-negative-time-units.js @@ -38,8 +38,7 @@ features: [Temporal] const tz = TemporalHelpers.specificOffsetTimeZone(-2); const datetime = new Temporal.ZonedDateTime(3661_001_001_001n, tz); -const otherTimeZone = new Temporal.TimeZone("UTC"); // should not be used to convert datetime -> PlainTime -const zdt = new Temporal.ZonedDateTime(86400_000_000_000n, otherTimeZone); +const zdt = new Temporal.ZonedDateTime(86400_000_000_000n, "UTC"); // UTC should not be used to convert datetime -> PlainTime const newzdt = zdt.withPlainTime(datetime); assert.sameValue(newzdt.microsecond, 0); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/year-zero.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/year-zero.js index f5fa8e920e..baf1f69258 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/year-zero.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withPlainTime/year-zero.js @@ -12,7 +12,7 @@ const invalidStrings = [ "-000000-12-07T03:24:30+01:00", "-000000-12-07T03:24:30+00:00[UTC]", ]; -const timeZone = new Temporal.TimeZone("UTC"); +const timeZone = "UTC"; const instance = new Temporal.ZonedDateTime(0n, timeZone); invalidStrings.forEach((arg) => { assert.throws( diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/branding.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/branding.js index feecfe91b3..f5f3f4a66c 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/branding.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/branding.js @@ -11,7 +11,7 @@ const withTimeZone = Temporal.ZonedDateTime.prototype.withTimeZone; assert.sameValue(typeof withTimeZone, "function"); -const args = [new Temporal.TimeZone("UTC")]; +const args = ["UTC"]; assert.throws(TypeError, () => withTimeZone.apply(undefined, args), "undefined"); assert.throws(TypeError, () => withTimeZone.apply(null, args), "null"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/timezone-string-year-zero.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/timezone-string-year-zero.js index 727174f1b2..63850e353f 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/timezone-string-year-zero.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/timezone-string-year-zero.js @@ -11,7 +11,7 @@ const invalidStrings = [ "-000000-10-31T17:45Z", "-000000-10-31T17:45+00:00[UTC]", ]; -const instance = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone("UTC")); +const instance = new Temporal.ZonedDateTime(0n, "UTC"); invalidStrings.forEach((timeZone) => { assert.throws( RangeError, diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/timezone-wrong-type.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/timezone-wrong-type.js index 2f185583f5..ef042f4e23 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/timezone-wrong-type.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withTimeZone/timezone-wrong-type.js @@ -5,11 +5,11 @@ esid: sec-temporal.zoneddatetime.prototype.withtimezone description: > Appropriate error thrown when argument cannot be converted to a valid string - or object for TimeZone + for time zone features: [BigInt, Symbol, Temporal] ---*/ -const instance = new Temporal.ZonedDateTime(0n, new Temporal.TimeZone("UTC")); +const instance = new Temporal.ZonedDateTime(0n, "UTC"); const primitiveTests = [ [null, "null"], diff --git a/test/intl402/Temporal/Duration/compare/relativeto-sub-minute-offset.js b/test/intl402/Temporal/Duration/compare/relativeto-sub-minute-offset.js index 67e842da79..b7fc245bda 100644 --- a/test/intl402/Temporal/Duration/compare/relativeto-sub-minute-offset.js +++ b/test/intl402/Temporal/Duration/compare/relativeto-sub-minute-offset.js @@ -23,6 +23,5 @@ relativeTo = "1970-01-01T00:00:00-00:44:30[Africa/Monrovia]"; result = action(relativeTo); assert.sameValue(result, 0, "unrounded HH:MM:SS is accepted in string offset"); -const timeZone = Temporal.TimeZone.from("Africa/Monrovia"); -relativeTo = { year: 1970, month: 1, day: 1, offset: "+00:45", timeZone }; +relativeTo = { year: 1970, month: 1, day: 1, offset: "+00:45", timeZone: "Africa/Monrovia" }; assert.throws(RangeError, () => action(relativeTo), "rounded HH:MM not accepted as offset in property bag"); diff --git a/test/intl402/Temporal/Duration/prototype/round/relativeto-sub-minute-offset.js b/test/intl402/Temporal/Duration/prototype/round/relativeto-sub-minute-offset.js index aa0c86ce82..5ffe35e2a3 100644 --- a/test/intl402/Temporal/Duration/prototype/round/relativeto-sub-minute-offset.js +++ b/test/intl402/Temporal/Duration/prototype/round/relativeto-sub-minute-offset.js @@ -34,6 +34,5 @@ TemporalHelpers.assertDateDuration(result, 1, 0, 0, 1, "unrounded HH:MM:SS is ac relativeTo = "1970-01-01T00:00+00:44:30.123456789[+00:45]"; assert.throws(RangeError, () => action(relativeTo), "rounding is not accepted between ISO offset and time zone"); -const timeZone = Temporal.TimeZone.from("Africa/Monrovia"); -relativeTo = { year: 1970, month: 1, day: 1, offset: "+00:45", timeZone }; +relativeTo = { year: 1970, month: 1, day: 1, offset: "+00:45", timeZone: "Africa/Monrovia" }; assert.throws(RangeError, () => action(relativeTo), "rounded HH:MM not accepted as offset in property bag"); diff --git a/test/intl402/Temporal/Duration/prototype/total/relativeto-sub-minute-offset.js b/test/intl402/Temporal/Duration/prototype/total/relativeto-sub-minute-offset.js index a3e664ca31..e878ce90c5 100644 --- a/test/intl402/Temporal/Duration/prototype/total/relativeto-sub-minute-offset.js +++ b/test/intl402/Temporal/Duration/prototype/total/relativeto-sub-minute-offset.js @@ -33,6 +33,5 @@ assert.sameValue(result, 366, "unrounded HH:MM:SS is accepted in string offset") relativeTo = "1970-01-01T00:00+00:44:30.123456789[+00:45]"; assert.throws(RangeError, () => action(relativeTo), "rounding is not accepted between ISO offset and time zone"); -const timeZone = Temporal.TimeZone.from("Africa/Monrovia"); -relativeTo = { year: 1970, month: 1, day: 1, offset: "+00:45", timeZone }; +relativeTo = { year: 1970, month: 1, day: 1, offset: "+00:45", timeZone: "Africa/Monrovia" }; assert.throws(RangeError, () => action(relativeTo), "rounded HH:MM not accepted as offset in property bag"); diff --git a/test/intl402/Temporal/Instant/prototype/toString/timezone-offset.js b/test/intl402/Temporal/Instant/prototype/toString/timezone-offset.js index 7016baa59d..167a21ad16 100644 --- a/test/intl402/Temporal/Instant/prototype/toString/timezone-offset.js +++ b/test/intl402/Temporal/Instant/prototype/toString/timezone-offset.js @@ -9,8 +9,7 @@ features: [BigInt, Temporal] const instant = new Temporal.Instant(0n); -function test(timeZoneIdentifier, expected, description) { - const timeZone = new Temporal.TimeZone(timeZoneIdentifier); +function test(timeZone, expected, description) { assert.sameValue(instant.toString({ timeZone }), expected, description); } diff --git a/test/intl402/Temporal/PlainDate/prototype/weekOfYear/gregory-iso-weekofyear.js b/test/intl402/Temporal/PlainDate/prototype/weekOfYear/gregory-iso-weekofyear.js index 4d02382335..65d04659e4 100644 --- a/test/intl402/Temporal/PlainDate/prototype/weekOfYear/gregory-iso-weekofyear.js +++ b/test/intl402/Temporal/PlainDate/prototype/weekOfYear/gregory-iso-weekofyear.js @@ -16,12 +16,12 @@ features: [Temporal] // -let calendar = new Temporal.Calendar("gregory"); +let calendar = "gregory"; const date = new Temporal.PlainDate(2021, 1, 1, calendar); assert.sameValue(date.weekOfYear, 1); -calendar = new Temporal.Calendar("iso8601"); +calendar = "iso8601"; const isodate = new Temporal.PlainDate(2021, 1, 1, calendar); assert.sameValue(isodate.weekOfYear, 53); diff --git a/test/intl402/Temporal/PlainDate/prototype/weekOfYear/non-iso-week-of-year.js b/test/intl402/Temporal/PlainDate/prototype/weekOfYear/non-iso-week-of-year.js index 86c46b497d..88e9e59314 100644 --- a/test/intl402/Temporal/PlainDate/prototype/weekOfYear/non-iso-week-of-year.js +++ b/test/intl402/Temporal/PlainDate/prototype/weekOfYear/non-iso-week-of-year.js @@ -11,12 +11,12 @@ features: [Temporal] // Gregorian calendar has a well defined week-numbering system. -let calendar = new Temporal.Calendar("gregory"); +let calendar = "gregory"; const date = new Temporal.PlainDate(2024, 1, 1, calendar); assert.sameValue(date.weekOfYear, 1); -calendar = new Temporal.Calendar("hebrew"); +calendar = "hebrew"; const nonisodate = new Temporal.PlainDate(2024, 1, 1, calendar); assert.sameValue(nonisodate.weekOfYear, undefined); diff --git a/test/intl402/Temporal/PlainDate/prototype/yearOfWeek/gregory-iso-weekofyear.js b/test/intl402/Temporal/PlainDate/prototype/yearOfWeek/gregory-iso-weekofyear.js index 70252942e9..8de9cc6f34 100644 --- a/test/intl402/Temporal/PlainDate/prototype/yearOfWeek/gregory-iso-weekofyear.js +++ b/test/intl402/Temporal/PlainDate/prototype/yearOfWeek/gregory-iso-weekofyear.js @@ -16,12 +16,12 @@ features: [Temporal] // -let calendar = new Temporal.Calendar("gregory"); +let calendar = "gregory"; const date = new Temporal.PlainDate(2021, 1, 1, calendar); assert.sameValue(date.yearOfWeek, 2021); -calendar = new Temporal.Calendar("iso8601"); +calendar = "iso8601"; const isodate = new Temporal.PlainDate(2021, 1, 1, calendar); assert.sameValue(isodate.yearOfWeek, 2020); diff --git a/test/intl402/Temporal/PlainDate/prototype/yearOfWeek/non-iso-week-of-year.js b/test/intl402/Temporal/PlainDate/prototype/yearOfWeek/non-iso-week-of-year.js index e378c0884c..5d0190e259 100644 --- a/test/intl402/Temporal/PlainDate/prototype/yearOfWeek/non-iso-week-of-year.js +++ b/test/intl402/Temporal/PlainDate/prototype/yearOfWeek/non-iso-week-of-year.js @@ -11,12 +11,12 @@ features: [Temporal] // Gregorian calendar has a well defined week-numbering system. -let calendar = new Temporal.Calendar("gregory"); +let calendar = "gregory"; const date = new Temporal.PlainDate(2024, 1, 1, calendar); assert.sameValue(date.yearOfWeek, 2024); -calendar = new Temporal.Calendar("hebrew"); +calendar = "hebrew"; const nonisodate = new Temporal.PlainDate(2024, 1, 1, calendar); assert.sameValue(nonisodate.yearOfWeek, undefined); diff --git a/test/intl402/Temporal/PlainDateTime/prototype/weekOfYear/gregory-iso-weekofyear.js b/test/intl402/Temporal/PlainDateTime/prototype/weekOfYear/gregory-iso-weekofyear.js index 6f79fd1c11..65f75d4a64 100644 --- a/test/intl402/Temporal/PlainDateTime/prototype/weekOfYear/gregory-iso-weekofyear.js +++ b/test/intl402/Temporal/PlainDateTime/prototype/weekOfYear/gregory-iso-weekofyear.js @@ -16,12 +16,12 @@ features: [Temporal] // -let calendar = new Temporal.Calendar("gregory"); +let calendar = "gregory"; const date = new Temporal.PlainDateTime(2021, 1, 1, 12, 34, 56, 987, 654, 321, calendar); assert.sameValue(date.weekOfYear, 1); -calendar = new Temporal.Calendar("iso8601"); +calendar = "iso8601"; const isodate = new Temporal.PlainDateTime(2021, 1, 1, 12, 34, 56, 987, 654, 321, calendar); assert.sameValue(isodate.weekOfYear, 53); diff --git a/test/intl402/Temporal/PlainDateTime/prototype/weekOfYear/non-iso-week-of-year.js b/test/intl402/Temporal/PlainDateTime/prototype/weekOfYear/non-iso-week-of-year.js index 1eb4e566bb..56077f2e76 100644 --- a/test/intl402/Temporal/PlainDateTime/prototype/weekOfYear/non-iso-week-of-year.js +++ b/test/intl402/Temporal/PlainDateTime/prototype/weekOfYear/non-iso-week-of-year.js @@ -11,12 +11,12 @@ features: [Temporal] // Gregorian calendar has a well defined week-numbering system. -let calendar = new Temporal.Calendar("gregory"); +let calendar = "gregory"; const date = new Temporal.PlainDateTime(2024, 1, 1, 12, 34, 56, 987, 654, 321, calendar); assert.sameValue(date.weekOfYear, 1); -calendar = new Temporal.Calendar("hebrew"); +calendar = "hebrew"; const nonisodate = new Temporal.PlainDateTime(2024, 1, 1, 12, 34, 56, 987, 654, 321, calendar); assert.sameValue(nonisodate.weekOfYear, undefined); diff --git a/test/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/gregory-iso-weekofyear.js b/test/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/gregory-iso-weekofyear.js index 63bd715a1b..20034007f9 100644 --- a/test/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/gregory-iso-weekofyear.js +++ b/test/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/gregory-iso-weekofyear.js @@ -16,12 +16,12 @@ features: [Temporal] // -let calendar = new Temporal.Calendar("gregory"); +let calendar = "gregory"; const date = new Temporal.PlainDateTime(2021, 1, 1, 12, 34, 56, 987, 654, 321, calendar); assert.sameValue(date.yearOfWeek, 2021); -calendar = new Temporal.Calendar("iso8601"); +calendar = "iso8601"; const isodate = new Temporal.PlainDateTime(2021, 1, 1, 12, 34, 56, 987, 654, 321, calendar); assert.sameValue(isodate.yearOfWeek, 2020); diff --git a/test/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/non-iso-week-of-year.js b/test/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/non-iso-week-of-year.js index 35c1b13f18..8157aa1414 100644 --- a/test/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/non-iso-week-of-year.js +++ b/test/intl402/Temporal/PlainDateTime/prototype/yearOfWeek/non-iso-week-of-year.js @@ -11,12 +11,12 @@ features: [Temporal] // Gregorian calendar has a well defined week-numbering system. -let calendar = new Temporal.Calendar("gregory"); +let calendar = "gregory"; const date = new Temporal.PlainDateTime(2024, 1, 1, 12, 34, 56, 987, 654, 321, calendar); assert.sameValue(date.yearOfWeek, 2024); -calendar = new Temporal.Calendar("hebrew"); +calendar = "hebrew"; const nonisodate = new Temporal.PlainDateTime(2024, 1, 1, 12, 34, 56, 987, 654, 321, calendar); assert.sameValue(nonisodate.yearOfWeek, undefined); diff --git a/test/intl402/Temporal/PlainMonthDay/from/fields-object.js b/test/intl402/Temporal/PlainMonthDay/from/fields-object.js index 09aaf918da..aa2a4b97ea 100644 --- a/test/intl402/Temporal/PlainMonthDay/from/fields-object.js +++ b/test/intl402/Temporal/PlainMonthDay/from/fields-object.js @@ -11,8 +11,6 @@ features: [Temporal] const okTests = [ [{ monthCode: "M08", day: 1, calendar: "gregory" }, "gregory", "monthCode and non-ISO Gregorian string calendar"], [{ monthCode: "M08", day: 1, calendar: "hebrew" }, "hebrew", "monthCode and non-ISO non-Gregorian string calendar"], - [{ monthCode: "M08", day: 1, calendar: Temporal.Calendar.from("gregory") }, "gregory", "monthCode and non-ISO Gregorian object calendar"], - [{ monthCode: "M08", day: 1, calendar: Temporal.Calendar.from("hebrew") }, "hebrew", "monthCode and non-ISO non-Gregorian object calendar"], ]; for (const [argument, expectedCalendar, description] of okTests) { @@ -24,8 +22,6 @@ for (const [argument, expectedCalendar, description] of okTests) { const notOkTests = [ [{ month: 8, day: 1, calendar: "gregory" }, "month and non-ISO string calendar"], [{ month: 8, day: 1, calendar: "hebrew" }, "month and non-ISO non-Gregorian string calendar"], - [{ month: 8, day: 1, calendar: Temporal.Calendar.from("gregory") }, "month and non-ISO Gregorian object calendar"], - [{ month: 8, day: 1, calendar: Temporal.Calendar.from("hebrew") }, "month and non-ISO non-Gregorian object calendar"], ]; for (const [argument, description] of notOkTests) { diff --git a/test/intl402/Temporal/ZonedDateTime/prototype/equals/offset-and-iana.js b/test/intl402/Temporal/ZonedDateTime/prototype/equals/offset-and-iana.js index 8e0d16ea18..548cb7f12c 100644 --- a/test/intl402/Temporal/ZonedDateTime/prototype/equals/offset-and-iana.js +++ b/test/intl402/Temporal/ZonedDateTime/prototype/equals/offset-and-iana.js @@ -8,13 +8,8 @@ features: [Temporal] ---*/ const zdt = new Temporal.ZonedDateTime(0n, "America/Los_Angeles"); -const otz1 = new Temporal.TimeZone("+05:30"); -const otz2 = new Temporal.TimeZone("+0530"); -const tz = new Temporal.TimeZone("Asia/Kolkata"); -assert(zdt.withTimeZone(otz1).equals(zdt.withTimeZone(otz2)), "+05:30 = +0530"); -assert(zdt.withTimeZone(otz2).equals(zdt.withTimeZone(otz1)), "+0530 = +05:30"); -assert(zdt.withTimeZone(otz1).equals(zdt.withTimeZone("+05:30")), "+05:30 = +05:30 string ID"); -assert(zdt.withTimeZone(otz1).equals(zdt.withTimeZone(otz2).toString()), "+05:30 = +0530 IXDTF string"); -assert(!zdt.withTimeZone(otz1).equals(zdt.withTimeZone("Asia/Kolkata")), "+05:30 != Asia/Kolkata string ID"); -assert(!zdt.withTimeZone(otz1).equals(zdt.withTimeZone(tz)), "+05:30 != Asia/Kolkata"); -assert(!zdt.withTimeZone(otz1).equals(zdt.withTimeZone(tz).toString()), "+05:30 != Asia/Kolkata IXDTF string"); +assert(zdt.withTimeZone("+05:30").equals(zdt.withTimeZone("+0530")), "+05:30 = +0530"); +assert(zdt.withTimeZone("+0530").equals(zdt.withTimeZone("+05:30")), "+0530 = +05:30"); +assert(zdt.withTimeZone("+05:30").equals(zdt.withTimeZone("+0530").toString()), "+05:30 = +0530 IXDTF string"); +assert(!zdt.withTimeZone("+05:30").equals(zdt.withTimeZone("Asia/Kolkata")), "+05:30 != Asia/Kolkata string ID"); +assert(!zdt.withTimeZone("+05:30").equals(zdt.withTimeZone("Asia/Kolkata").toString()), "+05:30 != Asia/Kolkata IXDTF string"); diff --git a/test/intl402/Temporal/ZonedDateTime/prototype/equals/sub-minute-offset.js b/test/intl402/Temporal/ZonedDateTime/prototype/equals/sub-minute-offset.js index fe058b4a7b..0e4bd1173b 100644 --- a/test/intl402/Temporal/ZonedDateTime/prototype/equals/sub-minute-offset.js +++ b/test/intl402/Temporal/ZonedDateTime/prototype/equals/sub-minute-offset.js @@ -8,8 +8,7 @@ features: [Temporal] ---*/ const expectedNanoseconds = BigInt((44 * 60 + 30) * 1e9); -const timeZone = new Temporal.TimeZone("Africa/Monrovia"); -const instance = new Temporal.ZonedDateTime(expectedNanoseconds, timeZone); +const instance = new Temporal.ZonedDateTime(expectedNanoseconds, "Africa/Monrovia"); let result = instance.equals("1970-01-01T00:00:00-00:45[Africa/Monrovia]"); assert.sameValue(result, true, "UTC offset rounded to minutes is accepted"); @@ -30,6 +29,6 @@ const properties = { day: 1, minute: 44, second: 30, - timeZone + timeZone: "Africa/Monrovia" }; assert.throws(RangeError, () => instance.equals(properties), "no fuzzy matching is done on offset in property bag"); diff --git a/test/intl402/Temporal/ZonedDateTime/prototype/since/sub-minute-offset.js b/test/intl402/Temporal/ZonedDateTime/prototype/since/sub-minute-offset.js index 775dd0430c..f7cd828947 100644 --- a/test/intl402/Temporal/ZonedDateTime/prototype/since/sub-minute-offset.js +++ b/test/intl402/Temporal/ZonedDateTime/prototype/since/sub-minute-offset.js @@ -8,7 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("Africa/Monrovia"); +const timeZone = "Africa/Monrovia"; const instance = new Temporal.ZonedDateTime(0n, timeZone); let result = instance.since("1970-01-01T00:44:30-00:44:30[Africa/Monrovia]"); diff --git a/test/intl402/Temporal/ZonedDateTime/prototype/until/sub-minute-offset.js b/test/intl402/Temporal/ZonedDateTime/prototype/until/sub-minute-offset.js index e108189671..08a6640eb8 100644 --- a/test/intl402/Temporal/ZonedDateTime/prototype/until/sub-minute-offset.js +++ b/test/intl402/Temporal/ZonedDateTime/prototype/until/sub-minute-offset.js @@ -8,8 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("Africa/Monrovia"); -const instance = new Temporal.ZonedDateTime(0n, timeZone); +const instance = new Temporal.ZonedDateTime(0n, "Africa/Monrovia"); let result = instance.until("1970-01-01T00:44:30-00:44:30[Africa/Monrovia]"); TemporalHelpers.assertDuration(result, 0, 0, 0, 0, 1, 29, 0, 0, 0, 0, "UTC offset rounded to minutes is accepted"); @@ -30,6 +29,6 @@ const properties = { day: 1, minute: 44, second: 30, - timeZone + timeZone: "Africa/Monrovia" }; assert.throws(RangeError, () => instance.until(properties), "no fuzzy matching is done on offset in property bag"); diff --git a/test/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/gregory-iso-weekofyear.js b/test/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/gregory-iso-weekofyear.js index c02e49a0b4..e9c2477db6 100644 --- a/test/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/gregory-iso-weekofyear.js +++ b/test/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/gregory-iso-weekofyear.js @@ -16,12 +16,12 @@ features: [Temporal] // -let calendar = new Temporal.Calendar("gregory"); +let calendar = "gregory"; const date = new Temporal.ZonedDateTime(1_609_504_496_987_654_321n, "UTC", calendar); assert.sameValue(date.weekOfYear, 1); -calendar = new Temporal.Calendar("iso8601"); +calendar = "iso8601"; const isodate = new Temporal.ZonedDateTime(1_609_504_496_987_654_321n, "UTC", calendar); assert.sameValue(isodate.weekOfYear, 53); diff --git a/test/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/non-iso-week-of-year.js b/test/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/non-iso-week-of-year.js index c5f2394416..eb85685685 100644 --- a/test/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/non-iso-week-of-year.js +++ b/test/intl402/Temporal/ZonedDateTime/prototype/weekOfYear/non-iso-week-of-year.js @@ -11,14 +11,14 @@ features: [Temporal] // Gregorian calendar has a well defined week-numbering system. -let calendar = new Temporal.Calendar("gregory"); +let calendar = "gregory"; // Epoch Nanoseconds for new Temporal.PlainDateTime(2024, 1, 1, 12, 34, 56, 987, 654, 321, calendar); const date = new Temporal.ZonedDateTime(1_704_112_496_987_654_321n, "UTC", calendar); assert.sameValue(date.weekOfYear, 1); -calendar = new Temporal.Calendar("hebrew"); +calendar = "hebrew"; const nonisodate = new Temporal.ZonedDateTime(1_704_112_496_987_654_321n, "UTC", calendar); assert.sameValue(nonisodate.weekOfYear, undefined); diff --git a/test/intl402/Temporal/ZonedDateTime/prototype/with/offset-property-sub-minute.js b/test/intl402/Temporal/ZonedDateTime/prototype/with/offset-property-sub-minute.js index ed5c00b7cf..d1cc633ee2 100644 --- a/test/intl402/Temporal/ZonedDateTime/prototype/with/offset-property-sub-minute.js +++ b/test/intl402/Temporal/ZonedDateTime/prototype/with/offset-property-sub-minute.js @@ -8,8 +8,7 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -const timeZone = new Temporal.TimeZone("Africa/Monrovia"); -const instance = Temporal.ZonedDateTime.from({ year: 1970, month: 1, day: 1, hour: 12, timeZone }); +const instance = Temporal.ZonedDateTime.from({ year: 1970, month: 1, day: 1, hour: 12, timeZone: "Africa/Monrovia" }); assert.sameValue(instance.offset, "-00:44:30", "original offset"); const properties = { day: 2, offset: "-00:45" }; diff --git a/test/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/gregory-iso-weekofyear.js b/test/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/gregory-iso-weekofyear.js index 439a5173d1..f7b22ab358 100644 --- a/test/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/gregory-iso-weekofyear.js +++ b/test/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/gregory-iso-weekofyear.js @@ -16,12 +16,12 @@ features: [Temporal] // -let calendar = new Temporal.Calendar("gregory"); +let calendar = "gregory"; const date = new Temporal.ZonedDateTime(1_609_504_496_987_654_321n, "UTC", calendar); assert.sameValue(date.yearOfWeek, 2021); -calendar = new Temporal.Calendar("iso8601"); +calendar = "iso8601"; const isodate = new Temporal.ZonedDateTime(1_609_504_496_987_654_321n, "UTC", calendar); assert.sameValue(isodate.yearOfWeek, 2020); diff --git a/test/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/non-iso-week-of-year.js b/test/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/non-iso-week-of-year.js index 7e163fa529..55e8d624ee 100644 --- a/test/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/non-iso-week-of-year.js +++ b/test/intl402/Temporal/ZonedDateTime/prototype/yearOfWeek/non-iso-week-of-year.js @@ -11,14 +11,14 @@ features: [Temporal] // Gregorian calendar has a well defined week-numbering system. -let calendar = new Temporal.Calendar("gregory"); +let calendar = "gregory"; // Epoch Nanoseconds for new Temporal.PlainDateTime(2024, 1, 1, 12, 34, 56, 987, 654, 321, calendar); const date = new Temporal.ZonedDateTime(1_704_112_496_987_654_321n, "UTC", calendar); assert.sameValue(date.yearOfWeek, 2024); -calendar = new Temporal.Calendar("hebrew"); +calendar = "hebrew"; const nonisodate = new Temporal.ZonedDateTime(1_704_112_496_987_654_321n, "UTC", calendar); assert.sameValue(nonisodate.yearOfWeek, undefined); diff --git a/test/staging/Temporal/Instant/old/toZonedDateTimeISO.js b/test/staging/Temporal/Instant/old/toZonedDateTimeISO.js index 95986c44dd..6f50c10771 100644 --- a/test/staging/Temporal/Instant/old/toZonedDateTimeISO.js +++ b/test/staging/Temporal/Instant/old/toZonedDateTimeISO.js @@ -13,13 +13,11 @@ var inst = Temporal.Instant.from("1976-11-18T14:23:30.123456789Z"); assert.throws(TypeError, () => inst.toZonedDateTimeISO()); // time zone parameter UTC -var tz = Temporal.TimeZone.from("UTC"); -var zdt = inst.toZonedDateTimeISO(tz); +var zdt = inst.toZonedDateTimeISO("UTC"); assert.sameValue(inst.epochNanoseconds, zdt.epochNanoseconds); assert.sameValue(`${ zdt }`, "1976-11-18T14:23:30.123456789+00:00[UTC]"); // time zone parameter non-UTC -var tz = Temporal.TimeZone.from("-05:00"); -var zdt = inst.toZonedDateTimeISO(tz); +var zdt = inst.toZonedDateTimeISO("-05:00"); assert.sameValue(inst.epochNanoseconds, zdt.epochNanoseconds); assert.sameValue(`${ zdt }`, "1976-11-18T09:23:30.123456789-05:00[-05:00]"); diff --git a/test/staging/Temporal/Regex/old/instant.js b/test/staging/Temporal/Regex/old/instant.js index 09e810ea55..aebde59ffa 100644 --- a/test/staging/Temporal/Regex/old/instant.js +++ b/test/staging/Temporal/Regex/old/instant.js @@ -10,8 +10,7 @@ features: [Temporal] function test(isoString, components) { var [y, mon, d, h = 0, min = 0, s = 0, ms = 0, µs = 0, ns = 0] = components; var instant = Temporal.Instant.from(isoString); - var utc = Temporal.TimeZone.from("UTC"); - var datetime = utc.getPlainDateTimeFor(instant); + var datetime = instant.toZonedDateTimeISO("UTC"); assert.sameValue(datetime.year, y); assert.sameValue(datetime.month, mon); assert.sameValue(datetime.day, d); diff --git a/test/staging/Temporal/ZonedDateTime/old/construction-and-properties.js b/test/staging/Temporal/ZonedDateTime/old/construction-and-properties.js index 64442e44e9..d4a071a29f 100644 --- a/test/staging/Temporal/ZonedDateTime/old/construction-and-properties.js +++ b/test/staging/Temporal/ZonedDateTime/old/construction-and-properties.js @@ -7,12 +7,11 @@ description: Construction and properties features: [Temporal] ---*/ -var tz = new Temporal.TimeZone("-08:00"); var epochMillis = Date.UTC(1976, 10, 18, 15, 23, 30, 123); var epochNanos = BigInt(epochMillis) * BigInt(1000000) + BigInt(456789); // works -var zdt = new Temporal.ZonedDateTime(epochNanos, tz); +var zdt = new Temporal.ZonedDateTime(epochNanos, "-08:00"); assert(zdt instanceof Temporal.ZonedDateTime); assert.sameValue(typeof zdt, "object"); assert.sameValue(zdt.toInstant().epochMilliseconds, Date.UTC(1976, 10, 18, 15, 23, 30, 123), "epochMilliseconds"); diff --git a/test/staging/Temporal/ZonedDateTime/old/property-bags.js b/test/staging/Temporal/ZonedDateTime/old/property-bags.js index 21d3f13452..484b1d769e 100644 --- a/test/staging/Temporal/ZonedDateTime/old/property-bags.js +++ b/test/staging/Temporal/ZonedDateTime/old/property-bags.js @@ -8,14 +8,12 @@ includes: [temporalHelpers.js] features: [Temporal] ---*/ -var lagos = Temporal.TimeZone.from("+01:00"); - // can be constructed with monthCode and without month assert.sameValue(`${ Temporal.ZonedDateTime.from({ year: 1976, monthCode: "M11", day: 18, - timeZone: lagos + timeZone: "+01:00" }) }`, "1976-11-18T00:00:00+01:00[+01:00]"); // can be constructed with month and without monthCode @@ -23,7 +21,7 @@ assert.sameValue(`${ Temporal.ZonedDateTime.from({ year: 1976, month: 11, day: 18, - timeZone: lagos + timeZone: "+01:00" }) }`, "1976-11-18T00:00:00+01:00[+01:00]"); // month and monthCode must agree @@ -32,7 +30,7 @@ assert.throws(RangeError, () => Temporal.ZonedDateTime.from({ month: 11, monthCode: "M12", day: 18, - timeZone: lagos + timeZone: "+01:00" })); // Temporal.ZonedDateTime.from({}) throws @@ -44,7 +42,7 @@ assert.throws(TypeError, () => Temporal.ZonedDateTime.from({ month: undefined, monthCode: undefined, day: 18, - timeZone: lagos + timeZone: "+01:00" })) // options may be a function object @@ -52,7 +50,7 @@ assert.sameValue(`${ Temporal.ZonedDateTime.from({ year: 1976, month: 11, day: 18, - timeZone: lagos + timeZone: "+01:00" }, () => { }) }`, "1976-11-18T00:00:00+01:00[+01:00]"); @@ -61,7 +59,7 @@ assert.throws(TypeError, () => Temporal.ZonedDateTime.from({ years: 1976, months: 11, days: 18, - timeZone: lagos + timeZone: "+01:00" })); // incorrectly-spelled properties are ignored @@ -69,7 +67,7 @@ assert.sameValue(`${ Temporal.ZonedDateTime.from({ year: 1976, month: 11, day: 18, - timeZone: lagos, + timeZone: "+01:00", hours: 12 }) }`, "1976-11-18T00:00:00+01:00[+01:00]"); @@ -91,7 +89,7 @@ assert.sameValue(`${ Temporal.ZonedDateTime.from({ month: 11, day: 18, offset: offset, - timeZone: Temporal.TimeZone.from("+10:00") + timeZone: "+10:00" }) ) }); @@ -102,7 +100,7 @@ var bad = { year: 2019, month: 1, day: 32, - timeZone: lagos + timeZone: "+01:00" }; assert.throws(RangeError, () => Temporal.ZonedDateTime.from(bad, { overflow: "reject" })); assert.sameValue(`${ Temporal.ZonedDateTime.from(bad) }`, "2019-01-31T00:00:00+01:00[+01:00]"); diff --git a/test/staging/Temporal/ZonedDateTime/old/toPlainDate.js b/test/staging/Temporal/ZonedDateTime/old/toPlainDate.js index 60cca9273b..2957dfb73e 100644 --- a/test/staging/Temporal/ZonedDateTime/old/toPlainDate.js +++ b/test/staging/Temporal/ZonedDateTime/old/toPlainDate.js @@ -7,10 +7,8 @@ description: Temporal.ZonedDateTime.prototype.toPlainDate() features: [Temporal] ---*/ -var tz = new Temporal.TimeZone("-07:00"); - // works -var zdt = Temporal.Instant.from("2019-10-29T09:46:38.271986102Z").toZonedDateTimeISO(tz); +var zdt = Temporal.Instant.from("2019-10-29T09:46:38.271986102Z").toZonedDateTimeISO("-07:00"); assert.sameValue(`${ zdt.toPlainDate() }`, "2019-10-29"); // preserves the calendar diff --git a/test/staging/Temporal/ZonedDateTime/old/toPlainTime.js b/test/staging/Temporal/ZonedDateTime/old/toPlainTime.js index 8e95119cc5..e932b1413c 100644 --- a/test/staging/Temporal/ZonedDateTime/old/toPlainTime.js +++ b/test/staging/Temporal/ZonedDateTime/old/toPlainTime.js @@ -7,8 +7,6 @@ description: Temporal.ZonedDateTime.prototype.toPlainTime() features: [Temporal] ---*/ -var tz = new Temporal.TimeZone("-07:00"); - // works -var zdt = Temporal.Instant.from("2019-10-29T09:46:38.271986102Z").toZonedDateTimeISO(tz); +var zdt = Temporal.Instant.from("2019-10-29T09:46:38.271986102Z").toZonedDateTimeISO("-07:00"); assert.sameValue(`${ zdt.toPlainTime() }`, "02:46:38.271986102");