Temporal: Add offset field to order-of-operations tests

There are additional observable operations that occur when providing an
`offset` property in a relativeTo or ZonedDateTime property bag. We can
test these in our existing order-of-operations tests.
This commit is contained in:
Philip Chimento 2022-11-01 15:50:13 -07:00 committed by Ms2ger
parent c8dead8b74
commit 1c2508e801
3 changed files with 15 additions and 0 deletions

View File

@ -112,8 +112,12 @@ const expected = [
"get options.relativeTo.offset",
"get options.relativeTo.timeZone",
"has options.relativeTo.timeZone.timeZone",
"get options.relativeTo.offset.toString",
"call options.relativeTo.offset.toString",
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor",
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
// CalculateOffsetShift on first argument
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
@ -152,6 +156,7 @@ const relativeTo = TemporalHelpers.propertyBagObserver(actual, {
millisecond: 987,
microsecond: 654,
nanosecond: 321,
offset: "+00:00",
calendar: TemporalHelpers.calendarObserver(actual, "options.relativeTo.calendar"),
timeZone: TemporalHelpers.timeZoneObserver(actual, "options.relativeTo.timeZone"),
}, "options.relativeTo");

View File

@ -46,11 +46,15 @@ const expected = [
"call other.year.valueOf",
"get other.timeZone",
"get other.offset",
"get other.offset.toString",
"call other.offset.toString",
"has other.timeZone.timeZone",
"get other.calendar.dateFromFields",
"call other.calendar.dateFromFields",
"get other.timeZone.getPossibleInstantsFor",
"call other.timeZone.getPossibleInstantsFor",
"get other.timeZone.getOffsetNanosecondsFor",
"call other.timeZone.getOffsetNanosecondsFor",
// CalendarEquals
"get this.calendar[Symbol.toPrimitive]",
"get this.calendar.toString",
@ -89,6 +93,7 @@ const otherDateTimePropertyBag = TemporalHelpers.propertyBagObserver(actual, {
millisecond: 250,
microsecond: 500,
nanosecond: 750,
offset: "+00:00",
calendar: TemporalHelpers.calendarObserver(actual, "other.calendar"),
timeZone: TemporalHelpers.timeZoneObserver(actual, "other.timeZone"),
}, "other");

View File

@ -46,11 +46,15 @@ const expected = [
"call other.year.valueOf",
"get other.timeZone",
"get other.offset",
"get other.offset.toString",
"call other.offset.toString",
"has other.timeZone.timeZone",
"get other.calendar.dateFromFields",
"call other.calendar.dateFromFields",
"get other.timeZone.getPossibleInstantsFor",
"call other.timeZone.getPossibleInstantsFor",
"get other.timeZone.getOffsetNanosecondsFor",
"call other.timeZone.getOffsetNanosecondsFor",
// CalendarEquals
"get this.calendar[Symbol.toPrimitive]",
"get this.calendar.toString",
@ -89,6 +93,7 @@ const otherDateTimePropertyBag = TemporalHelpers.propertyBagObserver(actual, {
millisecond: 250,
microsecond: 500,
nanosecond: 750,
offset: "+00:00",
calendar: TemporalHelpers.calendarObserver(actual, "other.calendar"),
timeZone: TemporalHelpers.timeZoneObserver(actual, "other.timeZone"),
}, "other");