diff --git a/test/built-ins/Temporal/Calendar/from/calendar-wrong-type.js b/test/built-ins/Temporal/Calendar/from/calendar-wrong-type.js index ce7a471809..e97e4d905d 100644 --- a/test/built-ins/Temporal/Calendar/from/calendar-wrong-type.js +++ b/test/built-ins/Temporal/Calendar/from/calendar-wrong-type.js @@ -15,10 +15,12 @@ const rangeErrorTests = [ ["", "empty string"], [1, "number that doesn't convert to a valid ISO string"], [1n, "bigint"], + [new Temporal.TimeZone("UTC"), "time zone instance"], ]; for (const [arg, description] of rangeErrorTests) { assert.throws(RangeError, () => Temporal.Calendar.from(arg), `${description} does not convert to a valid ISO string`); + assert.throws(RangeError, () => Temporal.Calendar.from({ calendar: arg }), `${description} does not convert to a valid ISO string (in property bag)`); } const typeErrorTests = [ @@ -27,4 +29,5 @@ const typeErrorTests = [ for (const [arg, description] of typeErrorTests) { assert.throws(TypeError, () => Temporal.Calendar.from(arg), `${description} is not a valid object and does not convert to a string`); + assert.throws(TypeError, () => Temporal.Calendar.from({ calendar: arg }), `${description} is not a valid object and does not convert to a string (in property bag)`); } diff --git a/test/built-ins/Temporal/Calendar/prototype/dateUntil/argument-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/Calendar/prototype/dateUntil/argument-propertybag-calendar-wrong-type.js index f23d15c3e5..5a974bbb17 100644 --- a/test/built-ins/Temporal/Calendar/prototype/dateUntil/argument-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/Calendar/prototype/dateUntil/argument-propertybag-calendar-wrong-type.js @@ -18,6 +18,7 @@ const rangeErrorTests = [ ["", "empty string"], [1, "number that doesn't convert to a valid ISO string"], [1n, "bigint"], + [new Temporal.TimeZone("UTC"), "time zone instance"], ]; for (const [calendar, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/Duration/compare/relativeto-propertybag-timezone-wrong-type.js b/test/built-ins/Temporal/Duration/compare/relativeto-propertybag-timezone-wrong-type.js index 78d245fe48..cd328593c3 100644 --- a/test/built-ins/Temporal/Duration/compare/relativeto-propertybag-timezone-wrong-type.js +++ b/test/built-ins/Temporal/Duration/compare/relativeto-propertybag-timezone-wrong-type.js @@ -16,6 +16,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-calendar-wrong-type.js index ca4b0dd243..733eee13df 100644 --- a/test/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-calendar-wrong-type.js @@ -18,6 +18,7 @@ const rangeErrorTests = [ ["", "empty string"], [1, "number that doesn't convert to a valid ISO string"], [1n, "bigint"], + [new Temporal.TimeZone("UTC"), "time zone instance"], ]; for (const [calendar, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-timezone-wrong-type.js b/test/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-timezone-wrong-type.js index 6ff8c9fb2f..8eafc80af2 100644 --- a/test/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-timezone-wrong-type.js +++ b/test/built-ins/Temporal/Duration/prototype/add/relativeto-propertybag-timezone-wrong-type.js @@ -18,6 +18,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { 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 2d449a7449..0baa3c35ad 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 @@ -18,6 +18,7 @@ const rangeErrorTests = [ ["", "empty string"], [1, "number that doesn't convert to a valid ISO string"], [1n, "bigint"], + [new Temporal.TimeZone("UTC"), "time zone instance"], ]; for (const [calendar, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-timezone-wrong-type.js b/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-timezone-wrong-type.js index 9ac21ea9af..c77296c071 100644 --- a/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-timezone-wrong-type.js +++ b/test/built-ins/Temporal/Duration/prototype/round/relativeto-propertybag-timezone-wrong-type.js @@ -18,6 +18,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-calendar-wrong-type.js index 5f65a27695..eb831ff77f 100644 --- a/test/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-calendar-wrong-type.js @@ -18,6 +18,7 @@ const rangeErrorTests = [ ["", "empty string"], [1, "number that doesn't convert to a valid ISO string"], [1n, "bigint"], + [new Temporal.TimeZone("UTC"), "time zone instance"], ]; for (const [calendar, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-timezone-wrong-type.js b/test/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-timezone-wrong-type.js index 3f6d1f020d..41d7977524 100644 --- a/test/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-timezone-wrong-type.js +++ b/test/built-ins/Temporal/Duration/prototype/subtract/relativeto-propertybag-timezone-wrong-type.js @@ -18,6 +18,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { 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 b2b5185bc5..d225356a5e 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 @@ -18,6 +18,7 @@ const rangeErrorTests = [ ["", "empty string"], [1, "number that doesn't convert to a valid ISO string"], [1n, "bigint"], + [new Temporal.TimeZone("UTC"), "time zone instance"], ]; for (const [calendar, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-timezone-wrong-type.js b/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-timezone-wrong-type.js index a105817128..e6c0d94209 100644 --- a/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-timezone-wrong-type.js +++ b/test/built-ins/Temporal/Duration/prototype/total/relativeto-propertybag-timezone-wrong-type.js @@ -18,6 +18,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/Instant/prototype/toString/timezone-wrong-type.js b/test/built-ins/Temporal/Instant/prototype/toString/timezone-wrong-type.js index d7112ae6e6..699b279b82 100644 --- a/test/built-ins/Temporal/Instant/prototype/toString/timezone-wrong-type.js +++ b/test/built-ins/Temporal/Instant/prototype/toString/timezone-wrong-type.js @@ -18,6 +18,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/calendar-wrong-type.js b/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/calendar-wrong-type.js index c6c4992ab9..24c2a13b60 100644 --- a/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/calendar-wrong-type.js +++ b/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/calendar-wrong-type.js @@ -17,10 +17,12 @@ const rangeErrorTests = [ ["", "empty string"], [1, "number that doesn't convert to a valid ISO string"], [1n, "bigint"], + [new Temporal.TimeZone("UTC"), "time zone instance"], ]; for (const [arg, description] of rangeErrorTests) { assert.throws(RangeError, () => instance.toZonedDateTime({ calendar: arg, timeZone: "UTC" }), `${description} does not convert to a valid ISO string`); + assert.throws(RangeError, () => instance.toZonedDateTime({ calendar: { calendar: arg }, timeZone: "UTC" }), `${description} does not convert to a valid ISO string (in property bag)`); } const typeErrorTests = [ @@ -29,4 +31,5 @@ const typeErrorTests = [ for (const [arg, description] of typeErrorTests) { assert.throws(TypeError, () => instance.toZonedDateTime({ calendar: arg, timeZone: "UTC" }), `${description} is not a valid object and does not convert to a string`); + assert.throws(TypeError, () => instance.toZonedDateTime({ calendar: { calendar: arg }, timeZone: "UTC" }), `${description} is not a valid object and does not convert to a string (in property bag)`); } diff --git a/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/timezone-wrong-type.js b/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/timezone-wrong-type.js index 5400a7f5e4..8f5f4d0494 100644 --- a/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/timezone-wrong-type.js +++ b/test/built-ins/Temporal/Instant/prototype/toZonedDateTime/timezone-wrong-type.js @@ -18,6 +18,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/timezone-wrong-type.js b/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/timezone-wrong-type.js index 0358af03ec..fbe21dfed2 100644 --- a/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/timezone-wrong-type.js +++ b/test/built-ins/Temporal/Instant/prototype/toZonedDateTimeISO/timezone-wrong-type.js @@ -18,6 +18,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/Now/plainDate/calendar-wrong-type.js b/test/built-ins/Temporal/Now/plainDate/calendar-wrong-type.js index 3c9d54c0c4..7aa62022e0 100644 --- a/test/built-ins/Temporal/Now/plainDate/calendar-wrong-type.js +++ b/test/built-ins/Temporal/Now/plainDate/calendar-wrong-type.js @@ -15,10 +15,12 @@ const rangeErrorTests = [ ["", "empty string"], [1, "number that doesn't convert to a valid ISO string"], [1n, "bigint"], + [new Temporal.TimeZone("UTC"), "time zone instance"], ]; for (const [arg, description] of rangeErrorTests) { assert.throws(RangeError, () => Temporal.Now.plainDate(arg), `${description} does not convert to a valid ISO string`); + assert.throws(RangeError, () => Temporal.Now.plainDate({ calendar: arg }), `${description} does not convert to a valid ISO string (in property bag)`); } const typeErrorTests = [ @@ -27,4 +29,5 @@ const typeErrorTests = [ for (const [arg, description] of typeErrorTests) { assert.throws(TypeError, () => Temporal.Now.plainDate(arg), `${description} is not a valid object and does not convert to a string`); + assert.throws(TypeError, () => Temporal.Now.plainDate({ calendar: arg }), `${description} is not a valid object and does not convert to a string (in property bag)`); } diff --git a/test/built-ins/Temporal/Now/plainDate/timezone-wrong-type.js b/test/built-ins/Temporal/Now/plainDate/timezone-wrong-type.js index 132b6f3f29..3319d2378a 100644 --- a/test/built-ins/Temporal/Now/plainDate/timezone-wrong-type.js +++ b/test/built-ins/Temporal/Now/plainDate/timezone-wrong-type.js @@ -16,6 +16,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/Now/plainDateISO/timezone-wrong-type.js b/test/built-ins/Temporal/Now/plainDateISO/timezone-wrong-type.js index 495e18c9cd..bc6dace702 100644 --- a/test/built-ins/Temporal/Now/plainDateISO/timezone-wrong-type.js +++ b/test/built-ins/Temporal/Now/plainDateISO/timezone-wrong-type.js @@ -16,6 +16,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/Now/plainDateTime/calendar-wrong-type.js b/test/built-ins/Temporal/Now/plainDateTime/calendar-wrong-type.js index ccb5a6f722..47a2e0ed18 100644 --- a/test/built-ins/Temporal/Now/plainDateTime/calendar-wrong-type.js +++ b/test/built-ins/Temporal/Now/plainDateTime/calendar-wrong-type.js @@ -15,10 +15,12 @@ const rangeErrorTests = [ ["", "empty string"], [1, "number that doesn't convert to a valid ISO string"], [1n, "bigint"], + [new Temporal.TimeZone("UTC"), "time zone instance"], ]; for (const [arg, description] of rangeErrorTests) { assert.throws(RangeError, () => Temporal.Now.plainDateTime(arg), `${description} does not convert to a valid ISO string`); + assert.throws(RangeError, () => Temporal.Now.plainDateTime({ calendar: arg }), `${description} does not convert to a valid ISO string (in property bag)`); } const typeErrorTests = [ @@ -27,4 +29,5 @@ const typeErrorTests = [ for (const [arg, description] of typeErrorTests) { assert.throws(TypeError, () => Temporal.Now.plainDateTime(arg), `${description} is not a valid object and does not convert to a string`); + assert.throws(TypeError, () => Temporal.Now.plainDateTime({ calendar: arg }), `${description} is not a valid object and does not convert to a string (in property bag)`); } diff --git a/test/built-ins/Temporal/Now/plainDateTime/timezone-wrong-type.js b/test/built-ins/Temporal/Now/plainDateTime/timezone-wrong-type.js index 2ded837309..429a0f865b 100644 --- a/test/built-ins/Temporal/Now/plainDateTime/timezone-wrong-type.js +++ b/test/built-ins/Temporal/Now/plainDateTime/timezone-wrong-type.js @@ -16,6 +16,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/Now/plainDateTimeISO/timezone-wrong-type.js b/test/built-ins/Temporal/Now/plainDateTimeISO/timezone-wrong-type.js index 85dbb12387..508de638b2 100644 --- a/test/built-ins/Temporal/Now/plainDateTimeISO/timezone-wrong-type.js +++ b/test/built-ins/Temporal/Now/plainDateTimeISO/timezone-wrong-type.js @@ -16,6 +16,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/Now/plainTimeISO/timezone-wrong-type.js b/test/built-ins/Temporal/Now/plainTimeISO/timezone-wrong-type.js index 356d766377..557f8aee0e 100644 --- a/test/built-ins/Temporal/Now/plainTimeISO/timezone-wrong-type.js +++ b/test/built-ins/Temporal/Now/plainTimeISO/timezone-wrong-type.js @@ -16,6 +16,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/Now/zonedDateTime/calendar-wrong-type.js b/test/built-ins/Temporal/Now/zonedDateTime/calendar-wrong-type.js index 8ba88cc410..1a6196458a 100644 --- a/test/built-ins/Temporal/Now/zonedDateTime/calendar-wrong-type.js +++ b/test/built-ins/Temporal/Now/zonedDateTime/calendar-wrong-type.js @@ -15,10 +15,12 @@ const rangeErrorTests = [ ["", "empty string"], [1, "number that doesn't convert to a valid ISO string"], [1n, "bigint"], + [new Temporal.TimeZone("UTC"), "time zone instance"], ]; for (const [arg, description] of rangeErrorTests) { assert.throws(RangeError, () => Temporal.Now.zonedDateTime(arg), `${description} does not convert to a valid ISO string`); + assert.throws(RangeError, () => Temporal.Now.zonedDateTime({ calendar: arg }), `${description} does not convert to a valid ISO string (in property bag)`); } const typeErrorTests = [ @@ -27,4 +29,5 @@ const typeErrorTests = [ for (const [arg, description] of typeErrorTests) { assert.throws(TypeError, () => Temporal.Now.zonedDateTime(arg), `${description} is not a valid object and does not convert to a string`); + assert.throws(TypeError, () => Temporal.Now.zonedDateTime({ calendar: arg }), `${description} is not a valid object and does not convert to a string (in property bag)`); } diff --git a/test/built-ins/Temporal/Now/zonedDateTime/timezone-wrong-type.js b/test/built-ins/Temporal/Now/zonedDateTime/timezone-wrong-type.js index 2284860ba1..2d309942c0 100644 --- a/test/built-ins/Temporal/Now/zonedDateTime/timezone-wrong-type.js +++ b/test/built-ins/Temporal/Now/zonedDateTime/timezone-wrong-type.js @@ -16,6 +16,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/Now/zonedDateTimeISO/timezone-wrong-type.js b/test/built-ins/Temporal/Now/zonedDateTimeISO/timezone-wrong-type.js index 1f992209c2..19f208c050 100644 --- a/test/built-ins/Temporal/Now/zonedDateTimeISO/timezone-wrong-type.js +++ b/test/built-ins/Temporal/Now/zonedDateTimeISO/timezone-wrong-type.js @@ -16,6 +16,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/PlainDate/compare/argument-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/PlainDate/compare/argument-propertybag-calendar-wrong-type.js index 04866d8831..41814c6015 100644 --- a/test/built-ins/Temporal/PlainDate/compare/argument-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/PlainDate/compare/argument-propertybag-calendar-wrong-type.js @@ -15,6 +15,7 @@ const rangeErrorTests = [ ["", "empty string"], [1, "number that doesn't convert to a valid ISO string"], [1n, "bigint"], + [new Temporal.TimeZone("UTC"), "time zone instance"], ]; for (const [calendar, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/timezone-wrong-type.js b/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/timezone-wrong-type.js index bfd5be2dad..cfeb1f3e00 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/timezone-wrong-type.js +++ b/test/built-ins/Temporal/PlainDate/prototype/toZonedDateTime/timezone-wrong-type.js @@ -18,6 +18,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/PlainDate/prototype/withCalendar/calendar-wrong-type.js b/test/built-ins/Temporal/PlainDate/prototype/withCalendar/calendar-wrong-type.js index 2587a1cac8..110b49a3e6 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/withCalendar/calendar-wrong-type.js +++ b/test/built-ins/Temporal/PlainDate/prototype/withCalendar/calendar-wrong-type.js @@ -17,10 +17,12 @@ const rangeErrorTests = [ ["", "empty string"], [1, "number that doesn't convert to a valid ISO string"], [1n, "bigint"], + [new Temporal.TimeZone("UTC"), "time zone instance"], ]; for (const [arg, description] of rangeErrorTests) { assert.throws(RangeError, () => instance.withCalendar(arg), `${description} does not convert to a valid ISO string`); + assert.throws(RangeError, () => instance.withCalendar({ calendar: arg }), `${description} does not convert to a valid ISO string (in property bag)`); } const typeErrorTests = [ @@ -29,4 +31,5 @@ const typeErrorTests = [ for (const [arg, description] of typeErrorTests) { assert.throws(TypeError, () => instance.withCalendar(arg), `${description} is not a valid object and does not convert to a string`); + assert.throws(TypeError, () => instance.withCalendar({ calendar: arg }), `${description} is not a valid object and does not convert to a string (in property bag)`); } diff --git a/test/built-ins/Temporal/PlainDateTime/compare/argument-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/PlainDateTime/compare/argument-propertybag-calendar-wrong-type.js index 139fa9eab5..5ef7ce833d 100644 --- a/test/built-ins/Temporal/PlainDateTime/compare/argument-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/PlainDateTime/compare/argument-propertybag-calendar-wrong-type.js @@ -15,6 +15,7 @@ const rangeErrorTests = [ ["", "empty string"], [1, "number that doesn't convert to a valid ISO string"], [1n, "bigint"], + [new Temporal.TimeZone("UTC"), "time zone instance"], ]; for (const [calendar, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/timezone-wrong-type.js b/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/timezone-wrong-type.js index 1fac66b7f9..22889a7132 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/timezone-wrong-type.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/toZonedDateTime/timezone-wrong-type.js @@ -18,6 +18,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/calendar-wrong-type.js b/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/calendar-wrong-type.js index e08a087f2b..d1573af2d1 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/calendar-wrong-type.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/calendar-wrong-type.js @@ -17,10 +17,12 @@ const rangeErrorTests = [ ["", "empty string"], [1, "number that doesn't convert to a valid ISO string"], [1n, "bigint"], + [new Temporal.TimeZone("UTC"), "time zone instance"], ]; for (const [arg, description] of rangeErrorTests) { assert.throws(RangeError, () => instance.withCalendar(arg), `${description} does not convert to a valid ISO string`); + assert.throws(RangeError, () => instance.withCalendar({ calendar: arg }), `${description} does not convert to a valid ISO string (in property bag)`); } const typeErrorTests = [ @@ -29,4 +31,5 @@ const typeErrorTests = [ for (const [arg, description] of typeErrorTests) { assert.throws(TypeError, () => instance.withCalendar(arg), `${description} is not a valid object and does not convert to a string`); + assert.throws(TypeError, () => instance.withCalendar({ calendar: arg }), `${description} is not a valid object and does not convert to a string (in property bag)`); } diff --git a/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/timezone-wrong-type.js b/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/timezone-wrong-type.js index 059326c6a2..304f4990b6 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/timezone-wrong-type.js +++ b/test/built-ins/Temporal/PlainTime/prototype/toZonedDateTime/timezone-wrong-type.js @@ -18,6 +18,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/PlainYearMonth/compare/argument-propertybag-calendar-wrong-type.js b/test/built-ins/Temporal/PlainYearMonth/compare/argument-propertybag-calendar-wrong-type.js index 387a03412d..778fd52742 100644 --- a/test/built-ins/Temporal/PlainYearMonth/compare/argument-propertybag-calendar-wrong-type.js +++ b/test/built-ins/Temporal/PlainYearMonth/compare/argument-propertybag-calendar-wrong-type.js @@ -15,6 +15,7 @@ const rangeErrorTests = [ ["", "empty string"], [1, "number that doesn't convert to a valid ISO string"], [1n, "bigint"], + [new Temporal.TimeZone("UTC"), "time zone instance"], ]; for (const [calendar, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/TimeZone/from/timezone-wrong-type.js b/test/built-ins/Temporal/TimeZone/from/timezone-wrong-type.js index c8351d1160..e834410c78 100644 --- a/test/built-ins/Temporal/TimeZone/from/timezone-wrong-type.js +++ b/test/built-ins/Temporal/TimeZone/from/timezone-wrong-type.js @@ -16,6 +16,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/calendar-wrong-type.js b/test/built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/calendar-wrong-type.js index 4fcd6b89d7..8c85e4e5d6 100644 --- a/test/built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/calendar-wrong-type.js +++ b/test/built-ins/Temporal/TimeZone/prototype/getPlainDateTimeFor/calendar-wrong-type.js @@ -17,10 +17,12 @@ const rangeErrorTests = [ ["", "empty string"], [1, "number that doesn't convert to a valid ISO string"], [1n, "bigint"], + [new Temporal.TimeZone("UTC"), "time zone instance"], ]; for (const [arg, description] of rangeErrorTests) { assert.throws(RangeError, () => instance.getPlainDateTimeFor(new Temporal.Instant(0n), arg), `${description} does not convert to a valid ISO string`); + assert.throws(RangeError, () => instance.getPlainDateTimeFor(new Temporal.Instant(0n), { calendar: arg }), `${description} does not convert to a valid ISO string (in property bag)`); } const typeErrorTests = [ @@ -29,4 +31,5 @@ const typeErrorTests = [ for (const [arg, description] of typeErrorTests) { assert.throws(TypeError, () => instance.getPlainDateTimeFor(new Temporal.Instant(0n), arg), `${description} is not a valid object and does not convert to a string`); + assert.throws(TypeError, () => instance.getPlainDateTimeFor(new Temporal.Instant(0n), { calendar: arg }), `${description} is not a valid object and does not convert to a string (in property bag)`); } 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 d542d4acd3..e226a10dda 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 @@ -17,6 +17,7 @@ const rangeErrorTests = [ ["", "empty string"], [1, "number that doesn't convert to a valid ISO string"], [1n, "bigint"], + [new Temporal.TimeZone("UTC"), "time zone instance"], ]; for (const [calendar, description] of rangeErrorTests) { 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 a2c34b5a4e..6ba49eac3e 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 @@ -18,6 +18,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-timezone-wrong-type.js b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-timezone-wrong-type.js index 1ad5649c81..a879d7f756 100644 --- a/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-timezone-wrong-type.js +++ b/test/built-ins/Temporal/ZonedDateTime/from/argument-propertybag-timezone-wrong-type.js @@ -16,6 +16,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { 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 6dc438b8ab..a122215527 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 @@ -18,6 +18,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { 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 6fb84b2ae6..da877e7a53 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 @@ -18,6 +18,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { 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 53f4330b9a..7d752202d6 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 @@ -18,6 +18,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) { diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/calendar-wrong-type.js b/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/calendar-wrong-type.js index d4f8e996a1..ffd81eb7e7 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/calendar-wrong-type.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/withCalendar/calendar-wrong-type.js @@ -17,10 +17,12 @@ const rangeErrorTests = [ ["", "empty string"], [1, "number that doesn't convert to a valid ISO string"], [1n, "bigint"], + [new Temporal.TimeZone("UTC"), "time zone instance"], ]; for (const [arg, description] of rangeErrorTests) { assert.throws(RangeError, () => instance.withCalendar(arg), `${description} does not convert to a valid ISO string`); + assert.throws(RangeError, () => instance.withCalendar({ calendar: arg }), `${description} does not convert to a valid ISO string (in property bag)`); } const typeErrorTests = [ @@ -29,4 +31,5 @@ const typeErrorTests = [ for (const [arg, description] of typeErrorTests) { assert.throws(TypeError, () => instance.withCalendar(arg), `${description} is not a valid object and does not convert to a string`); + assert.throws(TypeError, () => instance.withCalendar({ calendar: arg }), `${description} is not a valid object and does not convert to a string (in property bag)`); } 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 ccb404ce43..12c59e6ba8 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 @@ -18,6 +18,7 @@ const rangeErrorTests = [ [1, "number that doesn't convert to a valid ISO string"], [19761118, "number that would convert to a valid ISO string in other contexts"], [1n, "bigint"], + [new Temporal.Calendar("iso8601"), "calendar instance"], ]; for (const [timeZone, description] of rangeErrorTests) {