Temporal: fix property bag order

No big deal, this was just bothering me that I wrote timeZone before
calendar in most of the tests, and vice versa in only a few.
This commit is contained in:
Philip Chimento 2022-04-22 16:36:55 -07:00 committed by Ms2ger
parent 88a4cf4af7
commit 020faf5c7a
4 changed files with 16 additions and 17 deletions

View File

@ -10,12 +10,11 @@ features: [Temporal]
const calendar = 19970327;
const timeZone = new Temporal.TimeZone("UTC");
let arg = { year: 1970, monthCode: "M01", day: 1, calendar, timeZone };
let arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar };
const result1 = Temporal.ZonedDateTime.from(arg);
assert.sameValue(result1.calendar.id, "iso8601", "19970327 is a valid ISO string for calendar");
arg = { year: 1970, monthCode: "M01", day: 1, calendar: { calendar }, timeZone };
arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar: { calendar } };
const result2 = Temporal.ZonedDateTime.from(arg);
assert.sameValue(result2.calendar.id, "iso8601", "19970327 is a valid ISO string for calendar (nested property)");
@ -26,13 +25,13 @@ const numbers = [
];
for (const calendar of numbers) {
let arg = { year: 1970, monthCode: "M01", day: 1, calendar, timeZone };
let arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar };
assert.throws(
RangeError,
() => Temporal.ZonedDateTime.from(arg),
`Number ${calendar} does not convert to a valid ISO string for calendar`
);
arg = { year: 1970, monthCode: "M01", day: 1, calendar: { calendar }, timeZone };
arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar: { calendar } };
assert.throws(
RangeError,
() => Temporal.ZonedDateTime.from(arg),

View File

@ -12,11 +12,11 @@ const instance = new Temporal.ZonedDateTime(0n, timeZone);
const calendar = 19970327;
let arg = { year: 1970, monthCode: "M01", day: 1, calendar, timeZone };
let arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar };
const result1 = instance.equals(arg);
assert.sameValue(result1, true, "19970327 is a valid ISO string for calendar");
arg = { year: 1970, monthCode: "M01", day: 1, calendar: { calendar }, timeZone };
arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar: { calendar } };
const result2 = instance.equals(arg);
assert.sameValue(result2, true, "19970327 is a valid ISO string for calendar (nested property)");
@ -27,13 +27,13 @@ const numbers = [
];
for (const calendar of numbers) {
let arg = { year: 1970, monthCode: "M01", day: 1, calendar, timeZone };
let arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar };
assert.throws(
RangeError,
() => instance.equals(arg),
`Number ${calendar} does not convert to a valid ISO string for calendar`
);
arg = { year: 1970, monthCode: "M01", day: 1, calendar: { calendar }, timeZone };
arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar: { calendar } };
assert.throws(
RangeError,
() => instance.equals(arg),

View File

@ -13,11 +13,11 @@ const instance = new Temporal.ZonedDateTime(0n, timeZone);
const calendar = 19970327;
let arg = { year: 1970, monthCode: "M01", day: 1, calendar, timeZone };
let arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar };
const result1 = instance.since(arg);
TemporalHelpers.assertDuration(result1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "19970327 is a valid ISO string for calendar");
arg = { year: 1970, monthCode: "M01", day: 1, calendar: { calendar }, timeZone };
arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar: { calendar } };
const result2 = instance.since(arg);
TemporalHelpers.assertDuration(result2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "19970327 is a valid ISO string for calendar (nested property)");
@ -28,13 +28,13 @@ const numbers = [
];
for (const calendar of numbers) {
let arg = { year: 1970, monthCode: "M01", day: 1, calendar, timeZone };
let arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar };
assert.throws(
RangeError,
() => instance.since(arg),
`Number ${calendar} does not convert to a valid ISO string for calendar`
);
arg = { year: 1970, monthCode: "M01", day: 1, calendar: { calendar }, timeZone };
arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar: { calendar } };
assert.throws(
RangeError,
() => instance.since(arg),

View File

@ -13,11 +13,11 @@ const instance = new Temporal.ZonedDateTime(0n, timeZone);
const calendar = 19970327;
let arg = { year: 1970, monthCode: "M01", day: 1, calendar, timeZone };
let arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar };
const result1 = instance.until(arg);
TemporalHelpers.assertDuration(result1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "19970327 is a valid ISO string for calendar");
arg = { year: 1970, monthCode: "M01", day: 1, calendar: { calendar }, timeZone };
arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar: { calendar } };
const result2 = instance.until(arg);
TemporalHelpers.assertDuration(result2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "19970327 is a valid ISO string for calendar (nested property)");
@ -28,13 +28,13 @@ const numbers = [
];
for (const calendar of numbers) {
let arg = { year: 1970, monthCode: "M01", day: 1, calendar, timeZone };
let arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar };
assert.throws(
RangeError,
() => instance.until(arg),
`Number ${calendar} does not convert to a valid ISO string for calendar`
);
arg = { year: 1970, monthCode: "M01", day: 1, calendar: { calendar }, timeZone };
arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar: { calendar } };
assert.throws(
RangeError,
() => instance.until(arg),