Temporal: Look up time zone methods only once

This commit is contained in:
Philip Chimento 2023-03-10 22:38:58 -08:00 committed by Philip Chimento
parent c1281dba45
commit 911fe9612e
28 changed files with 141 additions and 288 deletions

View File

@ -260,9 +260,9 @@ const expectedOpsForZonedRelativeTo = expected.concat([
"has options.relativeTo.timeZone.getOffsetNanosecondsFor", "has options.relativeTo.timeZone.getOffsetNanosecondsFor",
"has options.relativeTo.timeZone.getPossibleInstantsFor", "has options.relativeTo.timeZone.getPossibleInstantsFor",
"has options.relativeTo.timeZone.id", "has options.relativeTo.timeZone.id",
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"get options.relativeTo.timeZone.getPossibleInstantsFor", "get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
]); ]);
@ -291,13 +291,10 @@ Temporal.Duration.compare(
assert.compareArray( assert.compareArray(
actual, actual,
expectedOpsForZonedRelativeTo.concat([ expectedOpsForZonedRelativeTo.concat([
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// AddDaysToZonedDateTime on first argument // AddDaysToZonedDateTime on first argument
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
// AddDaysToZonedDateTime on second argument // AddDaysToZonedDateTime on second argument
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
]), ]),
"order of operations with ZonedDateTime relativeTo and no calendar units except days" "order of operations with ZonedDateTime relativeTo and no calendar units except days"
@ -326,17 +323,14 @@ Temporal.Duration.compare(
assert.compareArray( assert.compareArray(
actual, actual,
expectedOpsForZonedRelativeTo.concat([ expectedOpsForZonedRelativeTo.concat([
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// AddZonedDateTime on first argument // AddZonedDateTime on first argument
"get options.relativeTo.calendar.dateAdd", "get options.relativeTo.calendar.dateAdd",
"call options.relativeTo.calendar.dateAdd", "call options.relativeTo.calendar.dateAdd",
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
// AddZonedDateTime on second argument // AddZonedDateTime on second argument
"get options.relativeTo.calendar.dateAdd", "get options.relativeTo.calendar.dateAdd",
"call options.relativeTo.calendar.dateAdd", "call options.relativeTo.calendar.dateAdd",
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
]), ]),
"order of operations with ZonedDateTime relativeTo and calendar units" "order of operations with ZonedDateTime relativeTo and calendar units"

View File

@ -58,17 +58,17 @@ const expected = [
"has timeZone.getOffsetNanosecondsFor", "has timeZone.getOffsetNanosecondsFor",
"has timeZone.getPossibleInstantsFor", "has timeZone.getPossibleInstantsFor",
"has timeZone.id", "has timeZone.id",
// lookup
"get timeZone.getOffsetNanosecondsFor",
"get timeZone.getPossibleInstantsFor",
// InterpretISODateTimeOffset
"call timeZone.getPossibleInstantsFor",
]; ];
const expectedSpringForward = expected.concat([ const expectedSpringForward = expected.concat([
// InterpretISODateTimeOffset
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor",
// DisambiguatePossibleInstants // DisambiguatePossibleInstants
"get timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor", "call timeZone.getPossibleInstantsFor",
]); ]);
assert.compareArray( assert.compareArray(
@ -81,14 +81,9 @@ actual.splice(0); // clear
relativeTo = { year: 2000, month: 10, day: 29, hour: 1, minute: 30, timeZone: dstTimeZoneObserver, calendar }; relativeTo = { year: 2000, month: 10, day: 29, hour: 1, minute: 30, timeZone: dstTimeZoneObserver, calendar };
Temporal.Duration.compare(duration1, duration2, {relativeTo: relativeTo}); Temporal.Duration.compare(duration1, duration2, {relativeTo: relativeTo});
const expectedFallBack = expected.concat([
// InterpretISODateTimeOffset
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor",
]);
assert.compareArray( assert.compareArray(
actual.slice(0, expectedFallBack.length), // ignore operations after ToRelativeTemporalObject actual.slice(0, expected.length), // ignore operations after ToRelativeTemporalObject
expectedFallBack, expected,
"order of operations converting property bag at repeated wall-clock time" "order of operations converting property bag at repeated wall-clock time"
); );
actual.splice(0); // clear actual.splice(0); // clear

View File

@ -316,27 +316,22 @@ const expectedOpsForZonedRelativeTo = expected.concat([
"has options.relativeTo.timeZone.getPossibleInstantsFor", "has options.relativeTo.timeZone.getPossibleInstantsFor",
"has options.relativeTo.timeZone.id", "has options.relativeTo.timeZone.id",
// InterpretISODateTimeOffset // InterpretISODateTimeOffset
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"get options.relativeTo.timeZone.getPossibleInstantsFor", "get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// AddDuration // AddDuration
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// AddDuration → AddZonedDateTime 1 // AddDuration → AddZonedDateTime 1
"get options.relativeTo.calendar.dateAdd", "get options.relativeTo.calendar.dateAdd",
"call options.relativeTo.calendar.dateAdd", "call options.relativeTo.calendar.dateAdd",
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
// AddDuration → AddZonedDateTime 2 // AddDuration → AddZonedDateTime 2
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
"get options.relativeTo.calendar.dateAdd", "get options.relativeTo.calendar.dateAdd",
"call options.relativeTo.calendar.dateAdd", "call options.relativeTo.calendar.dateAdd",
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
// AddDuration → DifferenceZonedDateTime // AddDuration → DifferenceZonedDateTime
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// AddDuration → DifferenceZonedDateTime → DifferenceISODateTime // AddDuration → DifferenceZonedDateTime → DifferenceISODateTime
"get options.relativeTo.calendar.dateUntil", "get options.relativeTo.calendar.dateUntil",
@ -344,18 +339,13 @@ const expectedOpsForZonedRelativeTo = expected.concat([
// AddDuration → DifferenceZonedDateTime → AddZonedDateTime // AddDuration → DifferenceZonedDateTime → AddZonedDateTime
"get options.relativeTo.calendar.dateAdd", "get options.relativeTo.calendar.dateAdd",
"call options.relativeTo.calendar.dateAdd", "call options.relativeTo.calendar.dateAdd",
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
// AddDuration → DifferenceZonedDateTime → NanosecondsToDays // AddDuration → DifferenceZonedDateTime → NanosecondsToDays
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// AddDuration → DifferenceZonedDateTime → NanosecondsToDays → AddZonedDateTime 1 // AddDuration → DifferenceZonedDateTime → NanosecondsToDays → AddZonedDateTime 1
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
// AddDuration → DifferenceZonedDateTime → NanosecondsToDays → AddZonedDateTime 2 // AddDuration → DifferenceZonedDateTime → NanosecondsToDays → AddZonedDateTime 2
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
]); ]);

View File

@ -57,17 +57,17 @@ const expected = [
"has timeZone.getOffsetNanosecondsFor", "has timeZone.getOffsetNanosecondsFor",
"has timeZone.getPossibleInstantsFor", "has timeZone.getPossibleInstantsFor",
"has timeZone.id", "has timeZone.id",
// lookup
"get timeZone.getOffsetNanosecondsFor",
"get timeZone.getPossibleInstantsFor",
// InterpretISODateTimeOffset
"call timeZone.getPossibleInstantsFor",
]; ];
const expectedSpringForward = expected.concat([ const expectedSpringForward = expected.concat([
// InterpretISODateTimeOffset
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor",
// DisambiguatePossibleInstants // DisambiguatePossibleInstants
"get timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor", "call timeZone.getPossibleInstantsFor",
]); ]);
assert.compareArray( assert.compareArray(
@ -80,14 +80,9 @@ actual.splice(0); // clear
relativeTo = { year: 2000, month: 10, day: 29, hour: 1, minute: 30, timeZone: dstTimeZoneObserver, calendar }; relativeTo = { year: 2000, month: 10, day: 29, hour: 1, minute: 30, timeZone: dstTimeZoneObserver, calendar };
instance.add(new Temporal.Duration(0, 0, 0, 0, -24), { relativeTo }); instance.add(new Temporal.Duration(0, 0, 0, 0, -24), { relativeTo });
const expectedFallBack = expected.concat([
// InterpretISODateTimeOffset
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor",
]);
assert.compareArray( assert.compareArray(
actual.slice(0, expectedFallBack.length), // ignore operations after ToRelativeTemporalObject actual.slice(0, expected.length), // ignore operations after ToRelativeTemporalObject
expectedFallBack, expected,
"order of operations converting property bag at repeated wall-clock time" "order of operations converting property bag at repeated wall-clock time"
); );
actual.splice(0); // clear actual.splice(0); // clear

View File

@ -333,10 +333,10 @@ const expectedOpsForZonedRelativeTo = [
"has options.relativeTo.timeZone.getOffsetNanosecondsFor", "has options.relativeTo.timeZone.getOffsetNanosecondsFor",
"has options.relativeTo.timeZone.getPossibleInstantsFor", "has options.relativeTo.timeZone.getPossibleInstantsFor",
"has options.relativeTo.timeZone.id", "has options.relativeTo.timeZone.id",
// InterpretISODateTimeOffset
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor",
"get options.relativeTo.timeZone.getOffsetNanosecondsFor", "get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"get options.relativeTo.timeZone.getPossibleInstantsFor",
// InterpretISODateTimeOffset
"call options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
"get options.roundingIncrement", "get options.roundingIncrement",
"get options.roundingIncrement.valueOf", "get options.roundingIncrement.valueOf",
@ -373,18 +373,13 @@ actual.splice(0); // clear
// code path through RoundDuration that rounds to the nearest year with minimal calendar operations: // code path through RoundDuration that rounds to the nearest year with minimal calendar operations:
const expectedOpsForMinimalYearRoundingZoned = expectedOpsForZonedRelativeTo.concat([ const expectedOpsForMinimalYearRoundingZoned = expectedOpsForZonedRelativeTo.concat([
// ToTemporalDate // ToTemporalDate
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// NanosecondsToDays // NanosecondsToDays
"get options.relativeTo.timeZone.getOffsetNanosecondsFor", // 7. GetPlainDateTimeFor "call options.relativeTo.timeZone.getOffsetNanosecondsFor", // 7. GetPlainDateTimeFor
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor", // 11. GetPlainDateTimeFor
"get options.relativeTo.timeZone.getOffsetNanosecondsFor", // 11. GetPlainDateTimeFor
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// NanosecondsToDays → AddDaysToZonedDateTime // NanosecondsToDays → AddDaysToZonedDateTime
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
// NanosecondsToDays → AddDaysToZonedDateTime // NanosecondsToDays → AddDaysToZonedDateTime
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
// RoundDuration // RoundDuration
"get options.relativeTo.calendar.dateAdd", // 7.c "get options.relativeTo.calendar.dateAdd", // 7.c
@ -405,23 +400,17 @@ actual.splice(0); // clear
// code path through RoundDuration that rounds to the nearest year: // code path through RoundDuration that rounds to the nearest year:
const expectedOpsForYearRoundingZoned = expectedOpsForZonedRelativeTo.concat([ const expectedOpsForYearRoundingZoned = expectedOpsForZonedRelativeTo.concat([
// ToTemporalDate // ToTemporalDate
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// MoveRelativeZonedDateTime → AddZonedDateTime // MoveRelativeZonedDateTime → AddZonedDateTime
"get options.relativeTo.calendar.dateAdd", "get options.relativeTo.calendar.dateAdd",
"call options.relativeTo.calendar.dateAdd", "call options.relativeTo.calendar.dateAdd",
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
// NanosecondsToDays // NanosecondsToDays
"get options.relativeTo.timeZone.getOffsetNanosecondsFor", // 7. GetPlainDateTimeFor "call options.relativeTo.timeZone.getOffsetNanosecondsFor", // 8. GetPlainDateTimeFor
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor", // 9. GetPlainDateTimeFor
"get options.relativeTo.timeZone.getOffsetNanosecondsFor", // 11. GetPlainDateTimeFor
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// NanosecondsToDays → AddDaysToZonedDateTime // NanosecondsToDays → AddDaysToZonedDateTime
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
// NanosecondsToDays → AddDaysToZonedDateTime // NanosecondsToDays → AddDaysToZonedDateTime
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
"get options.relativeTo.calendar.dateAdd", // 7.c "get options.relativeTo.calendar.dateAdd", // 7.c
"call options.relativeTo.calendar.dateAdd", // 7.e "call options.relativeTo.calendar.dateAdd", // 7.e
@ -450,14 +439,12 @@ actual.splice(0); // clear
// BalanceDateDurationRelative // BalanceDateDurationRelative
const expectedOpsForUnbalanceRoundBalance = expectedOpsForZonedRelativeTo.concat([ const expectedOpsForUnbalanceRoundBalance = expectedOpsForZonedRelativeTo.concat([
// ToTemporalDate // ToTemporalDate
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// No user code calls in UnbalanceDurationRelative // No user code calls in UnbalanceDurationRelative
// RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime // RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime
"get options.relativeTo.calendar.dateAdd", // 8. "get options.relativeTo.calendar.dateAdd", // 11.
"call options.relativeTo.calendar.dateAdd", "call options.relativeTo.calendar.dateAdd",
"get options.relativeTo.timeZone.getPossibleInstantsFor", // 10. GetInstantFor "call options.relativeTo.timeZone.getPossibleInstantsFor", // 13. GetInstantFor
"call options.relativeTo.timeZone.getPossibleInstantsFor",
// RoundDuration // RoundDuration
"get options.relativeTo.calendar.dateAdd", // 8.e.i "get options.relativeTo.calendar.dateAdd", // 8.e.i
"call options.relativeTo.calendar.dateAdd", // 8.g MoveRelativeDate "call options.relativeTo.calendar.dateAdd", // 8.g MoveRelativeDate

View File

@ -57,17 +57,17 @@ const expected = [
"has timeZone.getOffsetNanosecondsFor", "has timeZone.getOffsetNanosecondsFor",
"has timeZone.getPossibleInstantsFor", "has timeZone.getPossibleInstantsFor",
"has timeZone.id", "has timeZone.id",
// lookup
"get timeZone.getOffsetNanosecondsFor",
"get timeZone.getPossibleInstantsFor",
// InterpretISODateTimeOffset
"call timeZone.getPossibleInstantsFor",
]; ];
const expectedSpringForward = expected.concat([ const expectedSpringForward = expected.concat([
// InterpretISODateTimeOffset
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor",
// DisambiguatePossibleInstants // DisambiguatePossibleInstants
"get timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor", "call timeZone.getPossibleInstantsFor",
]); ]);
assert.compareArray( assert.compareArray(
@ -80,14 +80,9 @@ actual.splice(0); // clear
relativeTo = { year: 2000, month: 10, day: 29, hour: 1, minute: 30, timeZone: dstTimeZoneObserver, calendar }; relativeTo = { year: 2000, month: 10, day: 29, hour: 1, minute: 30, timeZone: dstTimeZoneObserver, calendar };
instance.round({ largestUnit: "years", relativeTo }); instance.round({ largestUnit: "years", relativeTo });
const expectedFallBack = expected.concat([
// InterpretISODateTimeOffset
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor",
]);
assert.compareArray( assert.compareArray(
actual.slice(0, expectedFallBack.length), // ignore operations after ToRelativeTemporalObject actual.slice(0, expected.length), // ignore operations after ToRelativeTemporalObject
expectedFallBack, expected,
"order of operations converting property bag at repeated wall-clock time" "order of operations converting property bag at repeated wall-clock time"
); );
actual.splice(0); // clear actual.splice(0); // clear

View File

@ -316,27 +316,22 @@ const expectedOpsForZonedRelativeTo = expected.concat([
"has options.relativeTo.timeZone.getPossibleInstantsFor", "has options.relativeTo.timeZone.getPossibleInstantsFor",
"has options.relativeTo.timeZone.id", "has options.relativeTo.timeZone.id",
// InterpretISODateTimeOffset // InterpretISODateTimeOffset
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"get options.relativeTo.timeZone.getPossibleInstantsFor", "get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// AddDuration // AddDuration
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// AddDuration → AddZonedDateTime 1 // AddDuration → AddZonedDateTime 1
"get options.relativeTo.calendar.dateAdd", "get options.relativeTo.calendar.dateAdd",
"call options.relativeTo.calendar.dateAdd", "call options.relativeTo.calendar.dateAdd",
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
// AddDuration → AddZonedDateTime 2 // AddDuration → AddZonedDateTime 2
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
"get options.relativeTo.calendar.dateAdd", "get options.relativeTo.calendar.dateAdd",
"call options.relativeTo.calendar.dateAdd", "call options.relativeTo.calendar.dateAdd",
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
// AddDuration → DifferenceZonedDateTime // AddDuration → DifferenceZonedDateTime
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// AddDuration → DifferenceZonedDateTime → DifferenceISODateTime // AddDuration → DifferenceZonedDateTime → DifferenceISODateTime
"get options.relativeTo.calendar.dateUntil", "get options.relativeTo.calendar.dateUntil",
@ -344,18 +339,13 @@ const expectedOpsForZonedRelativeTo = expected.concat([
// AddDuration → DifferenceZonedDateTime → AddZonedDateTime // AddDuration → DifferenceZonedDateTime → AddZonedDateTime
"get options.relativeTo.calendar.dateAdd", "get options.relativeTo.calendar.dateAdd",
"call options.relativeTo.calendar.dateAdd", "call options.relativeTo.calendar.dateAdd",
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
// AddDuration → DifferenceZonedDateTime → NanosecondsToDays // AddDuration → DifferenceZonedDateTime → NanosecondsToDays
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// AddDuration → DifferenceZonedDateTime → NanosecondsToDays → AddZonedDateTime 1 // AddDuration → DifferenceZonedDateTime → NanosecondsToDays → AddZonedDateTime 1
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
// AddDuration → DifferenceZonedDateTime → NanosecondsToDays → AddZonedDateTime 2 // AddDuration → DifferenceZonedDateTime → NanosecondsToDays → AddZonedDateTime 2
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
]); ]);

View File

@ -57,17 +57,17 @@ const expected = [
"has timeZone.getOffsetNanosecondsFor", "has timeZone.getOffsetNanosecondsFor",
"has timeZone.getPossibleInstantsFor", "has timeZone.getPossibleInstantsFor",
"has timeZone.id", "has timeZone.id",
// lookup
"get timeZone.getOffsetNanosecondsFor",
"get timeZone.getPossibleInstantsFor",
// InterpretISODateTimeOffset
"call timeZone.getPossibleInstantsFor",
]; ];
const expectedSpringForward = expected.concat([ const expectedSpringForward = expected.concat([
// InterpretISODateTimeOffset
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor",
// DisambiguatePossibleInstants // DisambiguatePossibleInstants
"get timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor", "call timeZone.getPossibleInstantsFor",
]); ]);
assert.compareArray( assert.compareArray(
@ -80,14 +80,9 @@ actual.splice(0); // clear
relativeTo = { year: 2000, month: 10, day: 29, hour: 1, minute: 30, timeZone: dstTimeZoneObserver, calendar }; relativeTo = { year: 2000, month: 10, day: 29, hour: 1, minute: 30, timeZone: dstTimeZoneObserver, calendar };
instance.subtract(new Temporal.Duration(0, 0, 0, 0, 24), { relativeTo }); instance.subtract(new Temporal.Duration(0, 0, 0, 0, 24), { relativeTo });
const expectedFallBack = expected.concat([
// InterpretISODateTimeOffset
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor",
]);
assert.compareArray( assert.compareArray(
actual.slice(0, expectedFallBack.length), // ignore operations after ToRelativeTemporalObject actual.slice(0, expected.length), // ignore operations after ToRelativeTemporalObject
expectedFallBack, expected,
"order of operations converting property bag at repeated wall-clock time" "order of operations converting property bag at repeated wall-clock time"
); );
actual.splice(0); // clear actual.splice(0); // clear

View File

@ -239,10 +239,10 @@ const expectedOpsForZonedRelativeTo = [
"has options.relativeTo.timeZone.getOffsetNanosecondsFor", "has options.relativeTo.timeZone.getOffsetNanosecondsFor",
"has options.relativeTo.timeZone.getPossibleInstantsFor", "has options.relativeTo.timeZone.getPossibleInstantsFor",
"has options.relativeTo.timeZone.id", "has options.relativeTo.timeZone.id",
// InterpretISODateTimeOffset
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor",
"get options.relativeTo.timeZone.getOffsetNanosecondsFor", "get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"get options.relativeTo.timeZone.getPossibleInstantsFor",
// InterpretISODateTimeOffset
"call options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// GetTemporalUnit // GetTemporalUnit
"get options.unit", "get options.unit",
@ -274,23 +274,17 @@ actual.splice(0); // clear
// code path through RoundDuration that rounds to the nearest year with minimal calendar operations: // code path through RoundDuration that rounds to the nearest year with minimal calendar operations:
const expectedOpsForMinimalYearRoundingZoned = expectedOpsForZonedRelativeTo.concat([ const expectedOpsForMinimalYearRoundingZoned = expectedOpsForZonedRelativeTo.concat([
// ToTemporalDate // ToTemporalDate
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// BalancePossiblyInfiniteDuration → NanosecondsToDays // BalancePossiblyInfiniteDuration → NanosecondsToDays
"get options.relativeTo.timeZone.getOffsetNanosecondsFor", // 7. GetPlainDateTimeFor "call options.relativeTo.timeZone.getOffsetNanosecondsFor", // 7. GetPlainDateTimeFor
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor", // 11. GetPlainDateTimeFor
"get options.relativeTo.timeZone.getOffsetNanosecondsFor", // 11. GetPlainDateTimeFor
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// BalancePossiblyInfiniteDuration → NanosecondsToDays → AddDaysToZonedDateTime // BalancePossiblyInfiniteDuration → NanosecondsToDays → AddDaysToZonedDateTime
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
// BalancePossiblyInfiniteDuration → NanosecondsToDays → AddDaysToZonedDateTime // BalancePossiblyInfiniteDuration → NanosecondsToDays → AddDaysToZonedDateTime
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
], [ ], [
// code path through RoundDuration that rounds to the nearest year: // code path through RoundDuration that rounds to the nearest year:
// MoveRelativeZonedDateTime → AddDaysToZonedDateTime // MoveRelativeZonedDateTime → AddDaysToZonedDateTime
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
"get options.relativeTo.calendar.dateAdd", // 7.c "get options.relativeTo.calendar.dateAdd", // 7.c
// 7.e and 7.g not called because years, months, weeks are 0 // 7.e and 7.g not called because years, months, weeks are 0
@ -310,28 +304,21 @@ actual.splice(0); // clear
// code path through RoundDuration that rounds to the nearest year: // code path through RoundDuration that rounds to the nearest year:
const expectedOpsForYearRoundingZoned = expectedOpsForZonedRelativeTo.concat([ const expectedOpsForYearRoundingZoned = expectedOpsForZonedRelativeTo.concat([
// ToTemporalDate // ToTemporalDate
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// MoveRelativeZonedDateTime → AddZonedDateTime // MoveRelativeZonedDateTime → AddZonedDateTime
"get options.relativeTo.calendar.dateAdd", "get options.relativeTo.calendar.dateAdd",
"call options.relativeTo.calendar.dateAdd", "call options.relativeTo.calendar.dateAdd",
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
// BalancePossiblyInfiniteTimeDurationRelative → NanosecondsToDays // BalancePossiblyInfiniteTimeDurationRelative → NanosecondsToDays
"get options.relativeTo.timeZone.getOffsetNanosecondsFor", // 7. GetPlainDateTimeFor "call options.relativeTo.timeZone.getOffsetNanosecondsFor", // 8. GetPlainDateTimeFor
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor", // 9. GetPlainDateTimeFor
"get options.relativeTo.timeZone.getOffsetNanosecondsFor", // 11. GetPlainDateTimeFor
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// BalancePossiblyInfiniteTimeDurationRelative → NanosecondsToDays → AddDaysToZonedDateTime // BalancePossiblyInfiniteTimeDurationRelative → NanosecondsToDays → AddDaysToZonedDateTime
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
// BalancePossiblyInfiniteTimeDurationRelative → NanosecondsToDays → AddDaysToZonedDateTime // BalancePossiblyInfiniteTimeDurationRelative → NanosecondsToDays → AddDaysToZonedDateTime
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
// RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime // RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime
"get options.relativeTo.calendar.dateAdd", "get options.relativeTo.calendar.dateAdd",
"call options.relativeTo.calendar.dateAdd", "call options.relativeTo.calendar.dateAdd",
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", "call options.relativeTo.timeZone.getPossibleInstantsFor",
// RoundDuration // RoundDuration
"get options.relativeTo.calendar.dateAdd", // 7.c "get options.relativeTo.calendar.dateAdd", // 7.c
@ -353,19 +340,16 @@ actual.splice(0); // clear
// code path that hits UnbalanceDateDurationRelative and RoundDuration // code path that hits UnbalanceDateDurationRelative and RoundDuration
const expectedOpsForUnbalanceRound = expectedOpsForZonedRelativeTo.concat([ const expectedOpsForUnbalanceRound = expectedOpsForZonedRelativeTo.concat([
// ToTemporalDate // ToTemporalDate
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// No user code calls in UnbalanceDateDurationRelative // No user code calls in UnbalanceDateDurationRelative
// MoveRelativeZonedDateTime → AddZonedDateTime // MoveRelativeZonedDateTime → AddZonedDateTime
"get options.relativeTo.calendar.dateAdd", // 8. "get options.relativeTo.calendar.dateAdd", // 11.
"call options.relativeTo.calendar.dateAdd", "call options.relativeTo.calendar.dateAdd",
"get options.relativeTo.timeZone.getPossibleInstantsFor", // 10. GetInstantFor "call options.relativeTo.timeZone.getPossibleInstantsFor", // 13. GetInstantFor
"call options.relativeTo.timeZone.getPossibleInstantsFor",
// RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime // RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime
"get options.relativeTo.calendar.dateAdd", // 8. "get options.relativeTo.calendar.dateAdd", // 11.
"call options.relativeTo.calendar.dateAdd", "call options.relativeTo.calendar.dateAdd",
"get options.relativeTo.timeZone.getPossibleInstantsFor", // 10. GetInstantFor "call options.relativeTo.timeZone.getPossibleInstantsFor", // 13. GetInstantFor
"call options.relativeTo.timeZone.getPossibleInstantsFor",
// RoundDuration // RoundDuration
"get options.relativeTo.calendar.dateAdd", // 7.d.i "get options.relativeTo.calendar.dateAdd", // 7.d.i
"call options.relativeTo.calendar.dateAdd", // 7.f "call options.relativeTo.calendar.dateAdd", // 7.f
@ -383,24 +367,17 @@ actual.splice(0); // clear
// code path that avoids converting Zoned twice in BalanceTimeDurationRelative // code path that avoids converting Zoned twice in BalanceTimeDurationRelative
const expectedOpsForBalanceRound = expectedOpsForZonedRelativeTo.concat([ const expectedOpsForBalanceRound = expectedOpsForZonedRelativeTo.concat([
// ToTemporalDate // ToTemporalDate
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", "call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// No user code calls in UnbalanceDateDurationRelative // No user code calls in UnbalanceDateDurationRelative
// No user code calls in AddZonedDateTime (years, months, weeks = 0) // No user code calls in AddZonedDateTime (years, months, weeks = 0)
// BalanceTimeDurationRelative // BalanceTimeDurationRelative
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", // 4.a "call options.relativeTo.timeZone.getOffsetNanosecondsFor", // 4.a
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", // 4.b "call options.relativeTo.timeZone.getPossibleInstantsFor", // 4.b
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", // NanosecondsToDays 9 "call options.relativeTo.timeZone.getOffsetNanosecondsFor", // NanosecondsToDays 9
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", // NanosecondsToDays 26 "call options.relativeTo.timeZone.getPossibleInstantsFor", // NanosecondsToDays 26
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor", // NanosecondsToDays 31.a "call options.relativeTo.timeZone.getPossibleInstantsFor", // NanosecondsToDays 31.a
// RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime // RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime
"get options.relativeTo.timeZone.getPossibleInstantsFor", // 10. GetInstantFor "call options.relativeTo.timeZone.getPossibleInstantsFor", // 10. GetInstantFor
"call options.relativeTo.timeZone.getPossibleInstantsFor",
// RoundDuration // RoundDuration
"get options.relativeTo.calendar.dateAdd", // 10.d.i "get options.relativeTo.calendar.dateAdd", // 10.d.i
"call options.relativeTo.calendar.dateAdd", // 10.f "call options.relativeTo.calendar.dateAdd", // 10.f

View File

@ -57,17 +57,17 @@ const expected = [
"has timeZone.getOffsetNanosecondsFor", "has timeZone.getOffsetNanosecondsFor",
"has timeZone.getPossibleInstantsFor", "has timeZone.getPossibleInstantsFor",
"has timeZone.id", "has timeZone.id",
// lookup
"get timeZone.getOffsetNanosecondsFor",
"get timeZone.getPossibleInstantsFor",
// InterpretISODateTimeOffset
"call timeZone.getPossibleInstantsFor",
]; ];
const expectedSpringForward = expected.concat([ const expectedSpringForward = expected.concat([
// InterpretISODateTimeOffset
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor",
// DisambiguatePossibleInstants // DisambiguatePossibleInstants
"get timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor", "call timeZone.getPossibleInstantsFor",
]); ]);
assert.compareArray( assert.compareArray(
@ -80,14 +80,9 @@ actual.splice(0); // clear
relativeTo = { year: 2000, month: 10, day: 29, hour: 1, minute: 30, timeZone: dstTimeZoneObserver, calendar }; relativeTo = { year: 2000, month: 10, day: 29, hour: 1, minute: 30, timeZone: dstTimeZoneObserver, calendar };
instance.total({ unit: "days", relativeTo }); instance.total({ unit: "days", relativeTo });
const expectedFallBack = expected.concat([
// InterpretISODateTimeOffset
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor",
]);
assert.compareArray( assert.compareArray(
actual.slice(0, expectedFallBack.length), // ignore operations after ToRelativeTemporalObject actual.slice(0, expected.length), // ignore operations after ToRelativeTemporalObject
expectedFallBack, expected,
"order of operations converting property bag at repeated wall-clock time" "order of operations converting property bag at repeated wall-clock time"
); );
actual.splice(0); // clear actual.splice(0); // clear

View File

@ -89,7 +89,6 @@ assert.compareArray(actual, expected.concat([
"get item.timeZone.getOffsetNanosecondsFor", "get item.timeZone.getOffsetNanosecondsFor",
"call item.timeZone.getOffsetNanosecondsFor", "call item.timeZone.getOffsetNanosecondsFor",
"call item.timeZone.getOffsetNanosecondsFor", "call item.timeZone.getOffsetNanosecondsFor",
"get item.timeZone.getPossibleInstantsFor",
"call item.timeZone.getPossibleInstantsFor", "call item.timeZone.getPossibleInstantsFor",
]), "order of operations at skipped wall-clock time"); ]), "order of operations at skipped wall-clock time");
actual.splice(0); // clear actual.splice(0); // clear

View File

@ -51,7 +51,6 @@ assert.compareArray(actual, expected.concat([
"get timeZone.getOffsetNanosecondsFor", "get timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor", "call timeZone.getPossibleInstantsFor",
]), "order of operations at skipped wall-clock time"); ]), "order of operations at skipped wall-clock time");
actual.splice(0); // clear actual.splice(0); // clear

View File

@ -110,7 +110,6 @@ assert.compareArray(actual, expected.concat([
"get item.timeZone.getOffsetNanosecondsFor", "get item.timeZone.getOffsetNanosecondsFor",
"call item.timeZone.getOffsetNanosecondsFor", "call item.timeZone.getOffsetNanosecondsFor",
"call item.timeZone.getOffsetNanosecondsFor", "call item.timeZone.getOffsetNanosecondsFor",
"get item.timeZone.getPossibleInstantsFor",
"call item.timeZone.getPossibleInstantsFor", "call item.timeZone.getPossibleInstantsFor",
]), "order of operations at skipped wall-clock time"); ]), "order of operations at skipped wall-clock time");
actual.splice(0); // clear actual.splice(0); // clear

View File

@ -57,6 +57,10 @@ const expectedOne = [
// InterpretTemporalDateTimeFields // InterpretTemporalDateTimeFields
"get one.calendar.dateFromFields", "get one.calendar.dateFromFields",
"call one.calendar.dateFromFields", "call one.calendar.dateFromFields",
// lookup
"get one.timeZone.getPossibleInstantsFor",
// InterpretISODateTimeOffset
"call one.timeZone.getPossibleInstantsFor",
]; ];
const expectedTwo = [ const expectedTwo = [
@ -92,6 +96,10 @@ const expectedTwo = [
// InterpretTemporalDateTimeFields // InterpretTemporalDateTimeFields
"get two.calendar.dateFromFields", "get two.calendar.dateFromFields",
"call two.calendar.dateFromFields", "call two.calendar.dateFromFields",
// lookup
"get two.timeZone.getPossibleInstantsFor",
// InterpretISODateTimeOffset
"call two.timeZone.getPossibleInstantsFor",
]; ];
Temporal.ZonedDateTime.compare( Temporal.ZonedDateTime.compare(
@ -100,24 +108,16 @@ Temporal.ZonedDateTime.compare(
); );
const expectedSpringForward = expectedOne.concat([ const expectedSpringForward = expectedOne.concat([
// InterpretISODateTimeOffset
"get one.timeZone.getPossibleInstantsFor",
"call one.timeZone.getPossibleInstantsFor",
// DisambiguatePossibleInstants // DisambiguatePossibleInstants
"get one.timeZone.getOffsetNanosecondsFor", "get one.timeZone.getOffsetNanosecondsFor",
"call one.timeZone.getOffsetNanosecondsFor", "call one.timeZone.getOffsetNanosecondsFor",
"call one.timeZone.getOffsetNanosecondsFor", "call one.timeZone.getOffsetNanosecondsFor",
"get one.timeZone.getPossibleInstantsFor",
"call one.timeZone.getPossibleInstantsFor", "call one.timeZone.getPossibleInstantsFor",
], expectedTwo, [ ], expectedTwo, [
// InterpretISODateTimeOffset
"get two.timeZone.getPossibleInstantsFor",
"call two.timeZone.getPossibleInstantsFor",
// DisambiguatePossibleInstants // DisambiguatePossibleInstants
"get two.timeZone.getOffsetNanosecondsFor", "get two.timeZone.getOffsetNanosecondsFor",
"call two.timeZone.getOffsetNanosecondsFor", "call two.timeZone.getOffsetNanosecondsFor",
"call two.timeZone.getOffsetNanosecondsFor", "call two.timeZone.getOffsetNanosecondsFor",
"get two.timeZone.getPossibleInstantsFor",
"call two.timeZone.getPossibleInstantsFor", "call two.timeZone.getPossibleInstantsFor",
]); ]);
assert.compareArray(actual, expectedSpringForward, "order of operations converting property bags at skipped wall-clock time"); assert.compareArray(actual, expectedSpringForward, "order of operations converting property bags at skipped wall-clock time");
@ -128,14 +128,6 @@ Temporal.ZonedDateTime.compare(
{ year: 2000, month: 10, day: 29, hour: 1, minute: 30, timeZone: timeZone2, calendar: calendar2 }, { year: 2000, month: 10, day: 29, hour: 1, minute: 30, timeZone: timeZone2, calendar: calendar2 },
); );
const expectedFallBack = expectedOne.concat([ const expectedFallBack = expectedOne.concat(expectedTwo);
// InterpretISODateTimeOffset
"get one.timeZone.getPossibleInstantsFor",
"call one.timeZone.getPossibleInstantsFor",
], expectedTwo, [
// InterpretISODateTimeOffset
"get two.timeZone.getPossibleInstantsFor",
"call two.timeZone.getPossibleInstantsFor",
]);
assert.compareArray(actual, expectedFallBack, "order of operations converting property bags at repeated wall-clock time"); assert.compareArray(actual, expectedFallBack, "order of operations converting property bags at repeated wall-clock time");
actual.splice(0); // clear actual.splice(0); // clear

View File

@ -66,14 +66,14 @@ Temporal.ZonedDateTime.from(
{ offset: "ignore" } { offset: "ignore" }
); );
assert.compareArray(actual, expected.concat([ assert.compareArray(actual, expected.concat([
// InterpretISODateTimeOffset // lookup
"get timeZone.getPossibleInstantsFor", "get timeZone.getPossibleInstantsFor",
// InterpretISODateTimeOffset
"call timeZone.getPossibleInstantsFor", "call timeZone.getPossibleInstantsFor",
// DisambiguatePossibleInstants // DisambiguatePossibleInstants
"get timeZone.getOffsetNanosecondsFor", "get timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor", "call timeZone.getPossibleInstantsFor",
]), "order of operations converting property bag at skipped wall-clock time with offset: ignore"); ]), "order of operations converting property bag at skipped wall-clock time with offset: ignore");
actual.splice(0); // clear actual.splice(0); // clear
@ -83,14 +83,14 @@ Temporal.ZonedDateTime.from(
{ offset: "prefer" } { offset: "prefer" }
); );
assert.compareArray(actual, expected.concat([ assert.compareArray(actual, expected.concat([
// InterpretISODateTimeOffset // lookup
"get timeZone.getPossibleInstantsFor", "get timeZone.getPossibleInstantsFor",
// InterpretISODateTimeOffset
"call timeZone.getPossibleInstantsFor", "call timeZone.getPossibleInstantsFor",
// DisambiguatePossibleInstants // DisambiguatePossibleInstants
"get timeZone.getOffsetNanosecondsFor", "get timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor", "call timeZone.getPossibleInstantsFor",
]), "order of operations converting property bag at skipped wall-clock time with offset: prefer"); ]), "order of operations converting property bag at skipped wall-clock time with offset: prefer");
actual.splice(0); // clear actual.splice(0); // clear
@ -107,8 +107,9 @@ Temporal.ZonedDateTime.from(
{ offset: "ignore" } { offset: "ignore" }
); );
assert.compareArray(actual, expected.concat([ assert.compareArray(actual, expected.concat([
// InterpretISODateTimeOffset // lookup
"get timeZone.getPossibleInstantsFor", "get timeZone.getPossibleInstantsFor",
// InterpretISODateTimeOffset
"call timeZone.getPossibleInstantsFor", "call timeZone.getPossibleInstantsFor",
]), "order of operations converting property bag at repeated wall-clock time with offset: ignore"); ]), "order of operations converting property bag at repeated wall-clock time with offset: ignore");
actual.splice(0); // clear actual.splice(0); // clear
@ -118,8 +119,9 @@ Temporal.ZonedDateTime.from(
{ offset: "prefer" } { offset: "prefer" }
); );
assert.compareArray(actual, expected.concat([ assert.compareArray(actual, expected.concat([
// InterpretISODateTimeOffset // lookup
"get timeZone.getPossibleInstantsFor", "get timeZone.getPossibleInstantsFor",
// InterpretISODateTimeOffset
"call timeZone.getPossibleInstantsFor", "call timeZone.getPossibleInstantsFor",
"get timeZone.getOffsetNanosecondsFor", "get timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
@ -132,8 +134,9 @@ Temporal.ZonedDateTime.from(
{ offset: "reject" } { offset: "reject" }
); );
assert.compareArray(actual, expected.concat([ assert.compareArray(actual, expected.concat([
// InterpretISODateTimeOffset // lookup
"get timeZone.getPossibleInstantsFor", "get timeZone.getPossibleInstantsFor",
// InterpretISODateTimeOffset
"call timeZone.getPossibleInstantsFor", "call timeZone.getPossibleInstantsFor",
"get timeZone.getOffsetNanosecondsFor", "get timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",

View File

@ -40,8 +40,10 @@ const expected = [
"get duration.years", "get duration.years",
"get duration.years.valueOf", "get duration.years.valueOf",
"call duration.years.valueOf", "call duration.years.valueOf",
// AddZonedDateTime // lookup
"get this.timeZone.getOffsetNanosecondsFor", "get this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
// AddZonedDateTime
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"get this.calendar.dateAdd", "get this.calendar.dateAdd",
"call this.calendar.dateAdd", "call this.calendar.dateAdd",
@ -50,7 +52,6 @@ const expected = [
"get options.overflow.toString", "get options.overflow.toString",
"call options.overflow.toString", "call options.overflow.toString",
// AddZonedDateTime again // AddZonedDateTime again
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
]; ];
const actual = []; const actual = [];

View File

@ -58,17 +58,17 @@ const expected = [
// InterpretTemporalDateTimeFields // InterpretTemporalDateTimeFields
"get calendar.dateFromFields", "get calendar.dateFromFields",
"call calendar.dateFromFields", "call calendar.dateFromFields",
// lookup
"get timeZone.getPossibleInstantsFor",
// InterpretISODateTimeOffset
"call timeZone.getPossibleInstantsFor",
]; ];
const expectedSpringForward = expected.concat([ const expectedSpringForward = expected.concat([
// InterpretISODateTimeOffset
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor",
// DisambiguatePossibleInstants // DisambiguatePossibleInstants
"get timeZone.getOffsetNanosecondsFor", "get timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor", "call timeZone.getPossibleInstantsFor",
]); ]);
assert.compareArray( assert.compareArray(
@ -81,14 +81,9 @@ actual.splice(0); // clear
arg = { year: 2000, month: 10, day: 29, hour: 1, minute: 30, timeZone: dstTimeZoneObserver, calendar }; arg = { year: 2000, month: 10, day: 29, hour: 1, minute: 30, timeZone: dstTimeZoneObserver, calendar };
instance.equals(arg); instance.equals(arg);
const expectedFallBack = expected.concat([
// InterpretISODateTimeOffset
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor",
]);
assert.compareArray( assert.compareArray(
actual.slice(0, expectedFallBack.length), // ignore operations after ToTemporalZonedDateTime actual.slice(0, expected.length), // ignore operations after ToTemporalZonedDateTime
expectedFallBack, expected,
"order of operations converting property bag at repeated wall-clock time" "order of operations converting property bag at repeated wall-clock time"
); );
actual.splice(0); // clear actual.splice(0); // clear

View File

@ -10,14 +10,14 @@ features: [Temporal]
const actual = []; const actual = [];
const expected = [ const expected = [
// GetPlainDateTimeFor // lookup
"get this.timeZone.getOffsetNanosecondsFor", "get this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
// GetPlainDateTimeFor
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// GetInstantFor // GetInstantFor
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
// GetInstantFor // GetInstantFor
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
]; ];
@ -82,28 +82,24 @@ actual.splice(0); // clear
springForwardInstance.hoursInDay; springForwardInstance.hoursInDay;
assert.compareArray(actual, [ assert.compareArray(actual, [
// GetPlainDateTimeFor // lookup
"get this.timeZone.getOffsetNanosecondsFor", "get this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
// GetPlainDateTimeFor
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// GetInstantFor // GetInstantFor
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
// DisambiguatePossibleInstants // DisambiguatePossibleInstants
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// Note, no call to dateAdd as addition takes place in the ISO calendar // Note, no call to dateAdd as addition takes place in the ISO calendar
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
// GetInstantFor // GetInstantFor
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
// DisambiguatePossibleInstants // DisambiguatePossibleInstants
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// Note, no call to dateAdd here either // Note, no call to dateAdd here either
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
], "order of operations with both midnights at skipped wall-clock times"); ], "order of operations with both midnights at skipped wall-clock times");
actual.splice(0); // clear actual.splice(0); // clear

View File

@ -18,19 +18,17 @@ const expected = [
"get options.smallestUnit", "get options.smallestUnit",
"get options.smallestUnit.toString", "get options.smallestUnit.toString",
"call options.smallestUnit.toString", "call options.smallestUnit.toString",
// GetPlainDateTimeFor on receiver's instant // lookup
"get this.timeZone.getOffsetNanosecondsFor", "get this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
// GetPlainDateTimeFor on receiver's instant
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// GetInstantFor on preceding midnight // GetInstantFor on preceding midnight
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
// AddDaysToZonedDateTime // AddDaysToZonedDateTime
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
// InterpretISODateTimeOffset // InterpretISODateTimeOffset
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
]; ];
const actual = []; const actual = [];
@ -95,25 +93,21 @@ const expectedSkippedDateTime = [
"get options.smallestUnit", "get options.smallestUnit",
"get options.smallestUnit.toString", "get options.smallestUnit.toString",
"call options.smallestUnit.toString", "call options.smallestUnit.toString",
// GetPlainDateTimeFor on receiver's instant // lookup
"get this.timeZone.getOffsetNanosecondsFor", "get this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
// GetPlainDateTimeFor on receiver's instant
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// GetInstantFor on preceding midnight // GetInstantFor on preceding midnight
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
// DisambiguatePossibleInstants // DisambiguatePossibleInstants
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
// AddZonedDateTime // AddZonedDateTime
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
// InterpretISODateTimeOffset // InterpretISODateTimeOffset
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
]; ];
@ -131,29 +125,24 @@ const expectedSkippedResult = [
"get options.smallestUnit", "get options.smallestUnit",
"get options.smallestUnit.toString", "get options.smallestUnit.toString",
"call options.smallestUnit.toString", "call options.smallestUnit.toString",
// GetPlainDateTimeFor on receiver's instant // lookup
"get this.timeZone.getOffsetNanosecondsFor", "get this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
// GetPlainDateTimeFor on receiver's instant
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// GetInstantFor on preceding midnight // GetInstantFor on preceding midnight
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
// AddDaysToZonedDateTime // AddDaysToZonedDateTime
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
// DisambiguatePossibleInstants // DisambiguatePossibleInstants
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
// InterpretISODateTimeOffset // InterpretISODateTimeOffset
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
// DisambiguatePossibleInstants // DisambiguatePossibleInstants
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
]; ];

View File

@ -58,17 +58,17 @@ const expected = [
// InterpretTemporalDateTimeFields // InterpretTemporalDateTimeFields
"get calendar.dateFromFields", "get calendar.dateFromFields",
"call calendar.dateFromFields", "call calendar.dateFromFields",
// lookup
"get timeZone.getPossibleInstantsFor",
// InterpretISODateTimeOffset
"call timeZone.getPossibleInstantsFor",
]; ];
const expectedSpringForward = expected.concat([ const expectedSpringForward = expected.concat([
// InterpretISODateTimeOffset
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor",
// DisambiguatePossibleInstants // DisambiguatePossibleInstants
"get timeZone.getOffsetNanosecondsFor", "get timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor", "call timeZone.getPossibleInstantsFor",
]); ]);
assert.compareArray( assert.compareArray(
@ -81,14 +81,9 @@ actual.splice(0); // clear
arg = { year: 2000, month: 10, day: 29, hour: 1, minute: 30, timeZone: dstTimeZoneObserver, calendar }; arg = { year: 2000, month: 10, day: 29, hour: 1, minute: 30, timeZone: dstTimeZoneObserver, calendar };
instance.since(arg); instance.since(arg);
const expectedFallBack = expected.concat([
// InterpretISODateTimeOffset
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor",
]);
assert.compareArray( assert.compareArray(
actual.slice(0, expectedFallBack.length), // ignore operations after ToTemporalZonedDateTime actual.slice(0, expected.length), // ignore operations after ToTemporalZonedDateTime
expectedFallBack, expected,
"order of operations converting property bag at repeated wall-clock time" "order of operations converting property bag at repeated wall-clock time"
); );
actual.splice(0); // clear actual.splice(0); // clear

View File

@ -297,18 +297,16 @@ assert.compareArray(actual, [
// TimeZoneEquals // TimeZoneEquals
"get this.timeZone.id", "get this.timeZone.id",
"get other.timeZone.id", "get other.timeZone.id",
// lookup
"get this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
// DifferenceZonedDateTime // DifferenceZonedDateTime
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// NanosecondsToDays // NanosecondsToDays
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// NanosecondsToDays → AddDaysToZonedDateTime // NanosecondsToDays → AddDaysToZonedDateTime
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
], "order of operations with identical wall-clock times and largestUnit a calendar unit"); ], "order of operations with identical wall-clock times and largestUnit a calendar unit");
actual.splice(0); // clear actual.splice(0); // clear
@ -318,11 +316,12 @@ const expectedOpsForCalendarDifference = [
// TimeZoneEquals // TimeZoneEquals
"get this.timeZone.id", "get this.timeZone.id",
"get other.timeZone.id", "get other.timeZone.id",
// precalculate PlainDateTime // lookup
"get this.timeZone.getOffsetNanosecondsFor", "get this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
// precalculate PlainDateTime
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// DifferenceZonedDateTime // DifferenceZonedDateTime
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// DifferenceISODateTime // DifferenceISODateTime
"get this.calendar.dateUntil", "get this.calendar.dateUntil",
@ -330,17 +329,12 @@ const expectedOpsForCalendarDifference = [
// AddZonedDateTime // AddZonedDateTime
"get this.calendar.dateAdd", "get this.calendar.dateAdd",
"call this.calendar.dateAdd", "call this.calendar.dateAdd",
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
// NanosecondsToDays // NanosecondsToDays
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// NanosecondsToDays → AddDaysToZonedDateTime // NanosecondsToDays → AddDaysToZonedDateTime
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
]; ];
@ -348,15 +342,11 @@ const expectedOpsForCalendarRounding = [
// RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime // RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime
"get this.calendar.dateAdd", "get this.calendar.dateAdd",
"call this.calendar.dateAdd", "call this.calendar.dateAdd",
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
// RoundDuration → NanosecondsToDays // RoundDuration → NanosecondsToDays
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// RoundDuration → NanosecondsToDays → AddDaysToZonedDateTime // RoundDuration → NanosecondsToDays → AddDaysToZonedDateTime
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
]; ];

View File

@ -9,11 +9,12 @@ features: [Temporal]
---*/ ---*/
const expected = [ const expected = [
// GetPlainDateTimeFor // lookup
"get this.timeZone.getOffsetNanosecondsFor", "get this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
// GetPlainDateTimeFor
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// GetInstantFor on preceding midnight // GetInstantFor on preceding midnight
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
]; ];
const actual = []; const actual = [];
@ -58,10 +59,8 @@ actual.splice(0); // clear
springForwardInstance.startOfDay(); springForwardInstance.startOfDay();
assert.compareArray(actual, expected.concat([ assert.compareArray(actual, expected.concat([
// DisambiguatePossibleInstants // DisambiguatePossibleInstants
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
]), "order of operations with preceding midnight at skipped wall-clock time"); ]), "order of operations with preceding midnight at skipped wall-clock time");
actual.splice(0); // clear actual.splice(0); // clear

View File

@ -40,8 +40,10 @@ const expected = [
"get duration.years", "get duration.years",
"get duration.years.valueOf", "get duration.years.valueOf",
"call duration.years.valueOf", "call duration.years.valueOf",
// AddZonedDateTime // lookup
"get this.timeZone.getOffsetNanosecondsFor", "get this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
// AddZonedDateTime
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"get this.calendar.dateAdd", "get this.calendar.dateAdd",
"call this.calendar.dateAdd", "call this.calendar.dateAdd",
@ -50,7 +52,6 @@ const expected = [
"get options.overflow.toString", "get options.overflow.toString",
"call options.overflow.toString", "call options.overflow.toString",
// AddZonedDateTime again // AddZonedDateTime again
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
]; ];
const actual = []; const actual = [];

View File

@ -58,17 +58,17 @@ const expected = [
// InterpretTemporalDateTimeFields // InterpretTemporalDateTimeFields
"get calendar.dateFromFields", "get calendar.dateFromFields",
"call calendar.dateFromFields", "call calendar.dateFromFields",
// lookup
"get timeZone.getPossibleInstantsFor",
// InterpretISODateTimeOffset
"call timeZone.getPossibleInstantsFor",
]; ];
const expectedSpringForward = expected.concat([ const expectedSpringForward = expected.concat([
// InterpretISODateTimeOffset
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor",
// DisambiguatePossibleInstants // DisambiguatePossibleInstants
"get timeZone.getOffsetNanosecondsFor", "get timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"call timeZone.getOffsetNanosecondsFor", "call timeZone.getOffsetNanosecondsFor",
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor", "call timeZone.getPossibleInstantsFor",
]); ]);
assert.compareArray( assert.compareArray(
@ -81,14 +81,9 @@ actual.splice(0); // clear
arg = { year: 2000, month: 10, day: 29, hour: 1, minute: 30, timeZone: dstTimeZoneObserver, calendar }; arg = { year: 2000, month: 10, day: 29, hour: 1, minute: 30, timeZone: dstTimeZoneObserver, calendar };
instance.until(arg); instance.until(arg);
const expectedFallBack = expected.concat([
// InterpretISODateTimeOffset
"get timeZone.getPossibleInstantsFor",
"call timeZone.getPossibleInstantsFor",
]);
assert.compareArray( assert.compareArray(
actual.slice(0, expectedFallBack.length), // ignore operations after ToTemporalZonedDateTime actual.slice(0, expected.length), // ignore operations after ToTemporalZonedDateTime
expectedFallBack, expected,
"order of operations converting property bag at repeated wall-clock time" "order of operations converting property bag at repeated wall-clock time"
); );
actual.splice(0); // clear actual.splice(0); // clear

View File

@ -297,18 +297,16 @@ assert.compareArray(actual, [
// TimeZoneEquals // TimeZoneEquals
"get this.timeZone.id", "get this.timeZone.id",
"get other.timeZone.id", "get other.timeZone.id",
// lookup
"get this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
// DifferenceZonedDateTime // DifferenceZonedDateTime
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// NanosecondsToDays // NanosecondsToDays
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// NanosecondsToDays → AddDaysToZonedDateTime // NanosecondsToDays → AddDaysToZonedDateTime
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
], "order of operations with identical wall-clock times and largestUnit a calendar unit"); ], "order of operations with identical wall-clock times and largestUnit a calendar unit");
actual.splice(0); // clear actual.splice(0); // clear
@ -318,11 +316,12 @@ const expectedOpsForCalendarDifference = [
// TimeZoneEquals // TimeZoneEquals
"get this.timeZone.id", "get this.timeZone.id",
"get other.timeZone.id", "get other.timeZone.id",
// precalculate PlainDateTime // lookup
"get this.timeZone.getOffsetNanosecondsFor", "get this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
// precalculate PlainDateTime
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// DifferenceZonedDateTime // DifferenceZonedDateTime
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// DifferenceISODateTime // DifferenceISODateTime
"get this.calendar.dateUntil", "get this.calendar.dateUntil",
@ -330,17 +329,12 @@ const expectedOpsForCalendarDifference = [
// AddZonedDateTime // AddZonedDateTime
"get this.calendar.dateAdd", "get this.calendar.dateAdd",
"call this.calendar.dateAdd", "call this.calendar.dateAdd",
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
// NanosecondsToDays // NanosecondsToDays
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// NanosecondsToDays → AddDaysToZonedDateTime // NanosecondsToDays → AddDaysToZonedDateTime
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
]; ];
@ -348,15 +342,11 @@ const expectedOpsForCalendarRounding = [
// RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime // RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime
"get this.calendar.dateAdd", "get this.calendar.dateAdd",
"call this.calendar.dateAdd", "call this.calendar.dateAdd",
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
// RoundDuration → NanosecondsToDays // RoundDuration → NanosecondsToDays
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// RoundDuration → NanosecondsToDays → AddDaysToZonedDateTime // RoundDuration → NanosecondsToDays → AddDaysToZonedDateTime
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
]; ];

View File

@ -22,8 +22,10 @@ const expected = [
"get options.offset", "get options.offset",
"getOwnPropertyDescriptor options.extra", "getOwnPropertyDescriptor options.extra",
"get options.extra", "get options.extra",
// GetOffsetNanosecondsFor on receiver // lookup
"get this.timeZone.getOffsetNanosecondsFor", "get this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
// GetOffsetNanosecondsFor on receiver
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// CalendarFields // CalendarFields
"get this.calendar.fields", "get this.calendar.fields",
@ -84,9 +86,7 @@ const expected = [
"get this.calendar.dateFromFields", "get this.calendar.dateFromFields",
"call this.calendar.dateFromFields", "call this.calendar.dateFromFields",
// InterpretISODateTimeOffset // InterpretISODateTimeOffset
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
]; ];
const actual = []; const actual = [];
@ -168,7 +168,6 @@ dstInstance.with(springForwardFields, options);
assert.compareArray(actual, expected.concat([ assert.compareArray(actual, expected.concat([
// DisambiguatePossibleInstants // DisambiguatePossibleInstants
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
]), "order of operations at skipped wall-clock time"); ]), "order of operations at skipped wall-clock time");
actual.splice(0); // clear actual.splice(0); // clear

View File

@ -49,14 +49,15 @@ const expected = [
"call plainDateLike.year.valueOf", "call plainDateLike.year.valueOf",
"get plainDateLike.calendar.dateFromFields", "get plainDateLike.calendar.dateFromFields",
"call plainDateLike.calendar.dateFromFields", "call plainDateLike.calendar.dateFromFields",
// GetPlainDateTimeFor // lookup
"get this.timeZone.getOffsetNanosecondsFor", "get this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
// GetPlainDateTimeFor
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// ConsolidateCalendars // ConsolidateCalendars
"get this.calendar.id", "get this.calendar.id",
"get plainDateLike.calendar.id", "get plainDateLike.calendar.id",
// GetInstantFor // GetInstantFor
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
]; ];
@ -103,10 +104,8 @@ const springForwardPlainDateLike = TemporalHelpers.propertyBagObserver(actual, {
}, "plainDateLike"); }, "plainDateLike");
instance.withPlainDate(springForwardPlainDateLike); instance.withPlainDate(springForwardPlainDateLike);
assert.compareArray(actual, expected.concat([ assert.compareArray(actual, expected.concat([
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
]), "order of operations at skipped wall-clock time"); ]), "order of operations at skipped wall-clock time");
actual.splice(0); // clear actual.splice(0); // clear

View File

@ -29,11 +29,12 @@ const expected = [
"get plainTimeLike.second", "get plainTimeLike.second",
"get plainTimeLike.second.valueOf", "get plainTimeLike.second.valueOf",
"call plainTimeLike.second.valueOf", "call plainTimeLike.second.valueOf",
// GetPlainDateTimeFor // lookup
"get this.timeZone.getOffsetNanosecondsFor", "get this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
// GetPlainDateTimeFor
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
// GetInstantFor // GetInstantFor
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
]; ];
@ -77,10 +78,8 @@ actual.splice(0); // clear
springForwardInstance.withPlainTime(plainTimeLike); springForwardInstance.withPlainTime(plainTimeLike);
assert.compareArray(actual, expected.concat([ assert.compareArray(actual, expected.concat([
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor", "call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getPossibleInstantsFor",
"call this.timeZone.getPossibleInstantsFor", "call this.timeZone.getPossibleInstantsFor",
]), "order of operations at skipped wall-clock time"); ]), "order of operations at skipped wall-clock time");
actual.splice(0); // clear actual.splice(0); // clear