mirror of
https://github.com/tc39/test262.git
synced 2025-09-22 09:38:00 +02:00
Temporal: Look up calendar methods only once
This commit is contained in:
parent
911fe9612e
commit
c5dd01f7c0
@ -32,8 +32,10 @@ const expected = [
|
|||||||
"has date.calendar.year",
|
"has date.calendar.year",
|
||||||
"has date.calendar.yearMonthFromFields",
|
"has date.calendar.yearMonthFromFields",
|
||||||
"has date.calendar.yearOfWeek",
|
"has date.calendar.yearOfWeek",
|
||||||
// ToTemporalDate → CalendarFields
|
// lookup
|
||||||
|
"get date.calendar.dateFromFields",
|
||||||
"get date.calendar.fields",
|
"get date.calendar.fields",
|
||||||
|
// ToTemporalDate → CalendarFields
|
||||||
"call date.calendar.fields",
|
"call date.calendar.fields",
|
||||||
// ToTemporalDate → PrepareTemporalFields
|
// ToTemporalDate → PrepareTemporalFields
|
||||||
"get date.day",
|
"get date.day",
|
||||||
@ -49,7 +51,6 @@ const expected = [
|
|||||||
"get date.year.valueOf",
|
"get date.year.valueOf",
|
||||||
"call date.year.valueOf",
|
"call date.year.valueOf",
|
||||||
// ToTemporalDate → CalendarDateFromFields
|
// ToTemporalDate → CalendarDateFromFields
|
||||||
"get date.calendar.dateFromFields",
|
|
||||||
"call date.calendar.dateFromFields",
|
"call date.calendar.dateFromFields",
|
||||||
// ToTemporalDuration
|
// ToTemporalDuration
|
||||||
"get duration.days",
|
"get duration.days",
|
||||||
|
@ -32,8 +32,10 @@ const expected = [
|
|||||||
"has one.calendar.year",
|
"has one.calendar.year",
|
||||||
"has one.calendar.yearMonthFromFields",
|
"has one.calendar.yearMonthFromFields",
|
||||||
"has one.calendar.yearOfWeek",
|
"has one.calendar.yearOfWeek",
|
||||||
// ToTemporalDate 1 → CalendarFields
|
// lookup
|
||||||
|
"get one.calendar.dateFromFields",
|
||||||
"get one.calendar.fields",
|
"get one.calendar.fields",
|
||||||
|
// ToTemporalDate 1 → CalendarFields
|
||||||
"call one.calendar.fields",
|
"call one.calendar.fields",
|
||||||
// ToTemporalDate 1 → PrepareTemporalFields
|
// ToTemporalDate 1 → PrepareTemporalFields
|
||||||
"get one.day",
|
"get one.day",
|
||||||
@ -49,7 +51,6 @@ const expected = [
|
|||||||
"get one.year.valueOf",
|
"get one.year.valueOf",
|
||||||
"call one.year.valueOf",
|
"call one.year.valueOf",
|
||||||
// ToTemporalDate 1 → CalendarDateFromFields
|
// ToTemporalDate 1 → CalendarDateFromFields
|
||||||
"get one.calendar.dateFromFields",
|
|
||||||
"call one.calendar.dateFromFields",
|
"call one.calendar.dateFromFields",
|
||||||
// ToTemporalDate 2 → GetTemporalCalendarSlotValueWithISODefault
|
// ToTemporalDate 2 → GetTemporalCalendarSlotValueWithISODefault
|
||||||
"get two.calendar",
|
"get two.calendar",
|
||||||
@ -74,8 +75,10 @@ const expected = [
|
|||||||
"has two.calendar.year",
|
"has two.calendar.year",
|
||||||
"has two.calendar.yearMonthFromFields",
|
"has two.calendar.yearMonthFromFields",
|
||||||
"has two.calendar.yearOfWeek",
|
"has two.calendar.yearOfWeek",
|
||||||
// ToTemporalDate 2 → CalendarFields
|
// lookup
|
||||||
|
"get two.calendar.dateFromFields",
|
||||||
"get two.calendar.fields",
|
"get two.calendar.fields",
|
||||||
|
// ToTemporalDate 2 → CalendarFields
|
||||||
"call two.calendar.fields",
|
"call two.calendar.fields",
|
||||||
// ToTemporalDate 2 → PrepareTemporalFields
|
// ToTemporalDate 2 → PrepareTemporalFields
|
||||||
"get two.day",
|
"get two.day",
|
||||||
@ -91,7 +94,6 @@ const expected = [
|
|||||||
"get two.year.valueOf",
|
"get two.year.valueOf",
|
||||||
"call two.year.valueOf",
|
"call two.year.valueOf",
|
||||||
// ToTemporalDate 2 → CalendarDateFromFields
|
// ToTemporalDate 2 → CalendarDateFromFields
|
||||||
"get two.calendar.dateFromFields",
|
|
||||||
"call two.calendar.dateFromFields",
|
"call two.calendar.dateFromFields",
|
||||||
// GetTemporalUnit
|
// GetTemporalUnit
|
||||||
"get options.largestUnit",
|
"get options.largestUnit",
|
||||||
|
@ -109,6 +109,8 @@ const expectedOpsForPlainRelativeTo = expected.concat([
|
|||||||
"has options.relativeTo.calendar.year",
|
"has options.relativeTo.calendar.year",
|
||||||
"has options.relativeTo.calendar.yearMonthFromFields",
|
"has options.relativeTo.calendar.yearMonthFromFields",
|
||||||
"has options.relativeTo.calendar.yearOfWeek",
|
"has options.relativeTo.calendar.yearOfWeek",
|
||||||
|
// lookup
|
||||||
|
"get options.relativeTo.calendar.dateFromFields",
|
||||||
"get options.relativeTo.calendar.fields",
|
"get options.relativeTo.calendar.fields",
|
||||||
"call options.relativeTo.calendar.fields",
|
"call options.relativeTo.calendar.fields",
|
||||||
"get options.relativeTo.day",
|
"get options.relativeTo.day",
|
||||||
@ -131,7 +133,6 @@ const expectedOpsForPlainRelativeTo = expected.concat([
|
|||||||
"get options.relativeTo.year",
|
"get options.relativeTo.year",
|
||||||
"get options.relativeTo.year.valueOf",
|
"get options.relativeTo.year.valueOf",
|
||||||
"call options.relativeTo.year.valueOf",
|
"call options.relativeTo.year.valueOf",
|
||||||
"get options.relativeTo.calendar.dateFromFields",
|
|
||||||
"call options.relativeTo.calendar.dateFromFields",
|
"call options.relativeTo.calendar.dateFromFields",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -175,13 +176,12 @@ actual.splice(0); // clear
|
|||||||
// to days:
|
// to days:
|
||||||
const expectedOpsForPlainDayBalancing = expectedOpsForPlainRelativeTo.concat(
|
const expectedOpsForPlainDayBalancing = expectedOpsForPlainRelativeTo.concat(
|
||||||
[
|
[
|
||||||
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
// UnbalanceDurationRelative
|
// UnbalanceDurationRelative
|
||||||
"get options.relativeTo.calendar.dateAdd", // 11.a.ii
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.a.iii.1 MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 11.a.iii.1 MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.a.iv.1 MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 11.a.iv.1 MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.a.v.1 MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 11.a.v.1 MoveRelativeDate
|
||||||
// UnbalanceDurationRelative again for the second argument:
|
// UnbalanceDurationRelative again for the second argument:
|
||||||
"get options.relativeTo.calendar.dateAdd", // 11.a.ii
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.a.iii.1 MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 11.a.iii.1 MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.a.iv.1 MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 11.a.iv.1 MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.a.v.1 MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 11.a.v.1 MoveRelativeDate
|
||||||
@ -219,6 +219,7 @@ const expectedOpsForZonedRelativeTo = expected.concat([
|
|||||||
"has options.relativeTo.calendar.year",
|
"has options.relativeTo.calendar.year",
|
||||||
"has options.relativeTo.calendar.yearMonthFromFields",
|
"has options.relativeTo.calendar.yearMonthFromFields",
|
||||||
"has options.relativeTo.calendar.yearOfWeek",
|
"has options.relativeTo.calendar.yearOfWeek",
|
||||||
|
"get options.relativeTo.calendar.dateFromFields",
|
||||||
"get options.relativeTo.calendar.fields",
|
"get options.relativeTo.calendar.fields",
|
||||||
"call options.relativeTo.calendar.fields",
|
"call options.relativeTo.calendar.fields",
|
||||||
"get options.relativeTo.day",
|
"get options.relativeTo.day",
|
||||||
@ -255,7 +256,6 @@ const expectedOpsForZonedRelativeTo = expected.concat([
|
|||||||
"get options.relativeTo.year",
|
"get options.relativeTo.year",
|
||||||
"get options.relativeTo.year.valueOf",
|
"get options.relativeTo.year.valueOf",
|
||||||
"call options.relativeTo.year.valueOf",
|
"call options.relativeTo.year.valueOf",
|
||||||
"get options.relativeTo.calendar.dateFromFields",
|
|
||||||
"call options.relativeTo.calendar.dateFromFields",
|
"call options.relativeTo.calendar.dateFromFields",
|
||||||
"has options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"has options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
"has options.relativeTo.timeZone.getPossibleInstantsFor",
|
"has options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
@ -323,13 +323,12 @@ Temporal.Duration.compare(
|
|||||||
assert.compareArray(
|
assert.compareArray(
|
||||||
actual,
|
actual,
|
||||||
expectedOpsForZonedRelativeTo.concat([
|
expectedOpsForZonedRelativeTo.concat([
|
||||||
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
// AddZonedDateTime on first argument
|
// AddZonedDateTime on first argument
|
||||||
"get options.relativeTo.calendar.dateAdd",
|
|
||||||
"call options.relativeTo.calendar.dateAdd",
|
"call options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
// AddZonedDateTime on second argument
|
// AddZonedDateTime on second argument
|
||||||
"get options.relativeTo.calendar.dateAdd",
|
|
||||||
"call options.relativeTo.calendar.dateAdd",
|
"call options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
]),
|
]),
|
||||||
|
@ -48,11 +48,12 @@ const expected = [
|
|||||||
"has calendar.year",
|
"has calendar.year",
|
||||||
"has calendar.yearMonthFromFields",
|
"has calendar.yearMonthFromFields",
|
||||||
"has calendar.yearOfWeek",
|
"has calendar.yearOfWeek",
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get calendar.dateFromFields",
|
||||||
"get calendar.fields",
|
"get calendar.fields",
|
||||||
|
// CalendarFields
|
||||||
"call calendar.fields",
|
"call calendar.fields",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get calendar.dateFromFields",
|
|
||||||
"call calendar.dateFromFields",
|
"call calendar.dateFromFields",
|
||||||
// ToTemporalTimeZoneSlotValue
|
// ToTemporalTimeZoneSlotValue
|
||||||
"has timeZone.getOffsetNanosecondsFor",
|
"has timeZone.getOffsetNanosecondsFor",
|
||||||
|
@ -92,6 +92,8 @@ const expectedOpsForPlainRelativeTo = expected.concat([
|
|||||||
"has options.relativeTo.calendar.year",
|
"has options.relativeTo.calendar.year",
|
||||||
"has options.relativeTo.calendar.yearMonthFromFields",
|
"has options.relativeTo.calendar.yearMonthFromFields",
|
||||||
"has options.relativeTo.calendar.yearOfWeek",
|
"has options.relativeTo.calendar.yearOfWeek",
|
||||||
|
// lookup
|
||||||
|
"get options.relativeTo.calendar.dateFromFields",
|
||||||
"get options.relativeTo.calendar.fields",
|
"get options.relativeTo.calendar.fields",
|
||||||
"call options.relativeTo.calendar.fields",
|
"call options.relativeTo.calendar.fields",
|
||||||
// PrepareTemporalFields
|
// PrepareTemporalFields
|
||||||
@ -116,13 +118,13 @@ const expectedOpsForPlainRelativeTo = expected.concat([
|
|||||||
"get options.relativeTo.year.valueOf",
|
"get options.relativeTo.year.valueOf",
|
||||||
"call options.relativeTo.year.valueOf",
|
"call options.relativeTo.year.valueOf",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get options.relativeTo.calendar.dateFromFields",
|
|
||||||
"call options.relativeTo.calendar.dateFromFields",
|
"call options.relativeTo.calendar.dateFromFields",
|
||||||
// AddDuration
|
// lookup 2
|
||||||
"get options.relativeTo.calendar.dateAdd",
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.calendar.dateAdd",
|
|
||||||
"call options.relativeTo.calendar.dateAdd",
|
|
||||||
"get options.relativeTo.calendar.dateUntil",
|
"get options.relativeTo.calendar.dateUntil",
|
||||||
|
// AddDuration
|
||||||
|
"call options.relativeTo.calendar.dateAdd",
|
||||||
|
"call options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.calendar.dateUntil",
|
"call options.relativeTo.calendar.dateUntil",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -203,6 +205,7 @@ const expectedOpsForPlainRelativeToNoCalendarOperations = [
|
|||||||
"has options.relativeTo.calendar.year",
|
"has options.relativeTo.calendar.year",
|
||||||
"has options.relativeTo.calendar.yearMonthFromFields",
|
"has options.relativeTo.calendar.yearMonthFromFields",
|
||||||
"has options.relativeTo.calendar.yearOfWeek",
|
"has options.relativeTo.calendar.yearOfWeek",
|
||||||
|
"get options.relativeTo.calendar.dateFromFields",
|
||||||
"get options.relativeTo.calendar.fields",
|
"get options.relativeTo.calendar.fields",
|
||||||
"call options.relativeTo.calendar.fields",
|
"call options.relativeTo.calendar.fields",
|
||||||
// PrepareTemporalFields
|
// PrepareTemporalFields
|
||||||
@ -227,7 +230,6 @@ const expectedOpsForPlainRelativeToNoCalendarOperations = [
|
|||||||
"get options.relativeTo.year.valueOf",
|
"get options.relativeTo.year.valueOf",
|
||||||
"call options.relativeTo.year.valueOf",
|
"call options.relativeTo.year.valueOf",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get options.relativeTo.calendar.dateFromFields",
|
|
||||||
"call options.relativeTo.calendar.dateFromFields",
|
"call options.relativeTo.calendar.dateFromFields",
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -271,6 +273,8 @@ const expectedOpsForZonedRelativeTo = expected.concat([
|
|||||||
"has options.relativeTo.calendar.year",
|
"has options.relativeTo.calendar.year",
|
||||||
"has options.relativeTo.calendar.yearMonthFromFields",
|
"has options.relativeTo.calendar.yearMonthFromFields",
|
||||||
"has options.relativeTo.calendar.yearOfWeek",
|
"has options.relativeTo.calendar.yearOfWeek",
|
||||||
|
// lookup
|
||||||
|
"get options.relativeTo.calendar.dateFromFields",
|
||||||
"get options.relativeTo.calendar.fields",
|
"get options.relativeTo.calendar.fields",
|
||||||
"call options.relativeTo.calendar.fields",
|
"call options.relativeTo.calendar.fields",
|
||||||
// PrepareTemporalFields
|
// PrepareTemporalFields
|
||||||
@ -309,7 +313,6 @@ const expectedOpsForZonedRelativeTo = expected.concat([
|
|||||||
"get options.relativeTo.year.valueOf",
|
"get options.relativeTo.year.valueOf",
|
||||||
"call options.relativeTo.year.valueOf",
|
"call options.relativeTo.year.valueOf",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get options.relativeTo.calendar.dateFromFields",
|
|
||||||
"call options.relativeTo.calendar.dateFromFields",
|
"call options.relativeTo.calendar.dateFromFields",
|
||||||
// ToRelativeTemporalObject again
|
// ToRelativeTemporalObject again
|
||||||
"has options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"has options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
@ -320,24 +323,23 @@ const expectedOpsForZonedRelativeTo = expected.concat([
|
|||||||
"get options.relativeTo.timeZone.getPossibleInstantsFor",
|
"get options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
|
// lookup 2
|
||||||
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
|
"get options.relativeTo.calendar.dateUntil",
|
||||||
// AddDuration
|
// AddDuration
|
||||||
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
// AddDuration → AddZonedDateTime 1
|
// AddDuration → AddZonedDateTime 1
|
||||||
"get options.relativeTo.calendar.dateAdd",
|
|
||||||
"call options.relativeTo.calendar.dateAdd",
|
"call options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
// AddDuration → AddZonedDateTime 2
|
// AddDuration → AddZonedDateTime 2
|
||||||
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
"get options.relativeTo.calendar.dateAdd",
|
|
||||||
"call options.relativeTo.calendar.dateAdd",
|
"call options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
// AddDuration → DifferenceZonedDateTime
|
// AddDuration → DifferenceZonedDateTime
|
||||||
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
// AddDuration → DifferenceZonedDateTime → DifferenceISODateTime
|
// AddDuration → DifferenceZonedDateTime → DifferenceISODateTime
|
||||||
"get options.relativeTo.calendar.dateUntil",
|
|
||||||
"call options.relativeTo.calendar.dateUntil",
|
"call options.relativeTo.calendar.dateUntil",
|
||||||
// AddDuration → DifferenceZonedDateTime → AddZonedDateTime
|
// AddDuration → DifferenceZonedDateTime → AddZonedDateTime
|
||||||
"get options.relativeTo.calendar.dateAdd",
|
|
||||||
"call options.relativeTo.calendar.dateAdd",
|
"call options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
// AddDuration → DifferenceZonedDateTime → NanosecondsToDays
|
// AddDuration → DifferenceZonedDateTime → NanosecondsToDays
|
||||||
|
@ -47,11 +47,12 @@ const expected = [
|
|||||||
"has calendar.year",
|
"has calendar.year",
|
||||||
"has calendar.yearMonthFromFields",
|
"has calendar.yearMonthFromFields",
|
||||||
"has calendar.yearOfWeek",
|
"has calendar.yearOfWeek",
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get calendar.dateFromFields",
|
||||||
"get calendar.fields",
|
"get calendar.fields",
|
||||||
|
// CalendarFields
|
||||||
"call calendar.fields",
|
"call calendar.fields",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get calendar.dateFromFields",
|
|
||||||
"call calendar.dateFromFields",
|
"call calendar.dateFromFields",
|
||||||
// ToTemporalTimeZoneSlotValue
|
// ToTemporalTimeZoneSlotValue
|
||||||
"has timeZone.getOffsetNanosecondsFor",
|
"has timeZone.getOffsetNanosecondsFor",
|
||||||
|
@ -69,6 +69,7 @@ const expectedOpsForPlainRelativeTo = [
|
|||||||
"has options.relativeTo.calendar.year",
|
"has options.relativeTo.calendar.year",
|
||||||
"has options.relativeTo.calendar.yearMonthFromFields",
|
"has options.relativeTo.calendar.yearMonthFromFields",
|
||||||
"has options.relativeTo.calendar.yearOfWeek",
|
"has options.relativeTo.calendar.yearOfWeek",
|
||||||
|
"get options.relativeTo.calendar.dateFromFields",
|
||||||
"get options.relativeTo.calendar.fields",
|
"get options.relativeTo.calendar.fields",
|
||||||
"call options.relativeTo.calendar.fields",
|
"call options.relativeTo.calendar.fields",
|
||||||
"get options.relativeTo.day",
|
"get options.relativeTo.day",
|
||||||
@ -91,7 +92,6 @@ const expectedOpsForPlainRelativeTo = [
|
|||||||
"get options.relativeTo.year",
|
"get options.relativeTo.year",
|
||||||
"get options.relativeTo.year.valueOf",
|
"get options.relativeTo.year.valueOf",
|
||||||
"call options.relativeTo.year.valueOf",
|
"call options.relativeTo.year.valueOf",
|
||||||
"get options.relativeTo.calendar.dateFromFields",
|
|
||||||
"call options.relativeTo.calendar.dateFromFields",
|
"call options.relativeTo.calendar.dateFromFields",
|
||||||
"get options.roundingIncrement",
|
"get options.roundingIncrement",
|
||||||
"get options.roundingIncrement.valueOf",
|
"get options.roundingIncrement.valueOf",
|
||||||
@ -119,9 +119,9 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through RoundDuration that rounds to the nearest year, with minimal calendar calls:
|
// code path through RoundDuration that rounds to the nearest year, with minimal calendar calls:
|
||||||
const expectedMinimalOpsForYearRounding = expectedOpsForPlainRelativeTo.concat([
|
const expectedMinimalOpsForYearRounding = expectedOpsForPlainRelativeTo.concat([
|
||||||
"get options.relativeTo.calendar.dateAdd", // 7.c
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
|
"get options.relativeTo.calendar.dateUntil",
|
||||||
// 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
|
||||||
"get options.relativeTo.calendar.dateUntil", // 7.o
|
|
||||||
"call options.relativeTo.calendar.dateUntil", // 7.o
|
"call options.relativeTo.calendar.dateUntil", // 7.o
|
||||||
// 7.s not called because years, months, weeks are 0
|
// 7.s not called because years, months, weeks are 0
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
@ -132,19 +132,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 expectedOpsForYearRounding = expectedOpsForPlainRelativeTo.concat([
|
const expectedOpsForYearRounding = expectedOpsForPlainRelativeTo.concat([
|
||||||
"get options.relativeTo.calendar.dateAdd", // 7.c
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
|
"get options.relativeTo.calendar.dateUntil",
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.e
|
"call options.relativeTo.calendar.dateAdd", // 7.e
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.g
|
"call options.relativeTo.calendar.dateAdd", // 7.g
|
||||||
"get options.relativeTo.calendar.dateUntil", // 7.o
|
|
||||||
"call options.relativeTo.calendar.dateUntil", // 7.o
|
"call options.relativeTo.calendar.dateUntil", // 7.o
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.s MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 7.s MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
// BalanceDateDurationRelative
|
// BalanceDateDurationRelative
|
||||||
"get options.relativeTo.calendar.dateAdd", // 11.a.i
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.c MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 11.c MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.g MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 11.g MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.k
|
"call options.relativeTo.calendar.dateAdd", // 11.k
|
||||||
"get options.relativeTo.calendar.dateUntil", // 11.l.i
|
|
||||||
"call options.relativeTo.calendar.dateUntil", // 11.p
|
"call options.relativeTo.calendar.dateUntil", // 11.p
|
||||||
]);
|
]);
|
||||||
const instanceYears = new Temporal.Duration(1, 12, 0, 0, /* hours = */ 2400);
|
const instanceYears = new Temporal.Duration(1, 12, 0, 0, /* hours = */ 2400);
|
||||||
@ -154,19 +152,17 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through Duration.prototype.round that rounds to the nearest month:
|
// code path through Duration.prototype.round that rounds to the nearest month:
|
||||||
const expectedOpsForMonthRounding = expectedOpsForPlainRelativeTo.concat([
|
const expectedOpsForMonthRounding = expectedOpsForPlainRelativeTo.concat([
|
||||||
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
|
"get options.relativeTo.calendar.dateUntil",
|
||||||
// UnbalanceDurationRelative
|
// UnbalanceDurationRelative
|
||||||
"get options.relativeTo.calendar.dateAdd", // 9.b
|
|
||||||
"get options.relativeTo.calendar.dateUntil", // 9.c
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 9.d.i
|
"call options.relativeTo.calendar.dateAdd", // 9.d.i
|
||||||
"call options.relativeTo.calendar.dateUntil", // 9.d.iv
|
"call options.relativeTo.calendar.dateUntil", // 9.d.iv
|
||||||
// RoundDuration
|
// RoundDuration
|
||||||
"get options.relativeTo.calendar.dateAdd", // 10.b
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.c
|
"call options.relativeTo.calendar.dateAdd", // 10.c
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.e
|
"call options.relativeTo.calendar.dateAdd", // 10.e
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.k MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 10.k MoveRelativeDate
|
||||||
], Array(2).fill("call options.relativeTo.calendar.dateAdd"), [ // 2× 10.n.iii MoveRelativeDate
|
], Array(2).fill("call options.relativeTo.calendar.dateAdd"), [ // 2× 10.n.iii MoveRelativeDate
|
||||||
// BalanceDurationRelative
|
// BalanceDurationRelative
|
||||||
"get options.relativeTo.calendar.dateAdd",
|
|
||||||
"call options.relativeTo.calendar.dateAdd",
|
"call options.relativeTo.calendar.dateAdd",
|
||||||
]);
|
]);
|
||||||
const instance2 = new Temporal.Duration(1, 0, 0, 62);
|
const instance2 = new Temporal.Duration(1, 0, 0, 62);
|
||||||
@ -176,16 +172,14 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through Duration.prototype.round that rounds to the nearest week:
|
// code path through Duration.prototype.round that rounds to the nearest week:
|
||||||
const expectedOpsForWeekRounding = expectedOpsForPlainRelativeTo.concat([
|
const expectedOpsForWeekRounding = expectedOpsForPlainRelativeTo.concat([
|
||||||
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
// UnbalanceDurationRelative
|
// UnbalanceDurationRelative
|
||||||
"get options.relativeTo.calendar.dateAdd", // 10.b
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.c.i MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 10.c.i MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.d.i MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 10.d.i MoveRelativeDate
|
||||||
// RoundDuration
|
// RoundDuration
|
||||||
"get options.relativeTo.calendar.dateAdd", // 11.c
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.d MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 11.d MoveRelativeDate
|
||||||
], Array(58).fill("call options.relativeTo.calendar.dateAdd"), [ // 58× 11.g.iii MoveRelativeDate (52 + 4 + 2)
|
], Array(58).fill("call options.relativeTo.calendar.dateAdd"), [ // 58× 11.g.iii MoveRelativeDate (52 + 4 + 2)
|
||||||
// BalanceDurationRelative
|
// BalanceDurationRelative
|
||||||
"get options.relativeTo.calendar.dateAdd", // 12.b
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 12.c
|
"call options.relativeTo.calendar.dateAdd", // 12.c
|
||||||
]);
|
]);
|
||||||
const instance3 = new Temporal.Duration(1, 1, 0, 15);
|
const instance3 = new Temporal.Duration(1, 1, 0, 15);
|
||||||
@ -195,7 +189,7 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through UnbalanceDurationRelative that rounds to the nearest day:
|
// code path through UnbalanceDurationRelative that rounds to the nearest day:
|
||||||
const expectedOpsForDayRounding = expectedOpsForPlainRelativeTo.concat([
|
const expectedOpsForDayRounding = expectedOpsForPlainRelativeTo.concat([
|
||||||
"get options.relativeTo.calendar.dateAdd", // 11.a.ii
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.a.iii.1 MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 11.a.iii.1 MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.a.iv.1 MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 11.a.iv.1 MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.a.v.1 MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 11.a.v.1 MoveRelativeDate
|
||||||
@ -207,13 +201,13 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through BalanceDurationRelative balancing from days up to years:
|
// code path through BalanceDurationRelative balancing from days up to years:
|
||||||
const expectedOpsForDayToYearBalancing = expectedOpsForPlainRelativeTo.concat([
|
const expectedOpsForDayToYearBalancing = expectedOpsForPlainRelativeTo.concat([
|
||||||
"get options.relativeTo.calendar.dateAdd", // 10.a
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
|
"get options.relativeTo.calendar.dateUntil",
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.b MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 10.b MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.e.iv MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 10.e.iv MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.f MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 10.f MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.i.iv MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 10.i.iv MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.j
|
"call options.relativeTo.calendar.dateAdd", // 10.j
|
||||||
"get options.relativeTo.calendar.dateUntil", // 10.k
|
|
||||||
"call options.relativeTo.calendar.dateUntil", // 10.n
|
"call options.relativeTo.calendar.dateUntil", // 10.n
|
||||||
]);
|
]);
|
||||||
const instance5 = new Temporal.Duration(0, 0, 0, 0, /* hours = */ 396 * 24);
|
const instance5 = new Temporal.Duration(0, 0, 0, 0, /* hours = */ 396 * 24);
|
||||||
@ -223,17 +217,16 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through Duration.prototype.round balancing from months up to years:
|
// code path through Duration.prototype.round balancing from months up to years:
|
||||||
const expectedOpsForMonthToYearBalancing = expectedOpsForPlainRelativeTo.concat([
|
const expectedOpsForMonthToYearBalancing = expectedOpsForPlainRelativeTo.concat([
|
||||||
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
|
"get options.relativeTo.calendar.dateUntil",
|
||||||
// RoundDuration
|
// RoundDuration
|
||||||
"get options.relativeTo.calendar.dateAdd", // 10.b
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.c
|
"call options.relativeTo.calendar.dateAdd", // 10.c
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.e
|
"call options.relativeTo.calendar.dateAdd", // 10.e
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.k MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 10.k MoveRelativeDate
|
||||||
// BalanceDurationRelative
|
// BalanceDurationRelative
|
||||||
"get options.relativeTo.calendar.dateAdd", // 10.a
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.b MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 10.b MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.f MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 10.f MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.j
|
"call options.relativeTo.calendar.dateAdd", // 10.j
|
||||||
"get options.relativeTo.calendar.dateUntil", // 10.k
|
|
||||||
"call options.relativeTo.calendar.dateUntil", // 10.n
|
"call options.relativeTo.calendar.dateUntil", // 10.n
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.p.iv
|
"call options.relativeTo.calendar.dateAdd", // 10.p.iv
|
||||||
"call options.relativeTo.calendar.dateUntil", // 10.p.vii
|
"call options.relativeTo.calendar.dateUntil", // 10.p.vii
|
||||||
@ -244,8 +237,8 @@ assert.compareArray(actual, expectedOpsForMonthToYearBalancing, "order of operat
|
|||||||
actual.splice(0); // clear
|
actual.splice(0); // clear
|
||||||
|
|
||||||
const expectedOpsForDayToMonthBalancing = expectedOpsForPlainRelativeTo.concat([
|
const expectedOpsForDayToMonthBalancing = expectedOpsForPlainRelativeTo.concat([
|
||||||
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
// BalanceDurationRelative
|
// BalanceDurationRelative
|
||||||
"get options.relativeTo.calendar.dateAdd", // 11.a
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.b MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 11.b MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.e.iv MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 11.e.iv MoveRelativeDate
|
||||||
]);
|
]);
|
||||||
@ -255,8 +248,8 @@ assert.compareArray(actual, expectedOpsForDayToMonthBalancing, "order of operati
|
|||||||
actual.splice(0); // clear
|
actual.splice(0); // clear
|
||||||
|
|
||||||
const expectedOpsForDayToWeekBalancing = expectedOpsForPlainRelativeTo.concat([
|
const expectedOpsForDayToWeekBalancing = expectedOpsForPlainRelativeTo.concat([
|
||||||
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
// BalanceDurationRelative
|
// BalanceDurationRelative
|
||||||
"get options.relativeTo.calendar.dateAdd", // 12.b
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 12.c MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 12.c MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 12.f.iv MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 12.f.iv MoveRelativeDate
|
||||||
]);
|
]);
|
||||||
@ -292,6 +285,7 @@ const expectedOpsForZonedRelativeTo = [
|
|||||||
"has options.relativeTo.calendar.year",
|
"has options.relativeTo.calendar.year",
|
||||||
"has options.relativeTo.calendar.yearMonthFromFields",
|
"has options.relativeTo.calendar.yearMonthFromFields",
|
||||||
"has options.relativeTo.calendar.yearOfWeek",
|
"has options.relativeTo.calendar.yearOfWeek",
|
||||||
|
"get options.relativeTo.calendar.dateFromFields",
|
||||||
"get options.relativeTo.calendar.fields",
|
"get options.relativeTo.calendar.fields",
|
||||||
"call options.relativeTo.calendar.fields",
|
"call options.relativeTo.calendar.fields",
|
||||||
"get options.relativeTo.day",
|
"get options.relativeTo.day",
|
||||||
@ -328,7 +322,6 @@ const expectedOpsForZonedRelativeTo = [
|
|||||||
"get options.relativeTo.year",
|
"get options.relativeTo.year",
|
||||||
"get options.relativeTo.year.valueOf",
|
"get options.relativeTo.year.valueOf",
|
||||||
"call options.relativeTo.year.valueOf",
|
"call options.relativeTo.year.valueOf",
|
||||||
"get options.relativeTo.calendar.dateFromFields",
|
|
||||||
"call options.relativeTo.calendar.dateFromFields",
|
"call options.relativeTo.calendar.dateFromFields",
|
||||||
"has options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"has options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
"has options.relativeTo.timeZone.getPossibleInstantsFor",
|
"has options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
@ -374,6 +367,9 @@ actual.splice(0); // clear
|
|||||||
const expectedOpsForMinimalYearRoundingZoned = expectedOpsForZonedRelativeTo.concat([
|
const expectedOpsForMinimalYearRoundingZoned = expectedOpsForZonedRelativeTo.concat([
|
||||||
// ToTemporalDate
|
// ToTemporalDate
|
||||||
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
|
// lookup
|
||||||
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
|
"get options.relativeTo.calendar.dateUntil",
|
||||||
// NanosecondsToDays
|
// NanosecondsToDays
|
||||||
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", // 7. GetPlainDateTimeFor
|
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", // 7. GetPlainDateTimeFor
|
||||||
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", // 11. GetPlainDateTimeFor
|
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", // 11. GetPlainDateTimeFor
|
||||||
@ -382,9 +378,7 @@ const expectedOpsForMinimalYearRoundingZoned = expectedOpsForZonedRelativeTo.con
|
|||||||
// NanosecondsToDays → AddDaysToZonedDateTime
|
// NanosecondsToDays → AddDaysToZonedDateTime
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
// RoundDuration
|
// RoundDuration
|
||||||
"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
|
||||||
"get options.relativeTo.calendar.dateUntil", // 7.o
|
|
||||||
"call options.relativeTo.calendar.dateUntil", // 7.o
|
"call options.relativeTo.calendar.dateUntil", // 7.o
|
||||||
// 7.s not called because years, months, weeks are 0
|
// 7.s not called because years, months, weeks are 0
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
@ -401,8 +395,10 @@ actual.splice(0); // clear
|
|||||||
const expectedOpsForYearRoundingZoned = expectedOpsForZonedRelativeTo.concat([
|
const expectedOpsForYearRoundingZoned = expectedOpsForZonedRelativeTo.concat([
|
||||||
// ToTemporalDate
|
// ToTemporalDate
|
||||||
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
// MoveRelativeZonedDateTime → AddZonedDateTime
|
// lookup
|
||||||
"get options.relativeTo.calendar.dateAdd",
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
|
"get options.relativeTo.calendar.dateUntil",
|
||||||
|
// MoveRelativeZonedDateTime → AddZonedDateTime
|
||||||
"call options.relativeTo.calendar.dateAdd",
|
"call options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
// NanosecondsToDays
|
// NanosecondsToDays
|
||||||
@ -412,19 +408,15 @@ const expectedOpsForYearRoundingZoned = expectedOpsForZonedRelativeTo.concat([
|
|||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
// NanosecondsToDays → AddDaysToZonedDateTime
|
// NanosecondsToDays → AddDaysToZonedDateTime
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
"get options.relativeTo.calendar.dateAdd", // 7.c
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.e
|
"call options.relativeTo.calendar.dateAdd", // 7.e
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.g
|
"call options.relativeTo.calendar.dateAdd", // 7.g
|
||||||
"get options.relativeTo.calendar.dateUntil", // 7.o
|
|
||||||
"call options.relativeTo.calendar.dateUntil", // 7.o
|
"call options.relativeTo.calendar.dateUntil", // 7.o
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.s MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 7.s MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
// BalanceDateDurationRelative
|
// BalanceDateDurationRelative
|
||||||
"get options.relativeTo.calendar.dateAdd", // 11.a.i
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.c MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 11.c MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.g MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 11.g MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.k
|
"call options.relativeTo.calendar.dateAdd", // 11.k
|
||||||
"get options.relativeTo.calendar.dateUntil", // 11.l.i
|
|
||||||
"call options.relativeTo.calendar.dateUntil", // 11.p
|
"call options.relativeTo.calendar.dateUntil", // 11.p
|
||||||
]);
|
]);
|
||||||
instanceYears.round(createOptionsObserver({ smallestUnit: "years", relativeTo: zonedRelativeTo }));
|
instanceYears.round(createOptionsObserver({ smallestUnit: "years", relativeTo: zonedRelativeTo }));
|
||||||
@ -440,16 +432,15 @@ actual.splice(0); // clear
|
|||||||
const expectedOpsForUnbalanceRoundBalance = expectedOpsForZonedRelativeTo.concat([
|
const expectedOpsForUnbalanceRoundBalance = expectedOpsForZonedRelativeTo.concat([
|
||||||
// ToTemporalDate
|
// ToTemporalDate
|
||||||
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
|
// lookup
|
||||||
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
// No user code calls in UnbalanceDurationRelative
|
// No user code calls in UnbalanceDurationRelative
|
||||||
// RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime
|
// RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime
|
||||||
"get options.relativeTo.calendar.dateAdd", // 11.
|
|
||||||
"call options.relativeTo.calendar.dateAdd",
|
"call options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor", // 13. GetInstantFor
|
"call options.relativeTo.timeZone.getPossibleInstantsFor", // 13. GetInstantFor
|
||||||
// RoundDuration
|
// RoundDuration
|
||||||
"get options.relativeTo.calendar.dateAdd", // 8.e.i
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 8.g MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 8.g MoveRelativeDate
|
||||||
// BalanceDateDurationRelative
|
// BalanceDateDurationRelative
|
||||||
"get options.relativeTo.calendar.dateAdd", // 13.a.i
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 13.c MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 13.c MoveRelativeDate
|
||||||
]);
|
]);
|
||||||
new Temporal.Duration(0, 1, 1).round(createOptionsObserver({ largestUnit: "months", smallestUnit: "weeks", relativeTo: zonedRelativeTo }));
|
new Temporal.Duration(0, 1, 1).round(createOptionsObserver({ largestUnit: "months", smallestUnit: "weeks", relativeTo: zonedRelativeTo }));
|
||||||
|
@ -47,11 +47,12 @@ const expected = [
|
|||||||
"has calendar.year",
|
"has calendar.year",
|
||||||
"has calendar.yearMonthFromFields",
|
"has calendar.yearMonthFromFields",
|
||||||
"has calendar.yearOfWeek",
|
"has calendar.yearOfWeek",
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get calendar.dateFromFields",
|
||||||
"get calendar.fields",
|
"get calendar.fields",
|
||||||
|
// CalendarFields
|
||||||
"call calendar.fields",
|
"call calendar.fields",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get calendar.dateFromFields",
|
|
||||||
"call calendar.dateFromFields",
|
"call calendar.dateFromFields",
|
||||||
// ToTemporalTimeZoneSlotValue
|
// ToTemporalTimeZoneSlotValue
|
||||||
"has timeZone.getOffsetNanosecondsFor",
|
"has timeZone.getOffsetNanosecondsFor",
|
||||||
|
@ -92,6 +92,8 @@ const expectedOpsForPlainRelativeTo = expected.concat([
|
|||||||
"has options.relativeTo.calendar.year",
|
"has options.relativeTo.calendar.year",
|
||||||
"has options.relativeTo.calendar.yearMonthFromFields",
|
"has options.relativeTo.calendar.yearMonthFromFields",
|
||||||
"has options.relativeTo.calendar.yearOfWeek",
|
"has options.relativeTo.calendar.yearOfWeek",
|
||||||
|
// lookup
|
||||||
|
"get options.relativeTo.calendar.dateFromFields",
|
||||||
"get options.relativeTo.calendar.fields",
|
"get options.relativeTo.calendar.fields",
|
||||||
"call options.relativeTo.calendar.fields",
|
"call options.relativeTo.calendar.fields",
|
||||||
// PrepareTemporalFields
|
// PrepareTemporalFields
|
||||||
@ -116,13 +118,13 @@ const expectedOpsForPlainRelativeTo = expected.concat([
|
|||||||
"get options.relativeTo.year.valueOf",
|
"get options.relativeTo.year.valueOf",
|
||||||
"call options.relativeTo.year.valueOf",
|
"call options.relativeTo.year.valueOf",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get options.relativeTo.calendar.dateFromFields",
|
|
||||||
"call options.relativeTo.calendar.dateFromFields",
|
"call options.relativeTo.calendar.dateFromFields",
|
||||||
// AddDuration
|
// lookup 2
|
||||||
"get options.relativeTo.calendar.dateAdd",
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.calendar.dateAdd",
|
|
||||||
"call options.relativeTo.calendar.dateAdd",
|
|
||||||
"get options.relativeTo.calendar.dateUntil",
|
"get options.relativeTo.calendar.dateUntil",
|
||||||
|
// AddDuration
|
||||||
|
"call options.relativeTo.calendar.dateAdd",
|
||||||
|
"call options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.calendar.dateUntil",
|
"call options.relativeTo.calendar.dateUntil",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@ -203,6 +205,7 @@ const expectedOpsForPlainRelativeToNoCalendarOperations = [
|
|||||||
"has options.relativeTo.calendar.year",
|
"has options.relativeTo.calendar.year",
|
||||||
"has options.relativeTo.calendar.yearMonthFromFields",
|
"has options.relativeTo.calendar.yearMonthFromFields",
|
||||||
"has options.relativeTo.calendar.yearOfWeek",
|
"has options.relativeTo.calendar.yearOfWeek",
|
||||||
|
"get options.relativeTo.calendar.dateFromFields",
|
||||||
"get options.relativeTo.calendar.fields",
|
"get options.relativeTo.calendar.fields",
|
||||||
"call options.relativeTo.calendar.fields",
|
"call options.relativeTo.calendar.fields",
|
||||||
// PrepareTemporalFields
|
// PrepareTemporalFields
|
||||||
@ -227,7 +230,6 @@ const expectedOpsForPlainRelativeToNoCalendarOperations = [
|
|||||||
"get options.relativeTo.year.valueOf",
|
"get options.relativeTo.year.valueOf",
|
||||||
"call options.relativeTo.year.valueOf",
|
"call options.relativeTo.year.valueOf",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get options.relativeTo.calendar.dateFromFields",
|
|
||||||
"call options.relativeTo.calendar.dateFromFields",
|
"call options.relativeTo.calendar.dateFromFields",
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -271,6 +273,8 @@ const expectedOpsForZonedRelativeTo = expected.concat([
|
|||||||
"has options.relativeTo.calendar.year",
|
"has options.relativeTo.calendar.year",
|
||||||
"has options.relativeTo.calendar.yearMonthFromFields",
|
"has options.relativeTo.calendar.yearMonthFromFields",
|
||||||
"has options.relativeTo.calendar.yearOfWeek",
|
"has options.relativeTo.calendar.yearOfWeek",
|
||||||
|
// lookup
|
||||||
|
"get options.relativeTo.calendar.dateFromFields",
|
||||||
"get options.relativeTo.calendar.fields",
|
"get options.relativeTo.calendar.fields",
|
||||||
"call options.relativeTo.calendar.fields",
|
"call options.relativeTo.calendar.fields",
|
||||||
// PrepareTemporalFields
|
// PrepareTemporalFields
|
||||||
@ -309,7 +313,6 @@ const expectedOpsForZonedRelativeTo = expected.concat([
|
|||||||
"get options.relativeTo.year.valueOf",
|
"get options.relativeTo.year.valueOf",
|
||||||
"call options.relativeTo.year.valueOf",
|
"call options.relativeTo.year.valueOf",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get options.relativeTo.calendar.dateFromFields",
|
|
||||||
"call options.relativeTo.calendar.dateFromFields",
|
"call options.relativeTo.calendar.dateFromFields",
|
||||||
// ToRelativeTemporalObject again
|
// ToRelativeTemporalObject again
|
||||||
"has options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"has options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
@ -320,24 +323,23 @@ const expectedOpsForZonedRelativeTo = expected.concat([
|
|||||||
"get options.relativeTo.timeZone.getPossibleInstantsFor",
|
"get options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
|
// lookup 2
|
||||||
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
|
"get options.relativeTo.calendar.dateUntil",
|
||||||
// AddDuration
|
// AddDuration
|
||||||
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
// AddDuration → AddZonedDateTime 1
|
// AddDuration → AddZonedDateTime 1
|
||||||
"get options.relativeTo.calendar.dateAdd",
|
|
||||||
"call options.relativeTo.calendar.dateAdd",
|
"call options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
// AddDuration → AddZonedDateTime 2
|
// AddDuration → AddZonedDateTime 2
|
||||||
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
"get options.relativeTo.calendar.dateAdd",
|
|
||||||
"call options.relativeTo.calendar.dateAdd",
|
"call options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
// AddDuration → DifferenceZonedDateTime
|
// AddDuration → DifferenceZonedDateTime
|
||||||
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
// AddDuration → DifferenceZonedDateTime → DifferenceISODateTime
|
// AddDuration → DifferenceZonedDateTime → DifferenceISODateTime
|
||||||
"get options.relativeTo.calendar.dateUntil",
|
|
||||||
"call options.relativeTo.calendar.dateUntil",
|
"call options.relativeTo.calendar.dateUntil",
|
||||||
// AddDuration → DifferenceZonedDateTime → AddZonedDateTime
|
// AddDuration → DifferenceZonedDateTime → AddZonedDateTime
|
||||||
"get options.relativeTo.calendar.dateAdd",
|
|
||||||
"call options.relativeTo.calendar.dateAdd",
|
"call options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
// AddDuration → DifferenceZonedDateTime → NanosecondsToDays
|
// AddDuration → DifferenceZonedDateTime → NanosecondsToDays
|
||||||
|
@ -47,11 +47,12 @@ const expected = [
|
|||||||
"has calendar.year",
|
"has calendar.year",
|
||||||
"has calendar.yearMonthFromFields",
|
"has calendar.yearMonthFromFields",
|
||||||
"has calendar.yearOfWeek",
|
"has calendar.yearOfWeek",
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get calendar.dateFromFields",
|
||||||
"get calendar.fields",
|
"get calendar.fields",
|
||||||
|
// CalendarFields
|
||||||
"call calendar.fields",
|
"call calendar.fields",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get calendar.dateFromFields",
|
|
||||||
"call calendar.dateFromFields",
|
"call calendar.dateFromFields",
|
||||||
// ToTemporalTimeZoneSlotValue
|
// ToTemporalTimeZoneSlotValue
|
||||||
"has timeZone.getOffsetNanosecondsFor",
|
"has timeZone.getOffsetNanosecondsFor",
|
||||||
|
@ -57,6 +57,7 @@ const expectedOpsForPlainRelativeTo = [
|
|||||||
"has options.relativeTo.calendar.year",
|
"has options.relativeTo.calendar.year",
|
||||||
"has options.relativeTo.calendar.yearMonthFromFields",
|
"has options.relativeTo.calendar.yearMonthFromFields",
|
||||||
"has options.relativeTo.calendar.yearOfWeek",
|
"has options.relativeTo.calendar.yearOfWeek",
|
||||||
|
"get options.relativeTo.calendar.dateFromFields",
|
||||||
"get options.relativeTo.calendar.fields",
|
"get options.relativeTo.calendar.fields",
|
||||||
"call options.relativeTo.calendar.fields",
|
"call options.relativeTo.calendar.fields",
|
||||||
"get options.relativeTo.day",
|
"get options.relativeTo.day",
|
||||||
@ -79,7 +80,6 @@ const expectedOpsForPlainRelativeTo = [
|
|||||||
"get options.relativeTo.year",
|
"get options.relativeTo.year",
|
||||||
"get options.relativeTo.year.valueOf",
|
"get options.relativeTo.year.valueOf",
|
||||||
"call options.relativeTo.year.valueOf",
|
"call options.relativeTo.year.valueOf",
|
||||||
"get options.relativeTo.calendar.dateFromFields",
|
|
||||||
"call options.relativeTo.calendar.dateFromFields",
|
"call options.relativeTo.calendar.dateFromFields",
|
||||||
// GetTemporalUnit
|
// GetTemporalUnit
|
||||||
"get options.unit",
|
"get options.unit",
|
||||||
@ -102,9 +102,10 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through RoundDuration that rounds to the nearest year with minimal calendar calls:
|
// code path through RoundDuration that rounds to the nearest year with minimal calendar calls:
|
||||||
const expectedOpsForMinimalYearRounding = expectedOpsForPlainRelativeTo.concat([
|
const expectedOpsForMinimalYearRounding = expectedOpsForPlainRelativeTo.concat([
|
||||||
"get options.relativeTo.calendar.dateAdd", // 7.c
|
// lookup
|
||||||
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
|
"get options.relativeTo.calendar.dateUntil",
|
||||||
// 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
|
||||||
"get options.relativeTo.calendar.dateUntil", // 7.o
|
|
||||||
"call options.relativeTo.calendar.dateUntil", // 7.o
|
"call options.relativeTo.calendar.dateUntil", // 7.o
|
||||||
// 7.s not called because years, months, weeks are 0
|
// 7.s not called because years, months, weeks are 0
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
@ -115,10 +116,10 @@ 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 expectedOpsForYearRounding = expectedOpsForPlainRelativeTo.concat([
|
const expectedOpsForYearRounding = expectedOpsForPlainRelativeTo.concat([
|
||||||
"get options.relativeTo.calendar.dateAdd", // 7.c
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
|
"get options.relativeTo.calendar.dateUntil",
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.d
|
"call options.relativeTo.calendar.dateAdd", // 7.d
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.f
|
"call options.relativeTo.calendar.dateAdd", // 7.f
|
||||||
"get options.relativeTo.calendar.dateUntil", // 7.n
|
|
||||||
"call options.relativeTo.calendar.dateUntil", // 7.n
|
"call options.relativeTo.calendar.dateUntil", // 7.n
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.s
|
"call options.relativeTo.calendar.dateAdd", // 7.s
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.x MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 7.x MoveRelativeDate
|
||||||
@ -130,13 +131,12 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through Duration.prototype.total that rounds to the nearest month:
|
// code path through Duration.prototype.total that rounds to the nearest month:
|
||||||
const expectedOpsForMonthRounding = expectedOpsForPlainRelativeTo.concat([
|
const expectedOpsForMonthRounding = expectedOpsForPlainRelativeTo.concat([
|
||||||
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
|
"get options.relativeTo.calendar.dateUntil",
|
||||||
// UnbalanceDurationRelative
|
// UnbalanceDurationRelative
|
||||||
"get options.relativeTo.calendar.dateAdd", // 9.b
|
|
||||||
"get options.relativeTo.calendar.dateUntil", // 9.c
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 9.d.i
|
"call options.relativeTo.calendar.dateAdd", // 9.d.i
|
||||||
"call options.relativeTo.calendar.dateUntil", // 9.d.iv
|
"call options.relativeTo.calendar.dateUntil", // 9.d.iv
|
||||||
// RoundDuration
|
// RoundDuration
|
||||||
"get options.relativeTo.calendar.dateAdd", // 10.b
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.c
|
"call options.relativeTo.calendar.dateAdd", // 10.c
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.e
|
"call options.relativeTo.calendar.dateAdd", // 10.e
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.k MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 10.k MoveRelativeDate
|
||||||
@ -148,12 +148,11 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through Duration.prototype.total that rounds to the nearest week:
|
// code path through Duration.prototype.total that rounds to the nearest week:
|
||||||
const expectedOpsForWeekRounding = expectedOpsForPlainRelativeTo.concat([
|
const expectedOpsForWeekRounding = expectedOpsForPlainRelativeTo.concat([
|
||||||
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
// UnbalanceDurationRelative
|
// UnbalanceDurationRelative
|
||||||
"get options.relativeTo.calendar.dateAdd", // 10.b
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.c.i MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 10.c.i MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.d.i MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 10.d.i MoveRelativeDate
|
||||||
// RoundDuration
|
// RoundDuration
|
||||||
"get options.relativeTo.calendar.dateAdd", // 11.c
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.d MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 11.d MoveRelativeDate
|
||||||
], Array(58).fill("call options.relativeTo.calendar.dateAdd")); // 58× 11.g.iii MoveRelativeDate (52 + 4 + 2)
|
], Array(58).fill("call options.relativeTo.calendar.dateAdd")); // 58× 11.g.iii MoveRelativeDate (52 + 4 + 2)
|
||||||
const instance3 = new Temporal.Duration(1, 1, 0, 15);
|
const instance3 = new Temporal.Duration(1, 1, 0, 15);
|
||||||
@ -163,7 +162,7 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through UnbalanceDurationRelative that rounds to the nearest day:
|
// code path through UnbalanceDurationRelative that rounds to the nearest day:
|
||||||
const expectedOpsForDayRounding = expectedOpsForPlainRelativeTo.concat([
|
const expectedOpsForDayRounding = expectedOpsForPlainRelativeTo.concat([
|
||||||
"get options.relativeTo.calendar.dateAdd", // 11.a.ii
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.a.iii.1 MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 11.a.iii.1 MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.a.iv.1 MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 11.a.iv.1 MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 11.a.v.1 MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 11.a.v.1 MoveRelativeDate
|
||||||
@ -198,6 +197,7 @@ const expectedOpsForZonedRelativeTo = [
|
|||||||
"has options.relativeTo.calendar.year",
|
"has options.relativeTo.calendar.year",
|
||||||
"has options.relativeTo.calendar.yearMonthFromFields",
|
"has options.relativeTo.calendar.yearMonthFromFields",
|
||||||
"has options.relativeTo.calendar.yearOfWeek",
|
"has options.relativeTo.calendar.yearOfWeek",
|
||||||
|
"get options.relativeTo.calendar.dateFromFields",
|
||||||
"get options.relativeTo.calendar.fields",
|
"get options.relativeTo.calendar.fields",
|
||||||
"call options.relativeTo.calendar.fields",
|
"call options.relativeTo.calendar.fields",
|
||||||
"get options.relativeTo.day",
|
"get options.relativeTo.day",
|
||||||
@ -234,7 +234,6 @@ const expectedOpsForZonedRelativeTo = [
|
|||||||
"get options.relativeTo.year",
|
"get options.relativeTo.year",
|
||||||
"get options.relativeTo.year.valueOf",
|
"get options.relativeTo.year.valueOf",
|
||||||
"call options.relativeTo.year.valueOf",
|
"call options.relativeTo.year.valueOf",
|
||||||
"get options.relativeTo.calendar.dateFromFields",
|
|
||||||
"call options.relativeTo.calendar.dateFromFields",
|
"call options.relativeTo.calendar.dateFromFields",
|
||||||
"has options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"has options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
"has options.relativeTo.timeZone.getPossibleInstantsFor",
|
"has options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
@ -275,6 +274,8 @@ actual.splice(0); // clear
|
|||||||
const expectedOpsForMinimalYearRoundingZoned = expectedOpsForZonedRelativeTo.concat([
|
const expectedOpsForMinimalYearRoundingZoned = expectedOpsForZonedRelativeTo.concat([
|
||||||
// ToTemporalDate
|
// ToTemporalDate
|
||||||
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
|
"get options.relativeTo.calendar.dateAdd", // lookup
|
||||||
|
"get options.relativeTo.calendar.dateUntil",
|
||||||
// BalancePossiblyInfiniteDuration → NanosecondsToDays
|
// BalancePossiblyInfiniteDuration → NanosecondsToDays
|
||||||
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", // 7. GetPlainDateTimeFor
|
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", // 7. GetPlainDateTimeFor
|
||||||
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", // 11. GetPlainDateTimeFor
|
"call options.relativeTo.timeZone.getOffsetNanosecondsFor", // 11. GetPlainDateTimeFor
|
||||||
@ -286,9 +287,7 @@ const expectedOpsForMinimalYearRoundingZoned = expectedOpsForZonedRelativeTo.con
|
|||||||
// code path through RoundDuration that rounds to the nearest year:
|
// code path through RoundDuration that rounds to the nearest year:
|
||||||
// MoveRelativeZonedDateTime → AddDaysToZonedDateTime
|
// MoveRelativeZonedDateTime → AddDaysToZonedDateTime
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
"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
|
||||||
"get options.relativeTo.calendar.dateUntil", // 7.o
|
|
||||||
"call options.relativeTo.calendar.dateUntil", // 7.o
|
"call options.relativeTo.calendar.dateUntil", // 7.o
|
||||||
// 7.s not called because years, months, weeks are 0
|
// 7.s not called because years, months, weeks are 0
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
@ -305,8 +304,10 @@ actual.splice(0); // clear
|
|||||||
const expectedOpsForYearRoundingZoned = expectedOpsForZonedRelativeTo.concat([
|
const expectedOpsForYearRoundingZoned = expectedOpsForZonedRelativeTo.concat([
|
||||||
// ToTemporalDate
|
// ToTemporalDate
|
||||||
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
// MoveRelativeZonedDateTime → AddZonedDateTime
|
// lookup
|
||||||
"get options.relativeTo.calendar.dateAdd",
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
|
"get options.relativeTo.calendar.dateUntil",
|
||||||
|
// MoveRelativeZonedDateTime → AddZonedDateTime
|
||||||
"call options.relativeTo.calendar.dateAdd",
|
"call options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
// BalancePossiblyInfiniteTimeDurationRelative → NanosecondsToDays
|
// BalancePossiblyInfiniteTimeDurationRelative → NanosecondsToDays
|
||||||
@ -317,14 +318,11 @@ const expectedOpsForYearRoundingZoned = expectedOpsForZonedRelativeTo.concat([
|
|||||||
// BalancePossiblyInfiniteTimeDurationRelative → NanosecondsToDays → AddDaysToZonedDateTime
|
// BalancePossiblyInfiniteTimeDurationRelative → NanosecondsToDays → AddDaysToZonedDateTime
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
// RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime
|
// RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime
|
||||||
"get options.relativeTo.calendar.dateAdd",
|
|
||||||
"call options.relativeTo.calendar.dateAdd",
|
"call options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
"call options.relativeTo.timeZone.getPossibleInstantsFor",
|
||||||
// RoundDuration
|
// RoundDuration
|
||||||
"get options.relativeTo.calendar.dateAdd", // 7.c
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.e
|
"call options.relativeTo.calendar.dateAdd", // 7.e
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.g
|
"call options.relativeTo.calendar.dateAdd", // 7.g
|
||||||
"get options.relativeTo.calendar.dateUntil", // 7.o
|
|
||||||
"call options.relativeTo.calendar.dateUntil", // 7.o
|
"call options.relativeTo.calendar.dateUntil", // 7.o
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.s MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 7.s MoveRelativeDate
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
@ -341,17 +339,16 @@ actual.splice(0); // clear
|
|||||||
const expectedOpsForUnbalanceRound = expectedOpsForZonedRelativeTo.concat([
|
const expectedOpsForUnbalanceRound = expectedOpsForZonedRelativeTo.concat([
|
||||||
// ToTemporalDate
|
// ToTemporalDate
|
||||||
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
|
// lookup
|
||||||
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
// No user code calls in UnbalanceDateDurationRelative
|
// No user code calls in UnbalanceDateDurationRelative
|
||||||
// MoveRelativeZonedDateTime → AddZonedDateTime
|
// MoveRelativeZonedDateTime → AddZonedDateTime
|
||||||
"get options.relativeTo.calendar.dateAdd", // 11.
|
|
||||||
"call options.relativeTo.calendar.dateAdd",
|
"call options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor", // 13. GetInstantFor
|
"call options.relativeTo.timeZone.getPossibleInstantsFor", // 13. GetInstantFor
|
||||||
// RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime
|
// RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime
|
||||||
"get options.relativeTo.calendar.dateAdd", // 11.
|
|
||||||
"call options.relativeTo.calendar.dateAdd",
|
"call options.relativeTo.calendar.dateAdd",
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor", // 13. GetInstantFor
|
"call options.relativeTo.timeZone.getPossibleInstantsFor", // 13. GetInstantFor
|
||||||
// RoundDuration
|
// RoundDuration
|
||||||
"get options.relativeTo.calendar.dateAdd", // 7.d.i
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.f
|
"call options.relativeTo.calendar.dateAdd", // 7.f
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.h
|
"call options.relativeTo.calendar.dateAdd", // 7.h
|
||||||
"call options.relativeTo.calendar.dateAdd", // 7.n MoveRelativeDate
|
"call options.relativeTo.calendar.dateAdd", // 7.n MoveRelativeDate
|
||||||
@ -368,6 +365,8 @@ actual.splice(0); // clear
|
|||||||
const expectedOpsForBalanceRound = expectedOpsForZonedRelativeTo.concat([
|
const expectedOpsForBalanceRound = expectedOpsForZonedRelativeTo.concat([
|
||||||
// ToTemporalDate
|
// ToTemporalDate
|
||||||
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
|
||||||
|
// lookup
|
||||||
|
"get options.relativeTo.calendar.dateAdd",
|
||||||
// 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
|
||||||
@ -379,7 +378,6 @@ const expectedOpsForBalanceRound = expectedOpsForZonedRelativeTo.concat([
|
|||||||
// RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime
|
// RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime
|
||||||
"call options.relativeTo.timeZone.getPossibleInstantsFor", // 10. GetInstantFor
|
"call options.relativeTo.timeZone.getPossibleInstantsFor", // 10. GetInstantFor
|
||||||
// RoundDuration
|
// RoundDuration
|
||||||
"get options.relativeTo.calendar.dateAdd", // 10.d.i
|
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.f
|
"call options.relativeTo.calendar.dateAdd", // 10.f
|
||||||
"call options.relativeTo.calendar.dateAdd", // 10.i.iii
|
"call options.relativeTo.calendar.dateAdd", // 10.i.iii
|
||||||
]);
|
]);
|
||||||
|
@ -47,11 +47,12 @@ const expected = [
|
|||||||
"has calendar.year",
|
"has calendar.year",
|
||||||
"has calendar.yearMonthFromFields",
|
"has calendar.yearMonthFromFields",
|
||||||
"has calendar.yearOfWeek",
|
"has calendar.yearOfWeek",
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get calendar.dateFromFields",
|
||||||
"get calendar.fields",
|
"get calendar.fields",
|
||||||
|
// CalendarFields
|
||||||
"call calendar.fields",
|
"call calendar.fields",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get calendar.dateFromFields",
|
|
||||||
"call calendar.dateFromFields",
|
"call calendar.dateFromFields",
|
||||||
// ToTemporalTimeZoneSlotValue
|
// ToTemporalTimeZoneSlotValue
|
||||||
"has timeZone.getOffsetNanosecondsFor",
|
"has timeZone.getOffsetNanosecondsFor",
|
||||||
|
@ -36,6 +36,7 @@ const expected = [
|
|||||||
"has fields.calendar.year",
|
"has fields.calendar.year",
|
||||||
"has fields.calendar.yearMonthFromFields",
|
"has fields.calendar.yearMonthFromFields",
|
||||||
"has fields.calendar.yearOfWeek",
|
"has fields.calendar.yearOfWeek",
|
||||||
|
"get fields.calendar.dateFromFields",
|
||||||
"get fields.calendar.fields",
|
"get fields.calendar.fields",
|
||||||
"call fields.calendar.fields",
|
"call fields.calendar.fields",
|
||||||
"get fields.day",
|
"get fields.day",
|
||||||
@ -50,7 +51,6 @@ const expected = [
|
|||||||
"get fields.year",
|
"get fields.year",
|
||||||
"get fields.year.valueOf",
|
"get fields.year.valueOf",
|
||||||
"call fields.year.valueOf",
|
"call fields.year.valueOf",
|
||||||
"get fields.calendar.dateFromFields",
|
|
||||||
"call fields.calendar.dateFromFields",
|
"call fields.calendar.dateFromFields",
|
||||||
// inside Calendar.p.dateFromFields
|
// inside Calendar.p.dateFromFields
|
||||||
"get options.overflow.toString",
|
"get options.overflow.toString",
|
||||||
|
@ -8,7 +8,7 @@ includes: [compareArray.js, temporalHelpers.js]
|
|||||||
features: [Temporal]
|
features: [Temporal]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const expectedMinimal = [
|
const expected = [
|
||||||
// ToTemporalDate
|
// ToTemporalDate
|
||||||
"get other.calendar",
|
"get other.calendar",
|
||||||
"has other.calendar.dateAdd",
|
"has other.calendar.dateAdd",
|
||||||
@ -32,6 +32,7 @@ const expectedMinimal = [
|
|||||||
"has other.calendar.year",
|
"has other.calendar.year",
|
||||||
"has other.calendar.yearMonthFromFields",
|
"has other.calendar.yearMonthFromFields",
|
||||||
"has other.calendar.yearOfWeek",
|
"has other.calendar.yearOfWeek",
|
||||||
|
"get other.calendar.dateFromFields",
|
||||||
"get other.calendar.fields",
|
"get other.calendar.fields",
|
||||||
"call other.calendar.fields",
|
"call other.calendar.fields",
|
||||||
"get other.day",
|
"get other.day",
|
||||||
@ -46,7 +47,6 @@ const expectedMinimal = [
|
|||||||
"get other.year",
|
"get other.year",
|
||||||
"get other.year.valueOf",
|
"get other.year.valueOf",
|
||||||
"call other.year.valueOf",
|
"call other.year.valueOf",
|
||||||
"get other.calendar.dateFromFields",
|
|
||||||
"call other.calendar.dateFromFields",
|
"call other.calendar.dateFromFields",
|
||||||
// CalendarEquals
|
// CalendarEquals
|
||||||
"get this.calendar.id",
|
"get this.calendar.id",
|
||||||
@ -73,12 +73,6 @@ const expectedMinimal = [
|
|||||||
"get options.smallestUnit.toString",
|
"get options.smallestUnit.toString",
|
||||||
"call options.smallestUnit.toString",
|
"call options.smallestUnit.toString",
|
||||||
];
|
];
|
||||||
|
|
||||||
const expected = expectedMinimal.concat([
|
|
||||||
// CalendarDateUntil
|
|
||||||
"get this.calendar.dateUntil",
|
|
||||||
"call this.calendar.dateUntil",
|
|
||||||
]);
|
|
||||||
const actual = [];
|
const actual = [];
|
||||||
|
|
||||||
const ownCalendar = TemporalHelpers.calendarObserver(actual, "this.calendar");
|
const ownCalendar = TemporalHelpers.calendarObserver(actual, "this.calendar");
|
||||||
@ -109,7 +103,12 @@ actual.splice(0);
|
|||||||
|
|
||||||
// basic order of observable operations with calendar call, without rounding:
|
// basic order of observable operations with calendar call, without rounding:
|
||||||
instance.since(otherDatePropertyBag, createOptionsObserver({ largestUnit: "years" }));
|
instance.since(otherDatePropertyBag, createOptionsObserver({ largestUnit: "years" }));
|
||||||
assert.compareArray(actual, expected, "order of operations");
|
assert.compareArray(actual, expected.concat([
|
||||||
|
// lookup
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
]), "order of operations");
|
||||||
actual.splice(0); // clear
|
actual.splice(0); // clear
|
||||||
|
|
||||||
// short-circuit for identical objects:
|
// short-circuit for identical objects:
|
||||||
@ -122,15 +121,19 @@ const identicalPropertyBag = TemporalHelpers.propertyBagObserver(actual, {
|
|||||||
}, "other");
|
}, "other");
|
||||||
|
|
||||||
instance.since(identicalPropertyBag, createOptionsObserver());
|
instance.since(identicalPropertyBag, createOptionsObserver());
|
||||||
assert.compareArray(actual, expectedMinimal, "order of operations with identical dates");
|
assert.compareArray(actual, expected, "order of operations with identical dates");
|
||||||
actual.splice(0); // clear
|
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 expectedOpsForYearRounding = expected.concat([
|
const expectedOpsForYearRounding = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 7.c.i
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
// RoundDuration
|
||||||
"call this.calendar.dateAdd", // 7.e
|
"call this.calendar.dateAdd", // 7.e
|
||||||
"call this.calendar.dateAdd", // 7.g
|
"call this.calendar.dateAdd", // 7.g
|
||||||
"get this.calendar.dateUntil", // 7.o
|
|
||||||
"call this.calendar.dateUntil", // 7.o
|
"call this.calendar.dateUntil", // 7.o
|
||||||
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
]); // (7.s not called because other units can't add up to >1 year at this point)
|
]); // (7.s not called because other units can't add up to >1 year at this point)
|
||||||
@ -147,7 +150,12 @@ const otherDatePropertyBagSameMonth = TemporalHelpers.propertyBagObserver(actual
|
|||||||
calendar: TemporalHelpers.calendarObserver(actual, "other.calendar"),
|
calendar: TemporalHelpers.calendarObserver(actual, "other.calendar"),
|
||||||
}, "other");
|
}, "other");
|
||||||
const expectedOpsForYearRoundingSameMonth = expected.concat([
|
const expectedOpsForYearRoundingSameMonth = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 7.c.i
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
// RoundDuration
|
||||||
"call this.calendar.dateAdd", // 7.e
|
"call this.calendar.dateAdd", // 7.e
|
||||||
"call this.calendar.dateAdd", // 7.g
|
"call this.calendar.dateAdd", // 7.g
|
||||||
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
@ -158,7 +166,12 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through RoundDuration that rounds to the nearest month:
|
// code path through RoundDuration that rounds to the nearest month:
|
||||||
const expectedOpsForMonthRounding = expected.concat([
|
const expectedOpsForMonthRounding = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 10.b
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
// RoundDuration
|
||||||
"call this.calendar.dateAdd", // 10.c
|
"call this.calendar.dateAdd", // 10.c
|
||||||
"call this.calendar.dateAdd", // 10.e
|
"call this.calendar.dateAdd", // 10.e
|
||||||
"call this.calendar.dateAdd", // 10.k MoveRelativeDate
|
"call this.calendar.dateAdd", // 10.k MoveRelativeDate
|
||||||
@ -169,8 +182,13 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through RoundDuration that rounds to the nearest week:
|
// code path through RoundDuration that rounds to the nearest week:
|
||||||
const expectedOpsForWeekRounding = expected.concat([
|
const expectedOpsForWeekRounding = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 11.c
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
// RoundDuration
|
||||||
"call this.calendar.dateAdd", // 11.d MoveRelativeDate
|
"call this.calendar.dateAdd", // 11.d MoveRelativeDate
|
||||||
]); // (11.g.iii MoveRelativeDate not called because days already balanced)
|
]); // (11.g.iii MoveRelativeDate not called because days already balanced)
|
||||||
instance.since(otherDatePropertyBag, createOptionsObserver({ smallestUnit: "weeks" }));
|
instance.since(otherDatePropertyBag, createOptionsObserver({ smallestUnit: "weeks" }));
|
||||||
assert.compareArray(actual.slice(expected.length), expectedOpsForWeekRounding.slice(expected.length), "order of operations with smallestUnit = weeks");
|
assert.compareArray(actual, expectedOpsForWeekRounding, "order of operations with smallestUnit = weeks");
|
||||||
|
@ -8,7 +8,7 @@ includes: [compareArray.js, temporalHelpers.js]
|
|||||||
features: [Temporal]
|
features: [Temporal]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const expectedMinimal = [
|
const expected = [
|
||||||
// ToTemporalDate
|
// ToTemporalDate
|
||||||
"get other.calendar",
|
"get other.calendar",
|
||||||
"has other.calendar.dateAdd",
|
"has other.calendar.dateAdd",
|
||||||
@ -32,6 +32,7 @@ const expectedMinimal = [
|
|||||||
"has other.calendar.year",
|
"has other.calendar.year",
|
||||||
"has other.calendar.yearMonthFromFields",
|
"has other.calendar.yearMonthFromFields",
|
||||||
"has other.calendar.yearOfWeek",
|
"has other.calendar.yearOfWeek",
|
||||||
|
"get other.calendar.dateFromFields",
|
||||||
"get other.calendar.fields",
|
"get other.calendar.fields",
|
||||||
"call other.calendar.fields",
|
"call other.calendar.fields",
|
||||||
"get other.day",
|
"get other.day",
|
||||||
@ -46,7 +47,6 @@ const expectedMinimal = [
|
|||||||
"get other.year",
|
"get other.year",
|
||||||
"get other.year.valueOf",
|
"get other.year.valueOf",
|
||||||
"call other.year.valueOf",
|
"call other.year.valueOf",
|
||||||
"get other.calendar.dateFromFields",
|
|
||||||
"call other.calendar.dateFromFields",
|
"call other.calendar.dateFromFields",
|
||||||
// CalendarEquals
|
// CalendarEquals
|
||||||
"get this.calendar.id",
|
"get this.calendar.id",
|
||||||
@ -73,12 +73,6 @@ const expectedMinimal = [
|
|||||||
"get options.smallestUnit.toString",
|
"get options.smallestUnit.toString",
|
||||||
"call options.smallestUnit.toString",
|
"call options.smallestUnit.toString",
|
||||||
];
|
];
|
||||||
|
|
||||||
const expected = expectedMinimal.concat([
|
|
||||||
// CalendarDateUntil
|
|
||||||
"get this.calendar.dateUntil",
|
|
||||||
"call this.calendar.dateUntil",
|
|
||||||
]);
|
|
||||||
const actual = [];
|
const actual = [];
|
||||||
|
|
||||||
const ownCalendar = TemporalHelpers.calendarObserver(actual, "this.calendar");
|
const ownCalendar = TemporalHelpers.calendarObserver(actual, "this.calendar");
|
||||||
@ -109,7 +103,12 @@ actual.splice(0);
|
|||||||
|
|
||||||
// basic order of observable operations with calendar call, without rounding:
|
// basic order of observable operations with calendar call, without rounding:
|
||||||
instance.until(otherDatePropertyBag, createOptionsObserver({ largestUnit: "years" }));
|
instance.until(otherDatePropertyBag, createOptionsObserver({ largestUnit: "years" }));
|
||||||
assert.compareArray(actual, expected, "order of operations");
|
assert.compareArray(actual, expected.concat([
|
||||||
|
// lookup
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
]), "order of operations");
|
||||||
actual.splice(0); // clear
|
actual.splice(0); // clear
|
||||||
|
|
||||||
// short-circuit for identical objects:
|
// short-circuit for identical objects:
|
||||||
@ -123,15 +122,19 @@ const identicalPropertyBag = TemporalHelpers.propertyBagObserver(actual, {
|
|||||||
}, "other");
|
}, "other");
|
||||||
|
|
||||||
instance.since(identicalPropertyBag, createOptionsObserver());
|
instance.since(identicalPropertyBag, createOptionsObserver());
|
||||||
assert.compareArray(actual, expectedMinimal, "order of operations with identical dates");
|
assert.compareArray(actual, expected, "order of operations with identical dates");
|
||||||
actual.splice(0); // clear
|
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 expectedOpsForYearRounding = expected.concat([
|
const expectedOpsForYearRounding = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 7.c.i
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
// RoundDuration
|
||||||
"call this.calendar.dateAdd", // 7.e
|
"call this.calendar.dateAdd", // 7.e
|
||||||
"call this.calendar.dateAdd", // 7.g
|
"call this.calendar.dateAdd", // 7.g
|
||||||
"get this.calendar.dateUntil", // 7.o
|
|
||||||
"call this.calendar.dateUntil", // 7.o
|
"call this.calendar.dateUntil", // 7.o
|
||||||
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
]); // (7.s not called because other units can't add up to >1 year at this point)
|
]); // (7.s not called because other units can't add up to >1 year at this point)
|
||||||
@ -148,7 +151,12 @@ const otherDatePropertyBagSameMonth = TemporalHelpers.propertyBagObserver(actual
|
|||||||
calendar: TemporalHelpers.calendarObserver(actual, "other.calendar"),
|
calendar: TemporalHelpers.calendarObserver(actual, "other.calendar"),
|
||||||
}, "other");
|
}, "other");
|
||||||
const expectedOpsForYearRoundingSameMonth = expected.concat([
|
const expectedOpsForYearRoundingSameMonth = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 7.c.i
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
// RoundDuration
|
||||||
"call this.calendar.dateAdd", // 7.e
|
"call this.calendar.dateAdd", // 7.e
|
||||||
"call this.calendar.dateAdd", // 7.g
|
"call this.calendar.dateAdd", // 7.g
|
||||||
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
@ -159,7 +167,12 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through RoundDuration that rounds to the nearest month:
|
// code path through RoundDuration that rounds to the nearest month:
|
||||||
const expectedOpsForMonthRounding = expected.concat([
|
const expectedOpsForMonthRounding = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 10.b
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
// RoundDuration
|
||||||
"call this.calendar.dateAdd", // 10.c
|
"call this.calendar.dateAdd", // 10.c
|
||||||
"call this.calendar.dateAdd", // 10.e
|
"call this.calendar.dateAdd", // 10.e
|
||||||
"call this.calendar.dateAdd", // 10.k MoveRelativeDate
|
"call this.calendar.dateAdd", // 10.k MoveRelativeDate
|
||||||
@ -170,8 +183,13 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through RoundDuration that rounds to the nearest week:
|
// code path through RoundDuration that rounds to the nearest week:
|
||||||
const expectedOpsForWeekRounding = expected.concat([
|
const expectedOpsForWeekRounding = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 11.c
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
// RoundDuration
|
||||||
"call this.calendar.dateAdd", // 11.d MoveRelativeDate
|
"call this.calendar.dateAdd", // 11.d MoveRelativeDate
|
||||||
]); // (11.g.iii MoveRelativeDate not called because days already balanced)
|
]); // (11.g.iii MoveRelativeDate not called because days already balanced)
|
||||||
instance.until(otherDatePropertyBag, createOptionsObserver({ smallestUnit: "weeks" }));
|
instance.until(otherDatePropertyBag, createOptionsObserver({ smallestUnit: "weeks" }));
|
||||||
assert.compareArray(actual.slice(expected.length), expectedOpsForWeekRounding.slice(expected.length), "order of operations with smallestUnit = weeks");
|
assert.compareArray(actual, expectedOpsForWeekRounding, "order of operations with smallestUnit = weeks");
|
||||||
|
@ -18,8 +18,11 @@ const expected = [
|
|||||||
"get options.overflow",
|
"get options.overflow",
|
||||||
"getOwnPropertyDescriptor options.extra",
|
"getOwnPropertyDescriptor options.extra",
|
||||||
"get options.extra",
|
"get options.extra",
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get this.calendar.dateFromFields",
|
||||||
"get this.calendar.fields",
|
"get this.calendar.fields",
|
||||||
|
"get this.calendar.mergeFields",
|
||||||
|
// CalendarFields
|
||||||
"call this.calendar.fields",
|
"call this.calendar.fields",
|
||||||
// PrepareTemporalFields on receiver
|
// PrepareTemporalFields on receiver
|
||||||
"get this.calendar.day",
|
"get this.calendar.day",
|
||||||
@ -44,10 +47,8 @@ const expected = [
|
|||||||
"get fields.year.valueOf",
|
"get fields.year.valueOf",
|
||||||
"call fields.year.valueOf",
|
"call fields.year.valueOf",
|
||||||
// CalendarMergeFields
|
// CalendarMergeFields
|
||||||
"get this.calendar.mergeFields",
|
|
||||||
"call this.calendar.mergeFields",
|
"call this.calendar.mergeFields",
|
||||||
// CalendarDateFromFields
|
// CalendarDateFromFields
|
||||||
"get this.calendar.dateFromFields",
|
|
||||||
"call this.calendar.dateFromFields",
|
"call this.calendar.dateFromFields",
|
||||||
// inside Calendar.p.dateFromFields
|
// inside Calendar.p.dateFromFields
|
||||||
"get options.overflow.toString",
|
"get options.overflow.toString",
|
||||||
|
@ -38,8 +38,10 @@ const expected = [
|
|||||||
"has fields.calendar.year",
|
"has fields.calendar.year",
|
||||||
"has fields.calendar.yearMonthFromFields",
|
"has fields.calendar.yearMonthFromFields",
|
||||||
"has fields.calendar.yearOfWeek",
|
"has fields.calendar.yearOfWeek",
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get fields.calendar.dateFromFields",
|
||||||
"get fields.calendar.fields",
|
"get fields.calendar.fields",
|
||||||
|
// CalendarFields
|
||||||
"call fields.calendar.fields",
|
"call fields.calendar.fields",
|
||||||
// PrepareTemporalFields
|
// PrepareTemporalFields
|
||||||
"get fields.day",
|
"get fields.day",
|
||||||
@ -75,7 +77,6 @@ const expected = [
|
|||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get options.overflow.toString",
|
"get options.overflow.toString",
|
||||||
"call options.overflow.toString",
|
"call options.overflow.toString",
|
||||||
"get fields.calendar.dateFromFields",
|
|
||||||
"call fields.calendar.dateFromFields",
|
"call fields.calendar.dateFromFields",
|
||||||
];
|
];
|
||||||
const actual = [];
|
const actual = [];
|
||||||
|
@ -8,7 +8,7 @@ includes: [compareArray.js, temporalHelpers.js]
|
|||||||
features: [Temporal]
|
features: [Temporal]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const expectedMinimal = [
|
const expected = [
|
||||||
// ToTemporalDateTime
|
// ToTemporalDateTime
|
||||||
"get other.calendar",
|
"get other.calendar",
|
||||||
"has other.calendar.dateAdd",
|
"has other.calendar.dateAdd",
|
||||||
@ -32,6 +32,7 @@ const expectedMinimal = [
|
|||||||
"has other.calendar.year",
|
"has other.calendar.year",
|
||||||
"has other.calendar.yearMonthFromFields",
|
"has other.calendar.yearMonthFromFields",
|
||||||
"has other.calendar.yearOfWeek",
|
"has other.calendar.yearOfWeek",
|
||||||
|
"get other.calendar.dateFromFields",
|
||||||
"get other.calendar.fields",
|
"get other.calendar.fields",
|
||||||
"call other.calendar.fields",
|
"call other.calendar.fields",
|
||||||
"get other.day",
|
"get other.day",
|
||||||
@ -64,7 +65,6 @@ const expectedMinimal = [
|
|||||||
"get other.year",
|
"get other.year",
|
||||||
"get other.year.valueOf",
|
"get other.year.valueOf",
|
||||||
"call other.year.valueOf",
|
"call other.year.valueOf",
|
||||||
"get other.calendar.dateFromFields",
|
|
||||||
"call other.calendar.dateFromFields",
|
"call other.calendar.dateFromFields",
|
||||||
// CalendarEquals
|
// CalendarEquals
|
||||||
"get this.calendar.id",
|
"get this.calendar.id",
|
||||||
@ -91,12 +91,6 @@ const expectedMinimal = [
|
|||||||
"get options.smallestUnit.toString",
|
"get options.smallestUnit.toString",
|
||||||
"call options.smallestUnit.toString",
|
"call options.smallestUnit.toString",
|
||||||
];
|
];
|
||||||
|
|
||||||
const expected = expectedMinimal.concat([
|
|
||||||
// CalendarDateUntil
|
|
||||||
"get this.calendar.dateUntil",
|
|
||||||
"call this.calendar.dateUntil",
|
|
||||||
]);
|
|
||||||
const actual = [];
|
const actual = [];
|
||||||
|
|
||||||
const ownCalendar = TemporalHelpers.calendarObserver(actual, "this.calendar");
|
const ownCalendar = TemporalHelpers.calendarObserver(actual, "this.calendar");
|
||||||
@ -133,7 +127,12 @@ actual.splice(0);
|
|||||||
|
|
||||||
// basic order of observable operations with calendar call, without rounding:
|
// basic order of observable operations with calendar call, without rounding:
|
||||||
instance.since(otherDateTimePropertyBag, createOptionsObserver({ largestUnit: "years" }));
|
instance.since(otherDateTimePropertyBag, createOptionsObserver({ largestUnit: "years" }));
|
||||||
assert.compareArray(actual, expected, "order of operations");
|
assert.compareArray(actual, expected.concat([
|
||||||
|
// lookup
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
]), "order of operations");
|
||||||
actual.splice(0); // clear
|
actual.splice(0); // clear
|
||||||
|
|
||||||
// short-circuit for identical objects:
|
// short-circuit for identical objects:
|
||||||
@ -152,15 +151,19 @@ const identicalPropertyBag = TemporalHelpers.propertyBagObserver(actual, {
|
|||||||
}, "other");
|
}, "other");
|
||||||
|
|
||||||
instance.since(identicalPropertyBag, createOptionsObserver());
|
instance.since(identicalPropertyBag, createOptionsObserver());
|
||||||
assert.compareArray(actual, expectedMinimal, "order of operations with identical datetimes");
|
assert.compareArray(actual, expected, "order of operations with identical datetimes");
|
||||||
actual.splice(0); // clear
|
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 expectedOpsForYearRounding = expected.concat([
|
const expectedOpsForYearRounding = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 7.c.i
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
// RoundDuration
|
||||||
"call this.calendar.dateAdd", // 7.e
|
"call this.calendar.dateAdd", // 7.e
|
||||||
"call this.calendar.dateAdd", // 7.g
|
"call this.calendar.dateAdd", // 7.g
|
||||||
"get this.calendar.dateUntil", // 7.o
|
|
||||||
"call this.calendar.dateUntil", // 7.o
|
"call this.calendar.dateUntil", // 7.o
|
||||||
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
]); // (7.s not called because other units can't add up to >1 year at this point)
|
]); // (7.s not called because other units can't add up to >1 year at this point)
|
||||||
@ -183,7 +186,12 @@ const otherDatePropertyBagSameMonth = TemporalHelpers.propertyBagObserver(actual
|
|||||||
calendar: TemporalHelpers.calendarObserver(actual, "other.calendar"),
|
calendar: TemporalHelpers.calendarObserver(actual, "other.calendar"),
|
||||||
}, "other");
|
}, "other");
|
||||||
const expectedOpsForYearRoundingSameMonth = expected.concat([
|
const expectedOpsForYearRoundingSameMonth = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 7.c.i
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
// RoundDuration
|
||||||
"call this.calendar.dateAdd", // 7.e
|
"call this.calendar.dateAdd", // 7.e
|
||||||
"call this.calendar.dateAdd", // 7.g
|
"call this.calendar.dateAdd", // 7.g
|
||||||
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
@ -194,7 +202,12 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through RoundDuration that rounds to the nearest month:
|
// code path through RoundDuration that rounds to the nearest month:
|
||||||
const expectedOpsForMonthRounding = expected.concat([
|
const expectedOpsForMonthRounding = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 10.b
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
// RoundDuration
|
||||||
"call this.calendar.dateAdd", // 10.c
|
"call this.calendar.dateAdd", // 10.c
|
||||||
"call this.calendar.dateAdd", // 10.e
|
"call this.calendar.dateAdd", // 10.e
|
||||||
"call this.calendar.dateAdd", // 10.k MoveRelativeDate
|
"call this.calendar.dateAdd", // 10.k MoveRelativeDate
|
||||||
@ -205,8 +218,13 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through RoundDuration that rounds to the nearest week:
|
// code path through RoundDuration that rounds to the nearest week:
|
||||||
const expectedOpsForWeekRounding = expected.concat([
|
const expectedOpsForWeekRounding = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 11.c
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
// RoundDuration
|
||||||
"call this.calendar.dateAdd", // 11.d MoveRelativeDate
|
"call this.calendar.dateAdd", // 11.d MoveRelativeDate
|
||||||
]); // (11.g.iii MoveRelativeDate not called because days already balanced)
|
]); // (11.g.iii MoveRelativeDate not called because days already balanced)
|
||||||
instance.since(otherDateTimePropertyBag, createOptionsObserver({ smallestUnit: "weeks" }));
|
instance.since(otherDateTimePropertyBag, createOptionsObserver({ smallestUnit: "weeks" }));
|
||||||
assert.compareArray(actual.slice(expected.length), expectedOpsForWeekRounding.slice(expected.length), "order of operations with smallestUnit = weeks");
|
assert.compareArray(actual, expectedOpsForWeekRounding, "order of operations with smallestUnit = weeks");
|
||||||
|
@ -8,7 +8,7 @@ includes: [compareArray.js, temporalHelpers.js]
|
|||||||
features: [Temporal]
|
features: [Temporal]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
const expectedMinimal = [
|
const expected = [
|
||||||
// ToTemporalDateTime
|
// ToTemporalDateTime
|
||||||
"get other.calendar",
|
"get other.calendar",
|
||||||
"has other.calendar.dateAdd",
|
"has other.calendar.dateAdd",
|
||||||
@ -32,6 +32,7 @@ const expectedMinimal = [
|
|||||||
"has other.calendar.year",
|
"has other.calendar.year",
|
||||||
"has other.calendar.yearMonthFromFields",
|
"has other.calendar.yearMonthFromFields",
|
||||||
"has other.calendar.yearOfWeek",
|
"has other.calendar.yearOfWeek",
|
||||||
|
"get other.calendar.dateFromFields",
|
||||||
"get other.calendar.fields",
|
"get other.calendar.fields",
|
||||||
"call other.calendar.fields",
|
"call other.calendar.fields",
|
||||||
"get other.day",
|
"get other.day",
|
||||||
@ -64,7 +65,6 @@ const expectedMinimal = [
|
|||||||
"get other.year",
|
"get other.year",
|
||||||
"get other.year.valueOf",
|
"get other.year.valueOf",
|
||||||
"call other.year.valueOf",
|
"call other.year.valueOf",
|
||||||
"get other.calendar.dateFromFields",
|
|
||||||
"call other.calendar.dateFromFields",
|
"call other.calendar.dateFromFields",
|
||||||
// CalendarEquals
|
// CalendarEquals
|
||||||
"get this.calendar.id",
|
"get this.calendar.id",
|
||||||
@ -91,12 +91,6 @@ const expectedMinimal = [
|
|||||||
"get options.smallestUnit.toString",
|
"get options.smallestUnit.toString",
|
||||||
"call options.smallestUnit.toString",
|
"call options.smallestUnit.toString",
|
||||||
];
|
];
|
||||||
|
|
||||||
const expected = expectedMinimal.concat([
|
|
||||||
// CalendarDateUntil
|
|
||||||
"get this.calendar.dateUntil",
|
|
||||||
"call this.calendar.dateUntil",
|
|
||||||
]);
|
|
||||||
const actual = [];
|
const actual = [];
|
||||||
|
|
||||||
const ownCalendar = TemporalHelpers.calendarObserver(actual, "this.calendar");
|
const ownCalendar = TemporalHelpers.calendarObserver(actual, "this.calendar");
|
||||||
@ -133,7 +127,12 @@ actual.splice(0);
|
|||||||
|
|
||||||
// basic order of observable operations with calendar call, without rounding:
|
// basic order of observable operations with calendar call, without rounding:
|
||||||
instance.until(otherDateTimePropertyBag, createOptionsObserver({ largestUnit: "years" }));
|
instance.until(otherDateTimePropertyBag, createOptionsObserver({ largestUnit: "years" }));
|
||||||
assert.compareArray(actual, expected, "order of operations");
|
assert.compareArray(actual, expected.concat([
|
||||||
|
// lookup
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
]), "order of operations");
|
||||||
actual.splice(0); // clear
|
actual.splice(0); // clear
|
||||||
|
|
||||||
// short-circuit for identical objects:
|
// short-circuit for identical objects:
|
||||||
@ -152,15 +151,19 @@ const identicalPropertyBag = TemporalHelpers.propertyBagObserver(actual, {
|
|||||||
}, "other");
|
}, "other");
|
||||||
|
|
||||||
instance.until(identicalPropertyBag, createOptionsObserver());
|
instance.until(identicalPropertyBag, createOptionsObserver());
|
||||||
assert.compareArray(actual, expectedMinimal, "order of operations with identical datetimes");
|
assert.compareArray(actual, expected, "order of operations with identical datetimes");
|
||||||
actual.splice(0); // clear
|
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 expectedOpsForYearRounding = expected.concat([
|
const expectedOpsForYearRounding = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 7.c.i
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
// RoundDuration
|
||||||
"call this.calendar.dateAdd", // 7.e
|
"call this.calendar.dateAdd", // 7.e
|
||||||
"call this.calendar.dateAdd", // 7.g
|
"call this.calendar.dateAdd", // 7.g
|
||||||
"get this.calendar.dateUntil", // 7.o
|
|
||||||
"call this.calendar.dateUntil", // 7.o
|
"call this.calendar.dateUntil", // 7.o
|
||||||
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
]); // (7.s not called because other units can't add up to >1 year at this point)
|
]); // (7.s not called because other units can't add up to >1 year at this point)
|
||||||
@ -183,7 +186,12 @@ const otherDatePropertyBagSameMonth = TemporalHelpers.propertyBagObserver(actual
|
|||||||
calendar: TemporalHelpers.calendarObserver(actual, "other.calendar"),
|
calendar: TemporalHelpers.calendarObserver(actual, "other.calendar"),
|
||||||
}, "other");
|
}, "other");
|
||||||
const expectedOpsForYearRoundingSameMonth = expected.concat([
|
const expectedOpsForYearRoundingSameMonth = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 7.c.i
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
// RoundDuration
|
||||||
"call this.calendar.dateAdd", // 7.e
|
"call this.calendar.dateAdd", // 7.e
|
||||||
"call this.calendar.dateAdd", // 7.g
|
"call this.calendar.dateAdd", // 7.g
|
||||||
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
@ -194,7 +202,12 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through RoundDuration that rounds to the nearest month:
|
// code path through RoundDuration that rounds to the nearest month:
|
||||||
const expectedOpsForMonthRounding = expected.concat([
|
const expectedOpsForMonthRounding = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 10.b
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
// RoundDuration
|
||||||
"call this.calendar.dateAdd", // 10.c
|
"call this.calendar.dateAdd", // 10.c
|
||||||
"call this.calendar.dateAdd", // 10.e
|
"call this.calendar.dateAdd", // 10.e
|
||||||
"call this.calendar.dateAdd", // 10.k MoveRelativeDate
|
"call this.calendar.dateAdd", // 10.k MoveRelativeDate
|
||||||
@ -205,8 +218,13 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through RoundDuration that rounds to the nearest week:
|
// code path through RoundDuration that rounds to the nearest week:
|
||||||
const expectedOpsForWeekRounding = expected.concat([
|
const expectedOpsForWeekRounding = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 11.c
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
// RoundDuration
|
||||||
"call this.calendar.dateAdd", // 11.d MoveRelativeDate
|
"call this.calendar.dateAdd", // 11.d MoveRelativeDate
|
||||||
]); // (11.g.iii MoveRelativeDate not called because days already balanced)
|
]); // (11.g.iii MoveRelativeDate not called because days already balanced)
|
||||||
instance.until(otherDateTimePropertyBag, createOptionsObserver({ smallestUnit: "weeks" }));
|
instance.until(otherDateTimePropertyBag, createOptionsObserver({ smallestUnit: "weeks" }));
|
||||||
assert.compareArray(actual.slice(expected.length), expectedOpsForWeekRounding.slice(expected.length), "order of operations with smallestUnit = weeks");
|
assert.compareArray(actual, expectedOpsForWeekRounding, "order of operations with smallestUnit = weeks");
|
||||||
|
@ -18,8 +18,11 @@ const expected = [
|
|||||||
"get options.overflow",
|
"get options.overflow",
|
||||||
"getOwnPropertyDescriptor options.extra",
|
"getOwnPropertyDescriptor options.extra",
|
||||||
"get options.extra",
|
"get options.extra",
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get this.calendar.dateFromFields",
|
||||||
"get this.calendar.fields",
|
"get this.calendar.fields",
|
||||||
|
"get this.calendar.mergeFields",
|
||||||
|
// CalendarFields
|
||||||
"call this.calendar.fields",
|
"call this.calendar.fields",
|
||||||
// PrepareTemporalFields on receiver
|
// PrepareTemporalFields on receiver
|
||||||
"get this.calendar.day",
|
"get this.calendar.day",
|
||||||
@ -62,12 +65,10 @@ const expected = [
|
|||||||
"get fields.year.valueOf",
|
"get fields.year.valueOf",
|
||||||
"call fields.year.valueOf",
|
"call fields.year.valueOf",
|
||||||
// CalendarMergeFields
|
// CalendarMergeFields
|
||||||
"get this.calendar.mergeFields",
|
|
||||||
"call this.calendar.mergeFields",
|
"call this.calendar.mergeFields",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get options.overflow.toString",
|
"get options.overflow.toString",
|
||||||
"call options.overflow.toString",
|
"call options.overflow.toString",
|
||||||
"get this.calendar.dateFromFields",
|
|
||||||
"call this.calendar.dateFromFields",
|
"call this.calendar.dateFromFields",
|
||||||
];
|
];
|
||||||
const actual = [];
|
const actual = [];
|
||||||
|
@ -37,8 +37,10 @@ const expected = [
|
|||||||
"has fields.calendar.year",
|
"has fields.calendar.year",
|
||||||
"has fields.calendar.yearMonthFromFields",
|
"has fields.calendar.yearMonthFromFields",
|
||||||
"has fields.calendar.yearOfWeek",
|
"has fields.calendar.yearOfWeek",
|
||||||
// CalendarFields
|
// lookup
|
||||||
"get fields.calendar.fields",
|
"get fields.calendar.fields",
|
||||||
|
"get fields.calendar.monthDayFromFields",
|
||||||
|
// CalendarFields
|
||||||
"call fields.calendar.fields",
|
"call fields.calendar.fields",
|
||||||
// PrepareTemporalFields
|
// PrepareTemporalFields
|
||||||
"get fields.day",
|
"get fields.day",
|
||||||
@ -54,7 +56,6 @@ const expected = [
|
|||||||
"get fields.year.valueOf",
|
"get fields.year.valueOf",
|
||||||
"call fields.year.valueOf",
|
"call fields.year.valueOf",
|
||||||
// CalendarMonthDayFromFields
|
// CalendarMonthDayFromFields
|
||||||
"get fields.calendar.monthDayFromFields",
|
|
||||||
"call fields.calendar.monthDayFromFields",
|
"call fields.calendar.monthDayFromFields",
|
||||||
// inside Calendar.p.monthDayFromFields
|
// inside Calendar.p.monthDayFromFields
|
||||||
"get options.overflow.toString",
|
"get options.overflow.toString",
|
||||||
|
@ -18,8 +18,11 @@ const expected = [
|
|||||||
"get options.overflow",
|
"get options.overflow",
|
||||||
"getOwnPropertyDescriptor options.extra",
|
"getOwnPropertyDescriptor options.extra",
|
||||||
"get options.extra",
|
"get options.extra",
|
||||||
// CalendarFields
|
// lookup
|
||||||
"get this.calendar.fields",
|
"get this.calendar.fields",
|
||||||
|
"get this.calendar.mergeFields",
|
||||||
|
"get this.calendar.monthDayFromFields",
|
||||||
|
// CalendarFields
|
||||||
"call this.calendar.fields",
|
"call this.calendar.fields",
|
||||||
// PrepareTemporalFields on receiver
|
// PrepareTemporalFields on receiver
|
||||||
"get this.calendar.day",
|
"get this.calendar.day",
|
||||||
@ -40,10 +43,8 @@ const expected = [
|
|||||||
"get fields.year.valueOf",
|
"get fields.year.valueOf",
|
||||||
"call fields.year.valueOf",
|
"call fields.year.valueOf",
|
||||||
// CalendarMergeFields
|
// CalendarMergeFields
|
||||||
"get this.calendar.mergeFields",
|
|
||||||
"call this.calendar.mergeFields",
|
"call this.calendar.mergeFields",
|
||||||
// CalendarMonthDayFromFields
|
// CalendarMonthDayFromFields
|
||||||
"get this.calendar.monthDayFromFields",
|
|
||||||
"call this.calendar.monthDayFromFields",
|
"call this.calendar.monthDayFromFields",
|
||||||
// inside Calendar.p.monthDayFromFields
|
// inside Calendar.p.monthDayFromFields
|
||||||
"get options.overflow.toString",
|
"get options.overflow.toString",
|
||||||
|
@ -33,6 +33,7 @@ const expected = [
|
|||||||
"has item.plainDate.calendar.year",
|
"has item.plainDate.calendar.year",
|
||||||
"has item.plainDate.calendar.yearMonthFromFields",
|
"has item.plainDate.calendar.yearMonthFromFields",
|
||||||
"has item.plainDate.calendar.yearOfWeek",
|
"has item.plainDate.calendar.yearOfWeek",
|
||||||
|
"get item.plainDate.calendar.dateFromFields",
|
||||||
"get item.plainDate.calendar.fields",
|
"get item.plainDate.calendar.fields",
|
||||||
"call item.plainDate.calendar.fields",
|
"call item.plainDate.calendar.fields",
|
||||||
"get item.plainDate.day",
|
"get item.plainDate.day",
|
||||||
@ -47,7 +48,6 @@ const expected = [
|
|||||||
"get item.plainDate.year",
|
"get item.plainDate.year",
|
||||||
"get item.plainDate.year.valueOf",
|
"get item.plainDate.year.valueOf",
|
||||||
"call item.plainDate.year.valueOf",
|
"call item.plainDate.year.valueOf",
|
||||||
"get item.plainDate.calendar.dateFromFields",
|
|
||||||
"call item.plainDate.calendar.dateFromFields",
|
"call item.plainDate.calendar.dateFromFields",
|
||||||
"get item.timeZone",
|
"get item.timeZone",
|
||||||
"has item.timeZone.getOffsetNanosecondsFor",
|
"has item.timeZone.getOffsetNanosecondsFor",
|
||||||
|
@ -38,8 +38,10 @@ const expected = [
|
|||||||
"has fields.calendar.year",
|
"has fields.calendar.year",
|
||||||
"has fields.calendar.yearMonthFromFields",
|
"has fields.calendar.yearMonthFromFields",
|
||||||
"has fields.calendar.yearOfWeek",
|
"has fields.calendar.yearOfWeek",
|
||||||
// CalendarFields
|
// lookup
|
||||||
"get fields.calendar.fields",
|
"get fields.calendar.fields",
|
||||||
|
"get fields.calendar.yearMonthFromFields",
|
||||||
|
// CalendarFields
|
||||||
"call fields.calendar.fields",
|
"call fields.calendar.fields",
|
||||||
// PrepareTemporalFields
|
// PrepareTemporalFields
|
||||||
"get fields.month",
|
"get fields.month",
|
||||||
@ -52,7 +54,6 @@ const expected = [
|
|||||||
"get fields.year.valueOf",
|
"get fields.year.valueOf",
|
||||||
"call fields.year.valueOf",
|
"call fields.year.valueOf",
|
||||||
// CalendarYearMonthFromFields
|
// CalendarYearMonthFromFields
|
||||||
"get fields.calendar.yearMonthFromFields",
|
|
||||||
"call fields.calendar.yearMonthFromFields",
|
"call fields.calendar.yearMonthFromFields",
|
||||||
// inside Calendar.p.yearMonthFromFields
|
// inside Calendar.p.yearMonthFromFields
|
||||||
"get options.overflow.toString",
|
"get options.overflow.toString",
|
||||||
|
@ -40,8 +40,12 @@ const expected = [
|
|||||||
"get fields.years",
|
"get fields.years",
|
||||||
"get fields.years.valueOf",
|
"get fields.years.valueOf",
|
||||||
"call fields.years.valueOf",
|
"call fields.years.valueOf",
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateFromFields",
|
||||||
"get this.calendar.fields",
|
"get this.calendar.fields",
|
||||||
|
"get this.calendar.yearMonthFromFields",
|
||||||
|
// CalendarFields
|
||||||
"call this.calendar.fields",
|
"call this.calendar.fields",
|
||||||
// PrepareTemporalFields on receiver
|
// PrepareTemporalFields on receiver
|
||||||
"get this.calendar.monthCode",
|
"get this.calendar.monthCode",
|
||||||
@ -49,9 +53,7 @@ const expected = [
|
|||||||
"get this.calendar.year",
|
"get this.calendar.year",
|
||||||
"call this.calendar.year",
|
"call this.calendar.year",
|
||||||
// CalendarDateFromFields
|
// CalendarDateFromFields
|
||||||
"get this.calendar.dateFromFields",
|
|
||||||
"call this.calendar.dateFromFields",
|
"call this.calendar.dateFromFields",
|
||||||
"get this.calendar.dateAdd",
|
|
||||||
// CopyDataProperties
|
// CopyDataProperties
|
||||||
"ownKeys options",
|
"ownKeys options",
|
||||||
"getOwnPropertyDescriptor options.overflow",
|
"getOwnPropertyDescriptor options.overflow",
|
||||||
@ -68,7 +70,6 @@ const expected = [
|
|||||||
"get this.calendar.year",
|
"get this.calendar.year",
|
||||||
"call this.calendar.year",
|
"call this.calendar.year",
|
||||||
// CalendarYearMonthFromFields
|
// CalendarYearMonthFromFields
|
||||||
"get this.calendar.yearMonthFromFields",
|
|
||||||
"call this.calendar.yearMonthFromFields",
|
"call this.calendar.yearMonthFromFields",
|
||||||
// inside Calendar.p.yearMonthFromFields
|
// inside Calendar.p.yearMonthFromFields
|
||||||
"get options.overflow.toString",
|
"get options.overflow.toString",
|
||||||
@ -127,8 +128,11 @@ const noCalendarExpected = [
|
|||||||
"call fields.seconds.valueOf",
|
"call fields.seconds.valueOf",
|
||||||
"get fields.weeks",
|
"get fields.weeks",
|
||||||
"get fields.years",
|
"get fields.years",
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get this.calendar.dateFromFields",
|
||||||
"get this.calendar.fields",
|
"get this.calendar.fields",
|
||||||
|
"get this.calendar.yearMonthFromFields",
|
||||||
|
// CalendarFields
|
||||||
"call this.calendar.fields",
|
"call this.calendar.fields",
|
||||||
// PrepareTemporalFields on receiver
|
// PrepareTemporalFields on receiver
|
||||||
"get this.calendar.monthCode",
|
"get this.calendar.monthCode",
|
||||||
@ -136,9 +140,7 @@ const noCalendarExpected = [
|
|||||||
"get this.calendar.year",
|
"get this.calendar.year",
|
||||||
"call this.calendar.year",
|
"call this.calendar.year",
|
||||||
// CalendarDateFromFields
|
// CalendarDateFromFields
|
||||||
"get this.calendar.dateFromFields",
|
|
||||||
"call this.calendar.dateFromFields",
|
"call this.calendar.dateFromFields",
|
||||||
"get this.calendar.dateAdd",
|
|
||||||
// SnapshotOwnProperties
|
// SnapshotOwnProperties
|
||||||
"ownKeys options",
|
"ownKeys options",
|
||||||
"getOwnPropertyDescriptor options.overflow",
|
"getOwnPropertyDescriptor options.overflow",
|
||||||
@ -153,7 +155,6 @@ const noCalendarExpected = [
|
|||||||
"get this.calendar.year",
|
"get this.calendar.year",
|
||||||
"call this.calendar.year",
|
"call this.calendar.year",
|
||||||
// CalendarYearMonthFromFields
|
// CalendarYearMonthFromFields
|
||||||
"get this.calendar.yearMonthFromFields",
|
|
||||||
"call this.calendar.yearMonthFromFields",
|
"call this.calendar.yearMonthFromFields",
|
||||||
// inside Calendar.p.yearMonthFromFields
|
// inside Calendar.p.yearMonthFromFields
|
||||||
"get options.overflow.toString",
|
"get options.overflow.toString",
|
||||||
|
@ -33,6 +33,7 @@ const expectedMinimal = [
|
|||||||
"has other.calendar.yearMonthFromFields",
|
"has other.calendar.yearMonthFromFields",
|
||||||
"has other.calendar.yearOfWeek",
|
"has other.calendar.yearOfWeek",
|
||||||
"get other.calendar.fields",
|
"get other.calendar.fields",
|
||||||
|
"get other.calendar.yearMonthFromFields",
|
||||||
"call other.calendar.fields",
|
"call other.calendar.fields",
|
||||||
"get other.month",
|
"get other.month",
|
||||||
"get other.month.valueOf",
|
"get other.month.valueOf",
|
||||||
@ -43,7 +44,6 @@ const expectedMinimal = [
|
|||||||
"get other.year",
|
"get other.year",
|
||||||
"get other.year.valueOf",
|
"get other.year.valueOf",
|
||||||
"call other.year.valueOf",
|
"call other.year.valueOf",
|
||||||
"get other.calendar.yearMonthFromFields",
|
|
||||||
"call other.calendar.yearMonthFromFields",
|
"call other.calendar.yearMonthFromFields",
|
||||||
// CalendarEquals
|
// CalendarEquals
|
||||||
"get this.calendar.id",
|
"get this.calendar.id",
|
||||||
@ -72,25 +72,26 @@ const expectedMinimal = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const expected = expectedMinimal.concat([
|
const expected = expectedMinimal.concat([
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateFromFields",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
"get this.calendar.fields",
|
"get this.calendar.fields",
|
||||||
|
// CalendarFields
|
||||||
"call this.calendar.fields",
|
"call this.calendar.fields",
|
||||||
// PrepareTemporalFields / CalendarDateFromFields (receiver)
|
// PrepareTemporalFields / CalendarDateFromFields (receiver)
|
||||||
"get this.calendar.monthCode",
|
"get this.calendar.monthCode",
|
||||||
"call this.calendar.monthCode",
|
"call this.calendar.monthCode",
|
||||||
"get this.calendar.year",
|
"get this.calendar.year",
|
||||||
"call this.calendar.year",
|
"call this.calendar.year",
|
||||||
"get this.calendar.dateFromFields",
|
|
||||||
"call this.calendar.dateFromFields",
|
"call this.calendar.dateFromFields",
|
||||||
// PrepareTemporalFields / CalendarDateFromFields (argument)
|
// PrepareTemporalFields / CalendarDateFromFields (argument)
|
||||||
"get other.calendar.monthCode",
|
"get other.calendar.monthCode",
|
||||||
"call other.calendar.monthCode",
|
"call other.calendar.monthCode",
|
||||||
"get other.calendar.year",
|
"get other.calendar.year",
|
||||||
"call other.calendar.year",
|
"call other.calendar.year",
|
||||||
"get this.calendar.dateFromFields",
|
|
||||||
"call this.calendar.dateFromFields",
|
"call this.calendar.dateFromFields",
|
||||||
// CalendarDateUntil
|
// CalendarDateUntil
|
||||||
"get this.calendar.dateUntil",
|
|
||||||
"call this.calendar.dateUntil",
|
"call this.calendar.dateUntil",
|
||||||
]);
|
]);
|
||||||
const actual = [];
|
const actual = [];
|
||||||
@ -122,7 +123,28 @@ actual.splice(0);
|
|||||||
|
|
||||||
// code path that skips RoundDuration:
|
// code path that skips RoundDuration:
|
||||||
instance.since(otherYearMonthPropertyBag, createOptionsObserver({ smallestUnit: "months", roundingIncrement: 1 }));
|
instance.since(otherYearMonthPropertyBag, createOptionsObserver({ smallestUnit: "months", roundingIncrement: 1 }));
|
||||||
assert.compareArray(actual, expected, "order of operations with no rounding");
|
assert.compareArray(actual, expectedMinimal.concat([
|
||||||
|
// lookup
|
||||||
|
"get this.calendar.dateFromFields",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
"get this.calendar.fields",
|
||||||
|
// CalendarFields
|
||||||
|
"call this.calendar.fields",
|
||||||
|
// PrepareTemporalFields / CalendarDateFromFields (receiver)
|
||||||
|
"get this.calendar.monthCode",
|
||||||
|
"call this.calendar.monthCode",
|
||||||
|
"get this.calendar.year",
|
||||||
|
"call this.calendar.year",
|
||||||
|
"call this.calendar.dateFromFields",
|
||||||
|
// PrepareTemporalFields / CalendarDateFromFields (argument)
|
||||||
|
"get other.calendar.monthCode",
|
||||||
|
"call other.calendar.monthCode",
|
||||||
|
"get other.calendar.year",
|
||||||
|
"call other.calendar.year",
|
||||||
|
"call this.calendar.dateFromFields",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
]), "order of operations with no rounding");
|
||||||
actual.splice(0); // clear
|
actual.splice(0); // clear
|
||||||
|
|
||||||
// short-circuit for identical objects:
|
// short-circuit for identical objects:
|
||||||
@ -139,10 +161,8 @@ 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 expectedOpsForYearRounding = expected.concat([
|
const expectedOpsForYearRounding = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 7.c.i
|
|
||||||
"call this.calendar.dateAdd", // 7.e
|
"call this.calendar.dateAdd", // 7.e
|
||||||
"call this.calendar.dateAdd", // 7.g
|
"call this.calendar.dateAdd", // 7.g
|
||||||
"get this.calendar.dateUntil", // 7.o
|
|
||||||
"call this.calendar.dateUntil", // 7.o
|
"call this.calendar.dateUntil", // 7.o
|
||||||
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
]); // (7.s not called because other units can't add up to >1 year at this point)
|
]); // (7.s not called because other units can't add up to >1 year at this point)
|
||||||
@ -158,7 +178,6 @@ const otherYearMonthPropertyBagSameMonth = TemporalHelpers.propertyBagObserver(a
|
|||||||
calendar: TemporalHelpers.calendarObserver(actual, "other.calendar"),
|
calendar: TemporalHelpers.calendarObserver(actual, "other.calendar"),
|
||||||
}, "other");
|
}, "other");
|
||||||
const expectedOpsForYearRoundingSameMonth = expected.concat([
|
const expectedOpsForYearRoundingSameMonth = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 7.c.i
|
|
||||||
"call this.calendar.dateAdd", // 7.e
|
"call this.calendar.dateAdd", // 7.e
|
||||||
"call this.calendar.dateAdd", // 7.g
|
"call this.calendar.dateAdd", // 7.g
|
||||||
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
@ -169,7 +188,6 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through RoundDuration that rounds to the nearest month:
|
// code path through RoundDuration that rounds to the nearest month:
|
||||||
const expectedOpsForMonthRounding = expected.concat([
|
const expectedOpsForMonthRounding = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 10.b
|
|
||||||
"call this.calendar.dateAdd", // 10.c
|
"call this.calendar.dateAdd", // 10.c
|
||||||
"call this.calendar.dateAdd", // 10.e
|
"call this.calendar.dateAdd", // 10.e
|
||||||
"call this.calendar.dateAdd", // 10.k MoveRelativeDate
|
"call this.calendar.dateAdd", // 10.k MoveRelativeDate
|
||||||
|
@ -40,22 +40,23 @@ const expected = [
|
|||||||
"get fields.years",
|
"get fields.years",
|
||||||
"get fields.years.valueOf",
|
"get fields.years.valueOf",
|
||||||
"call fields.years.valueOf",
|
"call fields.years.valueOf",
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateFromFields",
|
||||||
|
"get this.calendar.day",
|
||||||
"get this.calendar.fields",
|
"get this.calendar.fields",
|
||||||
|
"get this.calendar.yearMonthFromFields",
|
||||||
|
// CalendarFields
|
||||||
"call this.calendar.fields",
|
"call this.calendar.fields",
|
||||||
// PrepareTemporalFields on receiver
|
// PrepareTemporalFields on receiver
|
||||||
"get this.calendar.monthCode",
|
"get this.calendar.monthCode",
|
||||||
"call this.calendar.monthCode",
|
"call this.calendar.monthCode",
|
||||||
"get this.calendar.year",
|
"get this.calendar.year",
|
||||||
"call this.calendar.year",
|
"call this.calendar.year",
|
||||||
// CalendarDaysInMonth
|
// calculate last day of month
|
||||||
"get this.calendar.dateFromFields",
|
|
||||||
"call this.calendar.dateFromFields",
|
"call this.calendar.dateFromFields",
|
||||||
"get this.calendar.dateAdd",
|
|
||||||
"call this.calendar.dateAdd",
|
"call this.calendar.dateAdd",
|
||||||
"get this.calendar.day",
|
|
||||||
"call this.calendar.day",
|
"call this.calendar.day",
|
||||||
"get this.calendar.dateFromFields",
|
|
||||||
"call this.calendar.dateFromFields",
|
"call this.calendar.dateFromFields",
|
||||||
// CopyDataProperties
|
// CopyDataProperties
|
||||||
"ownKeys options",
|
"ownKeys options",
|
||||||
@ -73,7 +74,6 @@ const expected = [
|
|||||||
"get this.calendar.year",
|
"get this.calendar.year",
|
||||||
"call this.calendar.year",
|
"call this.calendar.year",
|
||||||
// CalendarYearMonthFromFields
|
// CalendarYearMonthFromFields
|
||||||
"get this.calendar.yearMonthFromFields",
|
|
||||||
"call this.calendar.yearMonthFromFields",
|
"call this.calendar.yearMonthFromFields",
|
||||||
// inside Calendar.p.yearMonthFromFields
|
// inside Calendar.p.yearMonthFromFields
|
||||||
"get options.overflow.toString",
|
"get options.overflow.toString",
|
||||||
@ -132,8 +132,13 @@ const noCalendarExpected = [
|
|||||||
"call fields.seconds.valueOf",
|
"call fields.seconds.valueOf",
|
||||||
"get fields.weeks",
|
"get fields.weeks",
|
||||||
"get fields.years",
|
"get fields.years",
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateFromFields",
|
||||||
|
"get this.calendar.day",
|
||||||
"get this.calendar.fields",
|
"get this.calendar.fields",
|
||||||
|
"get this.calendar.yearMonthFromFields",
|
||||||
|
// CalendarFields
|
||||||
"call this.calendar.fields",
|
"call this.calendar.fields",
|
||||||
// PrepareTemporalFields on receiver
|
// PrepareTemporalFields on receiver
|
||||||
"get this.calendar.monthCode",
|
"get this.calendar.monthCode",
|
||||||
@ -141,13 +146,10 @@ const noCalendarExpected = [
|
|||||||
"get this.calendar.year",
|
"get this.calendar.year",
|
||||||
"call this.calendar.year",
|
"call this.calendar.year",
|
||||||
// CalendarDateFromFields
|
// CalendarDateFromFields
|
||||||
"get this.calendar.dateFromFields",
|
|
||||||
"call this.calendar.dateFromFields",
|
"call this.calendar.dateFromFields",
|
||||||
"get this.calendar.dateAdd",
|
// calculate last day of month
|
||||||
"call this.calendar.dateAdd",
|
"call this.calendar.dateAdd",
|
||||||
"get this.calendar.day",
|
|
||||||
"call this.calendar.day",
|
"call this.calendar.day",
|
||||||
"get this.calendar.dateFromFields",
|
|
||||||
"call this.calendar.dateFromFields",
|
"call this.calendar.dateFromFields",
|
||||||
// SnapshotOwnProperties
|
// SnapshotOwnProperties
|
||||||
"ownKeys options",
|
"ownKeys options",
|
||||||
@ -163,7 +165,6 @@ const noCalendarExpected = [
|
|||||||
"get this.calendar.year",
|
"get this.calendar.year",
|
||||||
"call this.calendar.year",
|
"call this.calendar.year",
|
||||||
// CalendarYearMonthFromFields
|
// CalendarYearMonthFromFields
|
||||||
"get this.calendar.yearMonthFromFields",
|
|
||||||
"call this.calendar.yearMonthFromFields",
|
"call this.calendar.yearMonthFromFields",
|
||||||
// inside Calendar.p.yearMonthFromFields
|
// inside Calendar.p.yearMonthFromFields
|
||||||
"get options.overflow.toString",
|
"get options.overflow.toString",
|
||||||
|
@ -33,6 +33,7 @@ const expectedMinimal = [
|
|||||||
"has other.calendar.yearMonthFromFields",
|
"has other.calendar.yearMonthFromFields",
|
||||||
"has other.calendar.yearOfWeek",
|
"has other.calendar.yearOfWeek",
|
||||||
"get other.calendar.fields",
|
"get other.calendar.fields",
|
||||||
|
"get other.calendar.yearMonthFromFields",
|
||||||
"call other.calendar.fields",
|
"call other.calendar.fields",
|
||||||
"get other.month",
|
"get other.month",
|
||||||
"get other.month.valueOf",
|
"get other.month.valueOf",
|
||||||
@ -43,7 +44,6 @@ const expectedMinimal = [
|
|||||||
"get other.year",
|
"get other.year",
|
||||||
"get other.year.valueOf",
|
"get other.year.valueOf",
|
||||||
"call other.year.valueOf",
|
"call other.year.valueOf",
|
||||||
"get other.calendar.yearMonthFromFields",
|
|
||||||
"call other.calendar.yearMonthFromFields",
|
"call other.calendar.yearMonthFromFields",
|
||||||
// CalendarEquals
|
// CalendarEquals
|
||||||
"get this.calendar.id",
|
"get this.calendar.id",
|
||||||
@ -72,25 +72,26 @@ const expectedMinimal = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
const expected = expectedMinimal.concat([
|
const expected = expectedMinimal.concat([
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateFromFields",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
"get this.calendar.fields",
|
"get this.calendar.fields",
|
||||||
|
// CalendarFields
|
||||||
"call this.calendar.fields",
|
"call this.calendar.fields",
|
||||||
// PrepareTemporalFields / CalendarDateFromFields (receiver)
|
// PrepareTemporalFields / CalendarDateFromFields (receiver)
|
||||||
"get this.calendar.monthCode",
|
"get this.calendar.monthCode",
|
||||||
"call this.calendar.monthCode",
|
"call this.calendar.monthCode",
|
||||||
"get this.calendar.year",
|
"get this.calendar.year",
|
||||||
"call this.calendar.year",
|
"call this.calendar.year",
|
||||||
"get this.calendar.dateFromFields",
|
|
||||||
"call this.calendar.dateFromFields",
|
"call this.calendar.dateFromFields",
|
||||||
// PrepareTemporalFields / CalendarDateFromFields (argument)
|
// PrepareTemporalFields / CalendarDateFromFields (argument)
|
||||||
"get other.calendar.monthCode",
|
"get other.calendar.monthCode",
|
||||||
"call other.calendar.monthCode",
|
"call other.calendar.monthCode",
|
||||||
"get other.calendar.year",
|
"get other.calendar.year",
|
||||||
"call other.calendar.year",
|
"call other.calendar.year",
|
||||||
"get this.calendar.dateFromFields",
|
|
||||||
"call this.calendar.dateFromFields",
|
"call this.calendar.dateFromFields",
|
||||||
// CalendarDateUntil
|
// CalendarDateUntil
|
||||||
"get this.calendar.dateUntil",
|
|
||||||
"call this.calendar.dateUntil",
|
"call this.calendar.dateUntil",
|
||||||
]);
|
]);
|
||||||
const actual = [];
|
const actual = [];
|
||||||
@ -122,7 +123,28 @@ actual.splice(0);
|
|||||||
|
|
||||||
// code path that skips RoundDuration:
|
// code path that skips RoundDuration:
|
||||||
instance.since(otherYearMonthPropertyBag, createOptionsObserver({ smallestUnit: "months", roundingIncrement: 1 }));
|
instance.since(otherYearMonthPropertyBag, createOptionsObserver({ smallestUnit: "months", roundingIncrement: 1 }));
|
||||||
assert.compareArray(actual, expected, "order of operations with no rounding");
|
assert.compareArray(actual, expectedMinimal.concat([
|
||||||
|
// lookup
|
||||||
|
"get this.calendar.dateFromFields",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
|
"get this.calendar.fields",
|
||||||
|
// CalendarFields
|
||||||
|
"call this.calendar.fields",
|
||||||
|
// PrepareTemporalFields / CalendarDateFromFields (receiver)
|
||||||
|
"get this.calendar.monthCode",
|
||||||
|
"call this.calendar.monthCode",
|
||||||
|
"get this.calendar.year",
|
||||||
|
"call this.calendar.year",
|
||||||
|
"call this.calendar.dateFromFields",
|
||||||
|
// PrepareTemporalFields / CalendarDateFromFields (argument)
|
||||||
|
"get other.calendar.monthCode",
|
||||||
|
"call other.calendar.monthCode",
|
||||||
|
"get other.calendar.year",
|
||||||
|
"call other.calendar.year",
|
||||||
|
"call this.calendar.dateFromFields",
|
||||||
|
// CalendarDateUntil
|
||||||
|
"call this.calendar.dateUntil",
|
||||||
|
]), "order of operations with no rounding");
|
||||||
actual.splice(0); // clear
|
actual.splice(0); // clear
|
||||||
|
|
||||||
// short-circuit for identical objects:
|
// short-circuit for identical objects:
|
||||||
@ -139,10 +161,8 @@ 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 expectedOpsForYearRounding = expected.concat([
|
const expectedOpsForYearRounding = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 7.c.i
|
|
||||||
"call this.calendar.dateAdd", // 7.e
|
"call this.calendar.dateAdd", // 7.e
|
||||||
"call this.calendar.dateAdd", // 7.g
|
"call this.calendar.dateAdd", // 7.g
|
||||||
"get this.calendar.dateUntil", // 7.o
|
|
||||||
"call this.calendar.dateUntil", // 7.o
|
"call this.calendar.dateUntil", // 7.o
|
||||||
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
]); // (7.s not called because other units can't add up to >1 year at this point)
|
]); // (7.s not called because other units can't add up to >1 year at this point)
|
||||||
@ -158,7 +178,6 @@ const otherYearMonthPropertyBagSameMonth = TemporalHelpers.propertyBagObserver(a
|
|||||||
calendar: TemporalHelpers.calendarObserver(actual, "other.calendar"),
|
calendar: TemporalHelpers.calendarObserver(actual, "other.calendar"),
|
||||||
}, "other");
|
}, "other");
|
||||||
const expectedOpsForYearRoundingSameMonth = expected.concat([
|
const expectedOpsForYearRoundingSameMonth = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 7.c.i
|
|
||||||
"call this.calendar.dateAdd", // 7.e
|
"call this.calendar.dateAdd", // 7.e
|
||||||
"call this.calendar.dateAdd", // 7.g
|
"call this.calendar.dateAdd", // 7.g
|
||||||
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
@ -169,7 +188,6 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through RoundDuration that rounds to the nearest month:
|
// code path through RoundDuration that rounds to the nearest month:
|
||||||
const expectedOpsForMonthRounding = expected.concat([
|
const expectedOpsForMonthRounding = expected.concat([
|
||||||
"get this.calendar.dateAdd", // 10.b
|
|
||||||
"call this.calendar.dateAdd", // 10.c
|
"call this.calendar.dateAdd", // 10.c
|
||||||
"call this.calendar.dateAdd", // 10.e
|
"call this.calendar.dateAdd", // 10.e
|
||||||
"call this.calendar.dateAdd", // 10.k MoveRelativeDate
|
"call this.calendar.dateAdd", // 10.k MoveRelativeDate
|
||||||
|
@ -18,8 +18,11 @@ const expected = [
|
|||||||
"get options.overflow",
|
"get options.overflow",
|
||||||
"getOwnPropertyDescriptor options.extra",
|
"getOwnPropertyDescriptor options.extra",
|
||||||
"get options.extra",
|
"get options.extra",
|
||||||
// CalendarFields
|
// lookup
|
||||||
"get this.calendar.fields",
|
"get this.calendar.fields",
|
||||||
|
"get this.calendar.mergeFields",
|
||||||
|
"get this.calendar.yearMonthFromFields",
|
||||||
|
// CalendarFields
|
||||||
"call this.calendar.fields",
|
"call this.calendar.fields",
|
||||||
// PrepareTemporalFields on receiver
|
// PrepareTemporalFields on receiver
|
||||||
"get this.calendar.month",
|
"get this.calendar.month",
|
||||||
@ -39,10 +42,8 @@ const expected = [
|
|||||||
"get fields.year.valueOf",
|
"get fields.year.valueOf",
|
||||||
"call fields.year.valueOf",
|
"call fields.year.valueOf",
|
||||||
// CalendarMergeFields
|
// CalendarMergeFields
|
||||||
"get this.calendar.mergeFields",
|
|
||||||
"call this.calendar.mergeFields",
|
"call this.calendar.mergeFields",
|
||||||
// CalendarYearMonthFromFields
|
// CalendarYearMonthFromFields
|
||||||
"get this.calendar.yearMonthFromFields",
|
|
||||||
"call this.calendar.yearMonthFromFields",
|
"call this.calendar.yearMonthFromFields",
|
||||||
// inside Calendar.p.yearMonthFromFields
|
// inside Calendar.p.yearMonthFromFields
|
||||||
"get options.overflow.toString",
|
"get options.overflow.toString",
|
||||||
|
@ -32,8 +32,10 @@ const expected = [
|
|||||||
"has fields.calendar.year",
|
"has fields.calendar.year",
|
||||||
"has fields.calendar.yearMonthFromFields",
|
"has fields.calendar.yearMonthFromFields",
|
||||||
"has fields.calendar.yearOfWeek",
|
"has fields.calendar.yearOfWeek",
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get fields.calendar.dateFromFields",
|
||||||
"get fields.calendar.fields",
|
"get fields.calendar.fields",
|
||||||
|
// CalendarFields
|
||||||
"call fields.calendar.fields",
|
"call fields.calendar.fields",
|
||||||
// PrepareTemporalFields
|
// PrepareTemporalFields
|
||||||
"get fields.day",
|
"get fields.day",
|
||||||
@ -67,7 +69,6 @@ const expected = [
|
|||||||
"get fields.year.valueOf",
|
"get fields.year.valueOf",
|
||||||
"call fields.year.valueOf",
|
"call fields.year.valueOf",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get fields.calendar.dateFromFields",
|
|
||||||
"call fields.calendar.dateFromFields",
|
"call fields.calendar.dateFromFields",
|
||||||
// ToTemporalDisambiguation
|
// ToTemporalDisambiguation
|
||||||
"get options.disambiguation",
|
"get options.disambiguation",
|
||||||
|
@ -47,15 +47,16 @@ const expectedOne = [
|
|||||||
"has one.calendar.year",
|
"has one.calendar.year",
|
||||||
"has one.calendar.yearMonthFromFields",
|
"has one.calendar.yearMonthFromFields",
|
||||||
"has one.calendar.yearOfWeek",
|
"has one.calendar.yearOfWeek",
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get one.calendar.dateFromFields",
|
||||||
"get one.calendar.fields",
|
"get one.calendar.fields",
|
||||||
|
// CalendarFields
|
||||||
"call one.calendar.fields",
|
"call one.calendar.fields",
|
||||||
// ToTemporalTimeZoneSlotValue
|
// ToTemporalTimeZoneSlotValue
|
||||||
"has one.timeZone.getOffsetNanosecondsFor",
|
"has one.timeZone.getOffsetNanosecondsFor",
|
||||||
"has one.timeZone.getPossibleInstantsFor",
|
"has one.timeZone.getPossibleInstantsFor",
|
||||||
"has one.timeZone.id",
|
"has one.timeZone.id",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get one.calendar.dateFromFields",
|
|
||||||
"call one.calendar.dateFromFields",
|
"call one.calendar.dateFromFields",
|
||||||
// lookup
|
// lookup
|
||||||
"get one.timeZone.getPossibleInstantsFor",
|
"get one.timeZone.getPossibleInstantsFor",
|
||||||
@ -86,15 +87,16 @@ const expectedTwo = [
|
|||||||
"has two.calendar.year",
|
"has two.calendar.year",
|
||||||
"has two.calendar.yearMonthFromFields",
|
"has two.calendar.yearMonthFromFields",
|
||||||
"has two.calendar.yearOfWeek",
|
"has two.calendar.yearOfWeek",
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get two.calendar.dateFromFields",
|
||||||
"get two.calendar.fields",
|
"get two.calendar.fields",
|
||||||
|
// CalendarFields
|
||||||
"call two.calendar.fields",
|
"call two.calendar.fields",
|
||||||
// ToTemporalTimeZoneSlotValue
|
// ToTemporalTimeZoneSlotValue
|
||||||
"has two.timeZone.getOffsetNanosecondsFor",
|
"has two.timeZone.getOffsetNanosecondsFor",
|
||||||
"has two.timeZone.getPossibleInstantsFor",
|
"has two.timeZone.getPossibleInstantsFor",
|
||||||
"has two.timeZone.id",
|
"has two.timeZone.id",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get two.calendar.dateFromFields",
|
|
||||||
"call two.calendar.dateFromFields",
|
"call two.calendar.dateFromFields",
|
||||||
// lookup
|
// lookup
|
||||||
"get two.timeZone.getPossibleInstantsFor",
|
"get two.timeZone.getPossibleInstantsFor",
|
||||||
|
@ -31,6 +31,7 @@ const expected = [
|
|||||||
"has one.calendar.year",
|
"has one.calendar.year",
|
||||||
"has one.calendar.yearMonthFromFields",
|
"has one.calendar.yearMonthFromFields",
|
||||||
"has one.calendar.yearOfWeek",
|
"has one.calendar.yearOfWeek",
|
||||||
|
"get one.calendar.dateFromFields",
|
||||||
"get one.calendar.fields",
|
"get one.calendar.fields",
|
||||||
"call one.calendar.fields",
|
"call one.calendar.fields",
|
||||||
// PrepareTemporalFields
|
// PrepareTemporalFields
|
||||||
@ -72,7 +73,6 @@ const expected = [
|
|||||||
"has one.timeZone.getPossibleInstantsFor",
|
"has one.timeZone.getPossibleInstantsFor",
|
||||||
"has one.timeZone.id",
|
"has one.timeZone.id",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get one.calendar.dateFromFields",
|
|
||||||
"call one.calendar.dateFromFields",
|
"call one.calendar.dateFromFields",
|
||||||
// InterpretISODateTimeOffset
|
// InterpretISODateTimeOffset
|
||||||
"get one.timeZone.getPossibleInstantsFor",
|
"get one.timeZone.getPossibleInstantsFor",
|
||||||
@ -102,6 +102,7 @@ const expected = [
|
|||||||
"has two.calendar.year",
|
"has two.calendar.year",
|
||||||
"has two.calendar.yearMonthFromFields",
|
"has two.calendar.yearMonthFromFields",
|
||||||
"has two.calendar.yearOfWeek",
|
"has two.calendar.yearOfWeek",
|
||||||
|
"get two.calendar.dateFromFields",
|
||||||
"get two.calendar.fields",
|
"get two.calendar.fields",
|
||||||
"call two.calendar.fields",
|
"call two.calendar.fields",
|
||||||
// PrepareTemporalFields
|
// PrepareTemporalFields
|
||||||
@ -143,7 +144,6 @@ const expected = [
|
|||||||
"has two.timeZone.getPossibleInstantsFor",
|
"has two.timeZone.getPossibleInstantsFor",
|
||||||
"has two.timeZone.id",
|
"has two.timeZone.id",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get two.calendar.dateFromFields",
|
|
||||||
"call two.calendar.dateFromFields",
|
"call two.calendar.dateFromFields",
|
||||||
// InterpretISODateTimeOffset
|
// InterpretISODateTimeOffset
|
||||||
"get two.timeZone.getPossibleInstantsFor",
|
"get two.timeZone.getPossibleInstantsFor",
|
||||||
|
@ -42,15 +42,16 @@ const expected = [
|
|||||||
"has calendar.year",
|
"has calendar.year",
|
||||||
"has calendar.yearMonthFromFields",
|
"has calendar.yearMonthFromFields",
|
||||||
"has calendar.yearOfWeek",
|
"has calendar.yearOfWeek",
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get calendar.dateFromFields",
|
||||||
"get calendar.fields",
|
"get calendar.fields",
|
||||||
|
// CalendarFields
|
||||||
"call calendar.fields",
|
"call calendar.fields",
|
||||||
// ToTemporalTimeZoneSlotValue
|
// ToTemporalTimeZoneSlotValue
|
||||||
"has timeZone.getOffsetNanosecondsFor",
|
"has timeZone.getOffsetNanosecondsFor",
|
||||||
"has timeZone.getPossibleInstantsFor",
|
"has timeZone.getPossibleInstantsFor",
|
||||||
"has timeZone.id",
|
"has timeZone.id",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get calendar.dateFromFields",
|
|
||||||
"call calendar.dateFromFields",
|
"call calendar.dateFromFields",
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@ const expected = [
|
|||||||
"has item.calendar.year",
|
"has item.calendar.year",
|
||||||
"has item.calendar.yearMonthFromFields",
|
"has item.calendar.yearMonthFromFields",
|
||||||
"has item.calendar.yearOfWeek",
|
"has item.calendar.yearOfWeek",
|
||||||
|
"get item.calendar.dateFromFields",
|
||||||
"get item.calendar.fields",
|
"get item.calendar.fields",
|
||||||
"call item.calendar.fields",
|
"call item.calendar.fields",
|
||||||
// PrepareTemporalFields
|
// PrepareTemporalFields
|
||||||
@ -89,7 +90,6 @@ const expected = [
|
|||||||
"call options.offset.toString",
|
"call options.offset.toString",
|
||||||
"get options.overflow.toString",
|
"get options.overflow.toString",
|
||||||
"call options.overflow.toString",
|
"call options.overflow.toString",
|
||||||
"get item.calendar.dateFromFields",
|
|
||||||
"call item.calendar.dateFromFields",
|
"call item.calendar.dateFromFields",
|
||||||
// InterpretISODateTimeOffset
|
// InterpretISODateTimeOffset
|
||||||
"get item.timeZone.getPossibleInstantsFor",
|
"get item.timeZone.getPossibleInstantsFor",
|
||||||
|
@ -43,9 +43,9 @@ const expected = [
|
|||||||
// lookup
|
// lookup
|
||||||
"get this.timeZone.getOffsetNanosecondsFor",
|
"get this.timeZone.getOffsetNanosecondsFor",
|
||||||
"get this.timeZone.getPossibleInstantsFor",
|
"get this.timeZone.getPossibleInstantsFor",
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
// AddZonedDateTime
|
// AddZonedDateTime
|
||||||
"call this.timeZone.getOffsetNanosecondsFor",
|
"call this.timeZone.getOffsetNanosecondsFor",
|
||||||
"get this.calendar.dateAdd",
|
|
||||||
"call this.calendar.dateAdd",
|
"call this.calendar.dateAdd",
|
||||||
// ... inside Calendar.p.dateAdd
|
// ... inside Calendar.p.dateAdd
|
||||||
"get options.overflow",
|
"get options.overflow",
|
||||||
|
@ -48,15 +48,16 @@ const expected = [
|
|||||||
"has calendar.year",
|
"has calendar.year",
|
||||||
"has calendar.yearMonthFromFields",
|
"has calendar.yearMonthFromFields",
|
||||||
"has calendar.yearOfWeek",
|
"has calendar.yearOfWeek",
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get calendar.dateFromFields",
|
||||||
"get calendar.fields",
|
"get calendar.fields",
|
||||||
|
// CalendarFields
|
||||||
"call calendar.fields",
|
"call calendar.fields",
|
||||||
// ToTemporalTimeZoneSlotValue
|
// ToTemporalTimeZoneSlotValue
|
||||||
"has timeZone.getOffsetNanosecondsFor",
|
"has timeZone.getOffsetNanosecondsFor",
|
||||||
"has timeZone.getPossibleInstantsFor",
|
"has timeZone.getPossibleInstantsFor",
|
||||||
"has timeZone.id",
|
"has timeZone.id",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get calendar.dateFromFields",
|
|
||||||
"call calendar.dateFromFields",
|
"call calendar.dateFromFields",
|
||||||
// lookup
|
// lookup
|
||||||
"get timeZone.getPossibleInstantsFor",
|
"get timeZone.getPossibleInstantsFor",
|
||||||
|
@ -31,6 +31,7 @@ const expected = [
|
|||||||
"has other.calendar.year",
|
"has other.calendar.year",
|
||||||
"has other.calendar.yearMonthFromFields",
|
"has other.calendar.yearMonthFromFields",
|
||||||
"has other.calendar.yearOfWeek",
|
"has other.calendar.yearOfWeek",
|
||||||
|
"get other.calendar.dateFromFields",
|
||||||
"get other.calendar.fields",
|
"get other.calendar.fields",
|
||||||
"call other.calendar.fields",
|
"call other.calendar.fields",
|
||||||
// PrepareTemporalFields
|
// PrepareTemporalFields
|
||||||
@ -72,7 +73,6 @@ const expected = [
|
|||||||
"has other.timeZone.getPossibleInstantsFor",
|
"has other.timeZone.getPossibleInstantsFor",
|
||||||
"has other.timeZone.id",
|
"has other.timeZone.id",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get other.calendar.dateFromFields",
|
|
||||||
"call other.calendar.dateFromFields",
|
"call other.calendar.dateFromFields",
|
||||||
// InterpretISODateTimeOffset
|
// InterpretISODateTimeOffset
|
||||||
"get other.timeZone.getPossibleInstantsFor",
|
"get other.timeZone.getPossibleInstantsFor",
|
||||||
|
@ -48,15 +48,16 @@ const expected = [
|
|||||||
"has calendar.year",
|
"has calendar.year",
|
||||||
"has calendar.yearMonthFromFields",
|
"has calendar.yearMonthFromFields",
|
||||||
"has calendar.yearOfWeek",
|
"has calendar.yearOfWeek",
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get calendar.dateFromFields",
|
||||||
"get calendar.fields",
|
"get calendar.fields",
|
||||||
|
// CalendarFields
|
||||||
"call calendar.fields",
|
"call calendar.fields",
|
||||||
// ToTemporalTimeZoneSlotValue
|
// ToTemporalTimeZoneSlotValue
|
||||||
"has timeZone.getOffsetNanosecondsFor",
|
"has timeZone.getOffsetNanosecondsFor",
|
||||||
"has timeZone.getPossibleInstantsFor",
|
"has timeZone.getPossibleInstantsFor",
|
||||||
"has timeZone.id",
|
"has timeZone.id",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get calendar.dateFromFields",
|
|
||||||
"call calendar.dateFromFields",
|
"call calendar.dateFromFields",
|
||||||
// lookup
|
// lookup
|
||||||
"get timeZone.getPossibleInstantsFor",
|
"get timeZone.getPossibleInstantsFor",
|
||||||
|
@ -32,6 +32,7 @@ const expected = [
|
|||||||
"has other.calendar.year",
|
"has other.calendar.year",
|
||||||
"has other.calendar.yearMonthFromFields",
|
"has other.calendar.yearMonthFromFields",
|
||||||
"has other.calendar.yearOfWeek",
|
"has other.calendar.yearOfWeek",
|
||||||
|
"get other.calendar.dateFromFields",
|
||||||
"get other.calendar.fields",
|
"get other.calendar.fields",
|
||||||
"call other.calendar.fields",
|
"call other.calendar.fields",
|
||||||
"get other.day",
|
"get other.day",
|
||||||
@ -71,7 +72,6 @@ const expected = [
|
|||||||
"has other.timeZone.getOffsetNanosecondsFor",
|
"has other.timeZone.getOffsetNanosecondsFor",
|
||||||
"has other.timeZone.getPossibleInstantsFor",
|
"has other.timeZone.getPossibleInstantsFor",
|
||||||
"has other.timeZone.id",
|
"has other.timeZone.id",
|
||||||
"get other.calendar.dateFromFields",
|
|
||||||
"call other.calendar.dateFromFields",
|
"call other.calendar.dateFromFields",
|
||||||
"get other.timeZone.getPossibleInstantsFor",
|
"get other.timeZone.getPossibleInstantsFor",
|
||||||
"call other.timeZone.getPossibleInstantsFor",
|
"call other.timeZone.getPossibleInstantsFor",
|
||||||
@ -223,6 +223,7 @@ assert.compareArray(actual, [
|
|||||||
"has other.calendar.year",
|
"has other.calendar.year",
|
||||||
"has other.calendar.yearMonthFromFields",
|
"has other.calendar.yearMonthFromFields",
|
||||||
"has other.calendar.yearOfWeek",
|
"has other.calendar.yearOfWeek",
|
||||||
|
"get other.calendar.dateFromFields",
|
||||||
"get other.calendar.fields",
|
"get other.calendar.fields",
|
||||||
"call other.calendar.fields",
|
"call other.calendar.fields",
|
||||||
"get other.day",
|
"get other.day",
|
||||||
@ -262,7 +263,6 @@ assert.compareArray(actual, [
|
|||||||
"has other.timeZone.getOffsetNanosecondsFor",
|
"has other.timeZone.getOffsetNanosecondsFor",
|
||||||
"has other.timeZone.getPossibleInstantsFor",
|
"has other.timeZone.getPossibleInstantsFor",
|
||||||
"has other.timeZone.id",
|
"has other.timeZone.id",
|
||||||
"get other.calendar.dateFromFields",
|
|
||||||
"call other.calendar.dateFromFields",
|
"call other.calendar.dateFromFields",
|
||||||
"get other.timeZone.getPossibleInstantsFor",
|
"get other.timeZone.getPossibleInstantsFor",
|
||||||
"call other.timeZone.getPossibleInstantsFor",
|
"call other.timeZone.getPossibleInstantsFor",
|
||||||
@ -300,6 +300,8 @@ assert.compareArray(actual, [
|
|||||||
// lookup
|
// lookup
|
||||||
"get this.timeZone.getOffsetNanosecondsFor",
|
"get this.timeZone.getOffsetNanosecondsFor",
|
||||||
"get this.timeZone.getPossibleInstantsFor",
|
"get this.timeZone.getPossibleInstantsFor",
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
// DifferenceZonedDateTime
|
// DifferenceZonedDateTime
|
||||||
"call this.timeZone.getOffsetNanosecondsFor",
|
"call this.timeZone.getOffsetNanosecondsFor",
|
||||||
"call this.timeZone.getOffsetNanosecondsFor",
|
"call this.timeZone.getOffsetNanosecondsFor",
|
||||||
@ -319,15 +321,15 @@ const expectedOpsForCalendarDifference = [
|
|||||||
// lookup
|
// lookup
|
||||||
"get this.timeZone.getOffsetNanosecondsFor",
|
"get this.timeZone.getOffsetNanosecondsFor",
|
||||||
"get this.timeZone.getPossibleInstantsFor",
|
"get this.timeZone.getPossibleInstantsFor",
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
// precalculate PlainDateTime
|
// precalculate PlainDateTime
|
||||||
"call this.timeZone.getOffsetNanosecondsFor",
|
"call this.timeZone.getOffsetNanosecondsFor",
|
||||||
// DifferenceZonedDateTime
|
// DifferenceZonedDateTime
|
||||||
"call this.timeZone.getOffsetNanosecondsFor",
|
"call this.timeZone.getOffsetNanosecondsFor",
|
||||||
// DifferenceISODateTime
|
// DifferenceISODateTime
|
||||||
"get this.calendar.dateUntil",
|
|
||||||
"call this.calendar.dateUntil",
|
"call this.calendar.dateUntil",
|
||||||
// AddZonedDateTime
|
// AddZonedDateTime
|
||||||
"get this.calendar.dateAdd",
|
|
||||||
"call this.calendar.dateAdd",
|
"call this.calendar.dateAdd",
|
||||||
"call this.timeZone.getPossibleInstantsFor",
|
"call this.timeZone.getPossibleInstantsFor",
|
||||||
// NanosecondsToDays
|
// NanosecondsToDays
|
||||||
@ -340,7 +342,6 @@ const expectedOpsForCalendarDifference = [
|
|||||||
|
|
||||||
const expectedOpsForCalendarRounding = [
|
const expectedOpsForCalendarRounding = [
|
||||||
// RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime
|
// RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime
|
||||||
"get this.calendar.dateAdd",
|
|
||||||
"call this.calendar.dateAdd",
|
"call this.calendar.dateAdd",
|
||||||
"call this.timeZone.getPossibleInstantsFor",
|
"call this.timeZone.getPossibleInstantsFor",
|
||||||
// RoundDuration → NanosecondsToDays
|
// RoundDuration → NanosecondsToDays
|
||||||
@ -357,10 +358,8 @@ 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 expectedOpsForYearRounding = expected.concat(expectedOpsForCalendarDifference, expectedOpsForCalendarRounding, [
|
const expectedOpsForYearRounding = expected.concat(expectedOpsForCalendarDifference, expectedOpsForCalendarRounding, [
|
||||||
"get this.calendar.dateAdd", // 7.c.i
|
|
||||||
"call this.calendar.dateAdd", // 7.e
|
"call this.calendar.dateAdd", // 7.e
|
||||||
"call this.calendar.dateAdd", // 7.g
|
"call this.calendar.dateAdd", // 7.g
|
||||||
"get this.calendar.dateUntil", // 7.o
|
|
||||||
"call this.calendar.dateUntil", // 7.o
|
"call this.calendar.dateUntil", // 7.o
|
||||||
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
]); // (7.s not called because other units can't add up to >1 year at this point)
|
]); // (7.s not called because other units can't add up to >1 year at this point)
|
||||||
@ -370,7 +369,6 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through RoundDuration that rounds to the nearest month:
|
// code path through RoundDuration that rounds to the nearest month:
|
||||||
const expectedOpsForMonthRounding = expected.concat(expectedOpsForCalendarDifference, expectedOpsForCalendarRounding, [
|
const expectedOpsForMonthRounding = expected.concat(expectedOpsForCalendarDifference, expectedOpsForCalendarRounding, [
|
||||||
"get this.calendar.dateAdd", // 10.b
|
|
||||||
"call this.calendar.dateAdd", // 10.c
|
"call this.calendar.dateAdd", // 10.c
|
||||||
"call this.calendar.dateAdd", // 10.e
|
"call this.calendar.dateAdd", // 10.e
|
||||||
"call this.calendar.dateAdd", // 10.k MoveRelativeDate
|
"call this.calendar.dateAdd", // 10.k MoveRelativeDate
|
||||||
@ -381,7 +379,6 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through RoundDuration that rounds to the nearest week:
|
// code path through RoundDuration that rounds to the nearest week:
|
||||||
const expectedOpsForWeekRounding = expected.concat(expectedOpsForCalendarDifference, expectedOpsForCalendarRounding, [
|
const expectedOpsForWeekRounding = expected.concat(expectedOpsForCalendarDifference, expectedOpsForCalendarRounding, [
|
||||||
"get this.calendar.dateAdd", // 11.c
|
|
||||||
"call this.calendar.dateAdd", // 11.d MoveRelativeDate
|
"call this.calendar.dateAdd", // 11.d MoveRelativeDate
|
||||||
]); // (11.g.iii MoveRelativeDate not called because days already balanced)
|
]); // (11.g.iii MoveRelativeDate not called because days already balanced)
|
||||||
instance.since(otherDateTimePropertyBag, createOptionsObserver({ smallestUnit: "weeks" }));
|
instance.since(otherDateTimePropertyBag, createOptionsObserver({ smallestUnit: "weeks" }));
|
||||||
|
@ -43,9 +43,9 @@ const expected = [
|
|||||||
// lookup
|
// lookup
|
||||||
"get this.timeZone.getOffsetNanosecondsFor",
|
"get this.timeZone.getOffsetNanosecondsFor",
|
||||||
"get this.timeZone.getPossibleInstantsFor",
|
"get this.timeZone.getPossibleInstantsFor",
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
// AddZonedDateTime
|
// AddZonedDateTime
|
||||||
"call this.timeZone.getOffsetNanosecondsFor",
|
"call this.timeZone.getOffsetNanosecondsFor",
|
||||||
"get this.calendar.dateAdd",
|
|
||||||
"call this.calendar.dateAdd",
|
"call this.calendar.dateAdd",
|
||||||
// ... inside Calendar.p.dateAdd
|
// ... inside Calendar.p.dateAdd
|
||||||
"get options.overflow",
|
"get options.overflow",
|
||||||
|
48
test/built-ins/Temporal/ZonedDateTime/prototype/toPlainMonthDay/order-of-operations.js
vendored
Normal file
48
test/built-ins/Temporal/ZonedDateTime/prototype/toPlainMonthDay/order-of-operations.js
vendored
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-temporal.zoneddatetime.prototype.toplainmonthday
|
||||||
|
description: >
|
||||||
|
User-observable time zone and calendar accesses and calls in
|
||||||
|
toPlainMonthDay() happen the correct order
|
||||||
|
includes: [compareArray.js, temporalHelpers.js]
|
||||||
|
features: [Temporal]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
const expected = [
|
||||||
|
"get this.calendar.fields",
|
||||||
|
"get this.calendar.monthDayFromFields",
|
||||||
|
"get this.timeZone.getOffsetNanosecondsFor",
|
||||||
|
"call this.timeZone.getOffsetNanosecondsFor",
|
||||||
|
"call this.calendar.fields",
|
||||||
|
"get this.calendar.day",
|
||||||
|
"call this.calendar.day",
|
||||||
|
"get this.calendar.monthCode",
|
||||||
|
"call this.calendar.monthCode",
|
||||||
|
"call this.calendar.monthDayFromFields",
|
||||||
|
];
|
||||||
|
const actual = [];
|
||||||
|
|
||||||
|
const timeZone = TemporalHelpers.timeZoneObserver(actual, "this.timeZone");
|
||||||
|
const calendar = TemporalHelpers.calendarObserver(actual, "this.calendar");
|
||||||
|
const instance = new Temporal.ZonedDateTime(0n, timeZone, calendar);
|
||||||
|
Object.defineProperties(instance, {
|
||||||
|
day: {
|
||||||
|
get() {
|
||||||
|
actual.push("get this.day");
|
||||||
|
return TemporalHelpers.toPrimitiveObserver(actual, 1, "this.day");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
monthCode: {
|
||||||
|
get() {
|
||||||
|
actual.push("get this.monthCode");
|
||||||
|
return TemporalHelpers.toPrimitiveObserver(actual, "M01", "this.monthCode");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
// clear observable operations that occurred during the constructor call
|
||||||
|
actual.splice(0);
|
||||||
|
|
||||||
|
instance.toPlainMonthDay();
|
||||||
|
assert.compareArray(actual, expected, "order of operations");
|
48
test/built-ins/Temporal/ZonedDateTime/prototype/toPlainYearMonth/order-of-operations.js
vendored
Normal file
48
test/built-ins/Temporal/ZonedDateTime/prototype/toPlainYearMonth/order-of-operations.js
vendored
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
// Copyright (C) 2023 Igalia, S.L. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-temporal.zoneddatetime.prototype.toplainyearmonth
|
||||||
|
description: >
|
||||||
|
User-observable time zone and calendar accesses and calls in
|
||||||
|
toPlainYearMonth() happen the correct order
|
||||||
|
includes: [compareArray.js, temporalHelpers.js]
|
||||||
|
features: [Temporal]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
const expected = [
|
||||||
|
"get this.calendar.fields",
|
||||||
|
"get this.calendar.yearMonthFromFields",
|
||||||
|
"get this.timeZone.getOffsetNanosecondsFor",
|
||||||
|
"call this.timeZone.getOffsetNanosecondsFor",
|
||||||
|
"call this.calendar.fields",
|
||||||
|
"get this.calendar.monthCode",
|
||||||
|
"call this.calendar.monthCode",
|
||||||
|
"get this.calendar.year",
|
||||||
|
"call this.calendar.year",
|
||||||
|
"call this.calendar.yearMonthFromFields",
|
||||||
|
];
|
||||||
|
const actual = [];
|
||||||
|
|
||||||
|
const timeZone = TemporalHelpers.timeZoneObserver(actual, "this.timeZone");
|
||||||
|
const calendar = TemporalHelpers.calendarObserver(actual, "this.calendar");
|
||||||
|
const instance = new Temporal.ZonedDateTime(0n, timeZone, calendar);
|
||||||
|
Object.defineProperties(instance, {
|
||||||
|
monthCode: {
|
||||||
|
get() {
|
||||||
|
actual.push("get this.monthCode");
|
||||||
|
return TemporalHelpers.toPrimitiveObserver(actual, "M01", "this.monthCode");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
year: {
|
||||||
|
get() {
|
||||||
|
actual.push("get this.year");
|
||||||
|
return TemporalHelpers.toPrimitiveObserver(actual, 1970, "this.year");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
// clear observable operations that occurred during the constructor call
|
||||||
|
actual.splice(0);
|
||||||
|
|
||||||
|
instance.toPlainYearMonth();
|
||||||
|
assert.compareArray(actual, expected, "order of operations");
|
@ -48,15 +48,16 @@ const expected = [
|
|||||||
"has calendar.year",
|
"has calendar.year",
|
||||||
"has calendar.yearMonthFromFields",
|
"has calendar.yearMonthFromFields",
|
||||||
"has calendar.yearOfWeek",
|
"has calendar.yearOfWeek",
|
||||||
// CalendarFields
|
// lookup
|
||||||
|
"get calendar.dateFromFields",
|
||||||
"get calendar.fields",
|
"get calendar.fields",
|
||||||
|
// CalendarFields
|
||||||
"call calendar.fields",
|
"call calendar.fields",
|
||||||
// ToTemporalTimeZoneSlotValue
|
// ToTemporalTimeZoneSlotValue
|
||||||
"has timeZone.getOffsetNanosecondsFor",
|
"has timeZone.getOffsetNanosecondsFor",
|
||||||
"has timeZone.getPossibleInstantsFor",
|
"has timeZone.getPossibleInstantsFor",
|
||||||
"has timeZone.id",
|
"has timeZone.id",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get calendar.dateFromFields",
|
|
||||||
"call calendar.dateFromFields",
|
"call calendar.dateFromFields",
|
||||||
// lookup
|
// lookup
|
||||||
"get timeZone.getPossibleInstantsFor",
|
"get timeZone.getPossibleInstantsFor",
|
||||||
|
@ -32,6 +32,7 @@ const expected = [
|
|||||||
"has other.calendar.year",
|
"has other.calendar.year",
|
||||||
"has other.calendar.yearMonthFromFields",
|
"has other.calendar.yearMonthFromFields",
|
||||||
"has other.calendar.yearOfWeek",
|
"has other.calendar.yearOfWeek",
|
||||||
|
"get other.calendar.dateFromFields",
|
||||||
"get other.calendar.fields",
|
"get other.calendar.fields",
|
||||||
"call other.calendar.fields",
|
"call other.calendar.fields",
|
||||||
"get other.day",
|
"get other.day",
|
||||||
@ -71,7 +72,6 @@ const expected = [
|
|||||||
"has other.timeZone.getOffsetNanosecondsFor",
|
"has other.timeZone.getOffsetNanosecondsFor",
|
||||||
"has other.timeZone.getPossibleInstantsFor",
|
"has other.timeZone.getPossibleInstantsFor",
|
||||||
"has other.timeZone.id",
|
"has other.timeZone.id",
|
||||||
"get other.calendar.dateFromFields",
|
|
||||||
"call other.calendar.dateFromFields",
|
"call other.calendar.dateFromFields",
|
||||||
"get other.timeZone.getPossibleInstantsFor",
|
"get other.timeZone.getPossibleInstantsFor",
|
||||||
"call other.timeZone.getPossibleInstantsFor",
|
"call other.timeZone.getPossibleInstantsFor",
|
||||||
@ -223,6 +223,7 @@ assert.compareArray(actual, [
|
|||||||
"has other.calendar.year",
|
"has other.calendar.year",
|
||||||
"has other.calendar.yearMonthFromFields",
|
"has other.calendar.yearMonthFromFields",
|
||||||
"has other.calendar.yearOfWeek",
|
"has other.calendar.yearOfWeek",
|
||||||
|
"get other.calendar.dateFromFields",
|
||||||
"get other.calendar.fields",
|
"get other.calendar.fields",
|
||||||
"call other.calendar.fields",
|
"call other.calendar.fields",
|
||||||
"get other.day",
|
"get other.day",
|
||||||
@ -262,7 +263,6 @@ assert.compareArray(actual, [
|
|||||||
"has other.timeZone.getOffsetNanosecondsFor",
|
"has other.timeZone.getOffsetNanosecondsFor",
|
||||||
"has other.timeZone.getPossibleInstantsFor",
|
"has other.timeZone.getPossibleInstantsFor",
|
||||||
"has other.timeZone.id",
|
"has other.timeZone.id",
|
||||||
"get other.calendar.dateFromFields",
|
|
||||||
"call other.calendar.dateFromFields",
|
"call other.calendar.dateFromFields",
|
||||||
"get other.timeZone.getPossibleInstantsFor",
|
"get other.timeZone.getPossibleInstantsFor",
|
||||||
"call other.timeZone.getPossibleInstantsFor",
|
"call other.timeZone.getPossibleInstantsFor",
|
||||||
@ -300,6 +300,8 @@ assert.compareArray(actual, [
|
|||||||
// lookup
|
// lookup
|
||||||
"get this.timeZone.getOffsetNanosecondsFor",
|
"get this.timeZone.getOffsetNanosecondsFor",
|
||||||
"get this.timeZone.getPossibleInstantsFor",
|
"get this.timeZone.getPossibleInstantsFor",
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
// DifferenceZonedDateTime
|
// DifferenceZonedDateTime
|
||||||
"call this.timeZone.getOffsetNanosecondsFor",
|
"call this.timeZone.getOffsetNanosecondsFor",
|
||||||
"call this.timeZone.getOffsetNanosecondsFor",
|
"call this.timeZone.getOffsetNanosecondsFor",
|
||||||
@ -319,15 +321,15 @@ const expectedOpsForCalendarDifference = [
|
|||||||
// lookup
|
// lookup
|
||||||
"get this.timeZone.getOffsetNanosecondsFor",
|
"get this.timeZone.getOffsetNanosecondsFor",
|
||||||
"get this.timeZone.getPossibleInstantsFor",
|
"get this.timeZone.getPossibleInstantsFor",
|
||||||
|
"get this.calendar.dateAdd",
|
||||||
|
"get this.calendar.dateUntil",
|
||||||
// precalculate PlainDateTime
|
// precalculate PlainDateTime
|
||||||
"call this.timeZone.getOffsetNanosecondsFor",
|
"call this.timeZone.getOffsetNanosecondsFor",
|
||||||
// DifferenceZonedDateTime
|
// DifferenceZonedDateTime
|
||||||
"call this.timeZone.getOffsetNanosecondsFor",
|
"call this.timeZone.getOffsetNanosecondsFor",
|
||||||
// DifferenceISODateTime
|
// DifferenceISODateTime
|
||||||
"get this.calendar.dateUntil",
|
|
||||||
"call this.calendar.dateUntil",
|
"call this.calendar.dateUntil",
|
||||||
// AddZonedDateTime
|
// AddZonedDateTime
|
||||||
"get this.calendar.dateAdd",
|
|
||||||
"call this.calendar.dateAdd",
|
"call this.calendar.dateAdd",
|
||||||
"call this.timeZone.getPossibleInstantsFor",
|
"call this.timeZone.getPossibleInstantsFor",
|
||||||
// NanosecondsToDays
|
// NanosecondsToDays
|
||||||
@ -340,7 +342,6 @@ const expectedOpsForCalendarDifference = [
|
|||||||
|
|
||||||
const expectedOpsForCalendarRounding = [
|
const expectedOpsForCalendarRounding = [
|
||||||
// RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime
|
// RoundDuration → MoveRelativeZonedDateTime → AddZonedDateTime
|
||||||
"get this.calendar.dateAdd",
|
|
||||||
"call this.calendar.dateAdd",
|
"call this.calendar.dateAdd",
|
||||||
"call this.timeZone.getPossibleInstantsFor",
|
"call this.timeZone.getPossibleInstantsFor",
|
||||||
// RoundDuration → NanosecondsToDays
|
// RoundDuration → NanosecondsToDays
|
||||||
@ -357,10 +358,8 @@ 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 expectedOpsForYearRounding = expected.concat(expectedOpsForCalendarDifference, expectedOpsForCalendarRounding, [
|
const expectedOpsForYearRounding = expected.concat(expectedOpsForCalendarDifference, expectedOpsForCalendarRounding, [
|
||||||
"get this.calendar.dateAdd", // 7.c.i
|
|
||||||
"call this.calendar.dateAdd", // 7.e
|
"call this.calendar.dateAdd", // 7.e
|
||||||
"call this.calendar.dateAdd", // 7.g
|
"call this.calendar.dateAdd", // 7.g
|
||||||
"get this.calendar.dateUntil", // 7.o
|
|
||||||
"call this.calendar.dateUntil", // 7.o
|
"call this.calendar.dateUntil", // 7.o
|
||||||
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
"call this.calendar.dateAdd", // 7.y MoveRelativeDate
|
||||||
]); // (7.s not called because other units can't add up to >1 year at this point)
|
]); // (7.s not called because other units can't add up to >1 year at this point)
|
||||||
@ -370,7 +369,6 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through RoundDuration that rounds to the nearest month:
|
// code path through RoundDuration that rounds to the nearest month:
|
||||||
const expectedOpsForMonthRounding = expected.concat(expectedOpsForCalendarDifference, expectedOpsForCalendarRounding, [
|
const expectedOpsForMonthRounding = expected.concat(expectedOpsForCalendarDifference, expectedOpsForCalendarRounding, [
|
||||||
"get this.calendar.dateAdd", // 10.b
|
|
||||||
"call this.calendar.dateAdd", // 10.c
|
"call this.calendar.dateAdd", // 10.c
|
||||||
"call this.calendar.dateAdd", // 10.e
|
"call this.calendar.dateAdd", // 10.e
|
||||||
"call this.calendar.dateAdd", // 10.k MoveRelativeDate
|
"call this.calendar.dateAdd", // 10.k MoveRelativeDate
|
||||||
@ -381,7 +379,6 @@ actual.splice(0); // clear
|
|||||||
|
|
||||||
// code path through RoundDuration that rounds to the nearest week:
|
// code path through RoundDuration that rounds to the nearest week:
|
||||||
const expectedOpsForWeekRounding = expected.concat(expectedOpsForCalendarDifference, expectedOpsForCalendarRounding, [
|
const expectedOpsForWeekRounding = expected.concat(expectedOpsForCalendarDifference, expectedOpsForCalendarRounding, [
|
||||||
"get this.calendar.dateAdd", // 11.c
|
|
||||||
"call this.calendar.dateAdd", // 11.d MoveRelativeDate
|
"call this.calendar.dateAdd", // 11.d MoveRelativeDate
|
||||||
]); // (11.g.iii MoveRelativeDate not called because days already balanced)
|
]); // (11.g.iii MoveRelativeDate not called because days already balanced)
|
||||||
instance.until(otherDateTimePropertyBag, createOptionsObserver({ smallestUnit: "weeks" }));
|
instance.until(otherDateTimePropertyBag, createOptionsObserver({ smallestUnit: "weeks" }));
|
||||||
|
@ -23,12 +23,15 @@ const expected = [
|
|||||||
"getOwnPropertyDescriptor options.extra",
|
"getOwnPropertyDescriptor options.extra",
|
||||||
"get options.extra",
|
"get options.extra",
|
||||||
// lookup
|
// lookup
|
||||||
|
"get this.calendar.dateFromFields",
|
||||||
|
"get this.calendar.fields",
|
||||||
|
"get this.calendar.mergeFields",
|
||||||
|
// lookup
|
||||||
"get this.timeZone.getOffsetNanosecondsFor",
|
"get this.timeZone.getOffsetNanosecondsFor",
|
||||||
"get this.timeZone.getPossibleInstantsFor",
|
"get this.timeZone.getPossibleInstantsFor",
|
||||||
// GetOffsetNanosecondsFor on receiver
|
// GetOffsetNanosecondsFor on receiver
|
||||||
"call this.timeZone.getOffsetNanosecondsFor",
|
"call this.timeZone.getOffsetNanosecondsFor",
|
||||||
// CalendarFields
|
// CalendarFields
|
||||||
"get this.calendar.fields",
|
|
||||||
"call this.calendar.fields",
|
"call this.calendar.fields",
|
||||||
// PrepareTemporalFields on receiver
|
// PrepareTemporalFields on receiver
|
||||||
"get this.calendar.day",
|
"get this.calendar.day",
|
||||||
@ -74,7 +77,6 @@ const expected = [
|
|||||||
"get fields.year.valueOf",
|
"get fields.year.valueOf",
|
||||||
"call fields.year.valueOf",
|
"call fields.year.valueOf",
|
||||||
// CalendarMergeFields
|
// CalendarMergeFields
|
||||||
"get this.calendar.mergeFields",
|
|
||||||
"call this.calendar.mergeFields",
|
"call this.calendar.mergeFields",
|
||||||
// InterpretTemporalDateTimeFields
|
// InterpretTemporalDateTimeFields
|
||||||
"get options.disambiguation.toString",
|
"get options.disambiguation.toString",
|
||||||
@ -83,7 +85,6 @@ const expected = [
|
|||||||
"call options.offset.toString",
|
"call options.offset.toString",
|
||||||
"get options.overflow.toString",
|
"get options.overflow.toString",
|
||||||
"call options.overflow.toString",
|
"call options.overflow.toString",
|
||||||
"get this.calendar.dateFromFields",
|
|
||||||
"call this.calendar.dateFromFields",
|
"call this.calendar.dateFromFields",
|
||||||
// InterpretISODateTimeOffset
|
// InterpretISODateTimeOffset
|
||||||
"call this.timeZone.getPossibleInstantsFor",
|
"call this.timeZone.getPossibleInstantsFor",
|
||||||
|
@ -33,6 +33,7 @@ const expected = [
|
|||||||
"has plainDateLike.calendar.year",
|
"has plainDateLike.calendar.year",
|
||||||
"has plainDateLike.calendar.yearMonthFromFields",
|
"has plainDateLike.calendar.yearMonthFromFields",
|
||||||
"has plainDateLike.calendar.yearOfWeek",
|
"has plainDateLike.calendar.yearOfWeek",
|
||||||
|
"get plainDateLike.calendar.dateFromFields",
|
||||||
"get plainDateLike.calendar.fields",
|
"get plainDateLike.calendar.fields",
|
||||||
"call plainDateLike.calendar.fields",
|
"call plainDateLike.calendar.fields",
|
||||||
"get plainDateLike.day",
|
"get plainDateLike.day",
|
||||||
@ -47,7 +48,6 @@ const expected = [
|
|||||||
"get plainDateLike.year",
|
"get plainDateLike.year",
|
||||||
"get plainDateLike.year.valueOf",
|
"get plainDateLike.year.valueOf",
|
||||||
"call plainDateLike.year.valueOf",
|
"call plainDateLike.year.valueOf",
|
||||||
"get plainDateLike.calendar.dateFromFields",
|
|
||||||
"call plainDateLike.calendar.dateFromFields",
|
"call plainDateLike.calendar.dateFromFields",
|
||||||
// lookup
|
// lookup
|
||||||
"get this.timeZone.getOffsetNanosecondsFor",
|
"get this.timeZone.getOffsetNanosecondsFor",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user