mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 22:15:24 +02:00
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:
parent
88a4cf4af7
commit
020faf5c7a
@ -10,12 +10,11 @@ features: [Temporal]
|
|||||||
const calendar = 19970327;
|
const calendar = 19970327;
|
||||||
|
|
||||||
const timeZone = new Temporal.TimeZone("UTC");
|
const timeZone = new Temporal.TimeZone("UTC");
|
||||||
|
let arg = { year: 1970, monthCode: "M01", day: 1, timeZone, calendar };
|
||||||
let arg = { year: 1970, monthCode: "M01", day: 1, calendar, timeZone };
|
|
||||||
const result1 = Temporal.ZonedDateTime.from(arg);
|
const result1 = Temporal.ZonedDateTime.from(arg);
|
||||||
assert.sameValue(result1.calendar.id, "iso8601", "19970327 is a valid ISO string for calendar");
|
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);
|
const result2 = Temporal.ZonedDateTime.from(arg);
|
||||||
assert.sameValue(result2.calendar.id, "iso8601", "19970327 is a valid ISO string for calendar (nested property)");
|
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) {
|
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(
|
assert.throws(
|
||||||
RangeError,
|
RangeError,
|
||||||
() => Temporal.ZonedDateTime.from(arg),
|
() => Temporal.ZonedDateTime.from(arg),
|
||||||
`Number ${calendar} does not convert to a valid ISO string for calendar`
|
`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(
|
assert.throws(
|
||||||
RangeError,
|
RangeError,
|
||||||
() => Temporal.ZonedDateTime.from(arg),
|
() => Temporal.ZonedDateTime.from(arg),
|
||||||
|
@ -12,11 +12,11 @@ const instance = new Temporal.ZonedDateTime(0n, timeZone);
|
|||||||
|
|
||||||
const calendar = 19970327;
|
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);
|
const result1 = instance.equals(arg);
|
||||||
assert.sameValue(result1, true, "19970327 is a valid ISO string for calendar");
|
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);
|
const result2 = instance.equals(arg);
|
||||||
assert.sameValue(result2, true, "19970327 is a valid ISO string for calendar (nested property)");
|
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) {
|
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(
|
assert.throws(
|
||||||
RangeError,
|
RangeError,
|
||||||
() => instance.equals(arg),
|
() => instance.equals(arg),
|
||||||
`Number ${calendar} does not convert to a valid ISO string for calendar`
|
`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(
|
assert.throws(
|
||||||
RangeError,
|
RangeError,
|
||||||
() => instance.equals(arg),
|
() => instance.equals(arg),
|
||||||
|
@ -13,11 +13,11 @@ const instance = new Temporal.ZonedDateTime(0n, timeZone);
|
|||||||
|
|
||||||
const calendar = 19970327;
|
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);
|
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");
|
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);
|
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)");
|
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) {
|
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(
|
assert.throws(
|
||||||
RangeError,
|
RangeError,
|
||||||
() => instance.since(arg),
|
() => instance.since(arg),
|
||||||
`Number ${calendar} does not convert to a valid ISO string for calendar`
|
`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(
|
assert.throws(
|
||||||
RangeError,
|
RangeError,
|
||||||
() => instance.since(arg),
|
() => instance.since(arg),
|
||||||
|
@ -13,11 +13,11 @@ const instance = new Temporal.ZonedDateTime(0n, timeZone);
|
|||||||
|
|
||||||
const calendar = 19970327;
|
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);
|
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");
|
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);
|
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)");
|
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) {
|
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(
|
assert.throws(
|
||||||
RangeError,
|
RangeError,
|
||||||
() => instance.until(arg),
|
() => instance.until(arg),
|
||||||
`Number ${calendar} does not convert to a valid ISO string for calendar`
|
`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(
|
assert.throws(
|
||||||
RangeError,
|
RangeError,
|
||||||
() => instance.until(arg),
|
() => instance.until(arg),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user