diff --git a/harness/temporalHelpers.js b/harness/temporalHelpers.js index fa6a2db476..9859291b65 100644 --- a/harness/temporalHelpers.js +++ b/harness/temporalHelpers.js @@ -9,11 +9,6 @@ features: [Symbol.species, Symbol.iterator, Temporal] const ASCII_IDENTIFIER = /^[$_a-zA-Z][$_a-zA-Z0-9]*$/u; -let nonDefaultCalendarId = undefined; -try { - nonDefaultCalendarId = Temporal.Calendar.from("hebrew").id; -} catch (err) {} - function formatPropertyName(propertyKey, objectName = "") { switch (typeof propertyKey) { case "symbol": @@ -41,8 +36,6 @@ function formatPropertyName(propertyKey, objectName = "") { const SKIP_SYMBOL = Symbol("Skip"); var TemporalHelpers = { - nonDefaultCalendarId, - /* * Codes and maximum lengths of months in the ISO 8601 calendar. */ diff --git a/test/built-ins/Temporal/PlainMonthDay/from/fields-missing-properties.js b/test/built-ins/Temporal/PlainMonthDay/from/fields-missing-properties.js index e584c47a2b..1b932bc599 100644 --- a/test/built-ins/Temporal/PlainMonthDay/from/fields-missing-properties.js +++ b/test/built-ins/Temporal/PlainMonthDay/from/fields-missing-properties.js @@ -4,7 +4,6 @@ /*--- esid: sec-temporal.plainmonthday.from description: Basic tests for PlainMonthDay.from(object) with missing properties. -includes: [temporalHelpers.js] features: [Temporal] ---*/ @@ -13,7 +12,3 @@ assert.throws(TypeError, () => Temporal.PlainMonthDay.from({ day: 15 }), "Only d assert.throws(TypeError, () => Temporal.PlainMonthDay.from({ monthCode: 'M12' }), "Only monthCode"); assert.throws(TypeError, () => Temporal.PlainMonthDay.from({ monthCode: undefined, day: 15 }), "monthCode undefined"); assert.throws(TypeError, () => Temporal.PlainMonthDay.from({ months: 12, day: 31 }), "months plural"); - -if (TemporalHelpers.nonDefaultCalendarId) { - assert.throws(TypeError, () => Temporal.PlainMonthDay.from({ month: 11, day: 18, calendar: TemporalHelpers.nonDefaultCalendarId }), "month, day with non-iso8601 calendar"); -} diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/with/basic.js b/test/built-ins/Temporal/PlainMonthDay/prototype/with/basic.js index a2174ee04d..c596af7b6b 100644 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/with/basic.js +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/with/basic.js @@ -39,8 +39,3 @@ assert.throws(TypeError, () => md.with({ months: 12 }), "with({months})"); TemporalHelpers.assertPlainMonthDay(md.with({ monthCode: "M12", days: 1 }), "M12", 15, "with({monthCode, days})"); - -if (TemporalHelpers.nonDefaultCalendarId) { - const calendarMonthDay = Temporal.PlainMonthDay.from({ year: 2021, month: 1, day: 15, calendar: TemporalHelpers.nonDefaultCalendarId }); - assert.throws(TypeError, () => calendarMonthDay.with({ month: 12 }), "nonIso8601MonthDay.with({month})"); -} diff --git a/test/intl402/Temporal/PlainMonthDay/from/fields-missing-properties.js b/test/intl402/Temporal/PlainMonthDay/from/fields-missing-properties.js new file mode 100644 index 0000000000..5d21db02df --- /dev/null +++ b/test/intl402/Temporal/PlainMonthDay/from/fields-missing-properties.js @@ -0,0 +1,12 @@ +// Copyright (C) 2023 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plainmonthday.from +description: > + Basic tests for PlainMonthDay.from(object) with missing properties for non-ISO + calendars +features: [Temporal] +---*/ + +assert.throws(TypeError, () => Temporal.PlainMonthDay.from({ month: 11, day: 18, calendar: "gregory" }), "month, day with non-iso8601 calendar"); diff --git a/test/intl402/Temporal/PlainMonthDay/prototype/with/fields-missing-properties.js b/test/intl402/Temporal/PlainMonthDay/prototype/with/fields-missing-properties.js new file mode 100644 index 0000000000..79ea632f98 --- /dev/null +++ b/test/intl402/Temporal/PlainMonthDay/prototype/with/fields-missing-properties.js @@ -0,0 +1,12 @@ +// Copyright (C) 2023 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-temporal.plainmonthday.prototype.with +description: > + Basic tests for with(object) with missing properties for non-ISO calendars +features: [Temporal] +---*/ + +const calendarMonthDay = Temporal.PlainMonthDay.from({ year: 2021, month: 1, day: 15, calendar: "gregory" }); +assert.throws(TypeError, () => calendarMonthDay.with({ month: 12 }), "nonIso8601MonthDay.with({month})");