diff --git a/test/built-ins/Temporal/PlainDate/from/order-of-operations.js b/test/built-ins/Temporal/PlainDate/from/order-of-operations.js index 75bf120437..cf7681900f 100644 --- a/test/built-ins/Temporal/PlainDate/from/order-of-operations.js +++ b/test/built-ins/Temporal/PlainDate/from/order-of-operations.js @@ -10,6 +10,9 @@ features: [Temporal] const expected = [ "get fields.calendar", + "has fields.calendar.calendar", + "get fields.calendar.fields", + "call fields.calendar.fields", "get fields.day", "get fields.day.valueOf", "call fields.day.valueOf", @@ -22,17 +25,22 @@ const expected = [ "get fields.year", "get fields.year.valueOf", "call fields.year.valueOf", + "get fields.calendar.dateFromFields", + "call fields.calendar.dateFromFields", // inside Calendar.p.dateFromFields "get options.overflow", "get options.overflow.toString", "call options.overflow.toString", ]; const actual = []; + +const calendar = TemporalHelpers.calendarObserver(actual, "fields.calendar"); const fields = TemporalHelpers.propertyBagObserver(actual, { year: 1.7, month: 1.7, monthCode: "M01", day: 1.7, + calendar, }, "fields"); const options = TemporalHelpers.propertyBagObserver(actual, { overflow: "constrain" }, "options"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/add/order-of-operations.js b/test/built-ins/Temporal/PlainDate/prototype/add/order-of-operations.js index 1230b8e15e..37622353d7 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/add/order-of-operations.js +++ b/test/built-ins/Temporal/PlainDate/prototype/add/order-of-operations.js @@ -8,8 +8,8 @@ includes: [compareArray.js, temporalHelpers.js] features: [Temporal] ---*/ -const instance = new Temporal.PlainDate(2000, 5, 2); const expected = [ + // ToTemporalDuration "get fields.days", "get fields.days.valueOf", "call fields.days.valueOf", @@ -40,12 +40,21 @@ const expected = [ "get fields.years", "get fields.years.valueOf", "call fields.years.valueOf", + // CalendarDateAdd + "get this.calendar.dateAdd", + "call this.calendar.dateAdd", // inside Calendar.p.dateAdd "get options.overflow", "get options.overflow.toString", "call options.overflow.toString", ]; const actual = []; + +const calendar = TemporalHelpers.calendarObserver(actual, "this.calendar"); +const instance = new Temporal.PlainDate(2000, 5, 2, calendar); +// clear observable operations that occurred during the constructor call +actual.splice(0); + const fields = TemporalHelpers.propertyBagObserver(actual, { years: 1, months: 1, diff --git a/test/built-ins/Temporal/PlainDate/prototype/subtract/order-of-operations.js b/test/built-ins/Temporal/PlainDate/prototype/subtract/order-of-operations.js index 0b5874d414..a4ecc2774e 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/subtract/order-of-operations.js +++ b/test/built-ins/Temporal/PlainDate/prototype/subtract/order-of-operations.js @@ -8,8 +8,8 @@ includes: [compareArray.js, temporalHelpers.js] features: [Temporal] ---*/ -const instance = new Temporal.PlainDate(2000, 5, 2); const expected = [ + // ToTemporalDuration "get fields.days", "get fields.days.valueOf", "call fields.days.valueOf", @@ -40,12 +40,21 @@ const expected = [ "get fields.years", "get fields.years.valueOf", "call fields.years.valueOf", + // CalendarDateAdd + "get this.calendar.dateAdd", + "call this.calendar.dateAdd", // inside Calendar.p.dateAdd "get options.overflow", "get options.overflow.toString", "call options.overflow.toString", ]; const actual = []; + +const calendar = TemporalHelpers.calendarObserver(actual, "this.calendar"); +const instance = new Temporal.PlainDate(2000, 5, 2, calendar); +// clear observable operations that occurred during the constructor call +actual.splice(0); + const fields = TemporalHelpers.propertyBagObserver(actual, { years: 1, months: 1, diff --git a/test/built-ins/Temporal/PlainDate/prototype/with/order-of-operations.js b/test/built-ins/Temporal/PlainDate/prototype/with/order-of-operations.js index c7018d0bb4..cdd1f76b32 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/with/order-of-operations.js +++ b/test/built-ins/Temporal/PlainDate/prototype/with/order-of-operations.js @@ -8,10 +8,14 @@ includes: [compareArray.js, temporalHelpers.js] features: [Temporal] ---*/ -const instance = new Temporal.PlainDate(2000, 5, 2); const expected = [ + // RejectObjectWithCalendarOrTimeZone "get fields.calendar", "get fields.timeZone", + // CalendarFields + "get this.calendar.fields", + "call this.calendar.fields", + // PrepareTemporalFields "get fields.day", "get fields.day.valueOf", "call fields.day.valueOf", @@ -24,12 +28,33 @@ const expected = [ "get fields.year", "get fields.year.valueOf", "call fields.year.valueOf", + // PrepareTemporalFields on receiver + "get this.calendar.day", + "call this.calendar.day", + "get this.calendar.month", + "call this.calendar.month", + "get this.calendar.monthCode", + "call this.calendar.monthCode", + "get this.calendar.year", + "call this.calendar.year", + // CalendarMergeFields + "get this.calendar.mergeFields", + "call this.calendar.mergeFields", + // CalendarDateFromFields + "get this.calendar.dateFromFields", + "call this.calendar.dateFromFields", // inside Calendar.p.dateFromFields "get options.overflow", "get options.overflow.toString", "call options.overflow.toString", ]; const actual = []; + +const calendar = TemporalHelpers.calendarObserver(actual, "this.calendar"); +const instance = new Temporal.PlainDate(2000, 5, 2, calendar); +// clear observable operations that occurred during the constructor call +actual.splice(0); + const fields = TemporalHelpers.propertyBagObserver(actual, { year: 1.7, month: 1.7, diff --git a/test/built-ins/Temporal/PlainDateTime/from/order-of-operations.js b/test/built-ins/Temporal/PlainDateTime/from/order-of-operations.js index 669d1e129a..8b8de69589 100644 --- a/test/built-ins/Temporal/PlainDateTime/from/order-of-operations.js +++ b/test/built-ins/Temporal/PlainDateTime/from/order-of-operations.js @@ -9,7 +9,13 @@ features: [Temporal] ---*/ const expected = [ + // GetTemporalCalendarWithISODefault "get fields.calendar", + "has fields.calendar.calendar", + // CalendarFields + "get fields.calendar.fields", + "call fields.calendar.fields", + // PrepareTemporalFields "get fields.day", "get fields.day.valueOf", "call fields.day.valueOf", @@ -44,12 +50,15 @@ const expected = [ "get options.overflow", "get options.overflow.toString", "call options.overflow.toString", + "get fields.calendar.dateFromFields", + "call fields.calendar.dateFromFields", // inside Calendar.p.dateFromFields "get options.overflow", "get options.overflow.toString", "call options.overflow.toString", ]; const actual = []; + const fields = TemporalHelpers.propertyBagObserver(actual, { year: 1.7, month: 1.7, @@ -61,6 +70,7 @@ const fields = TemporalHelpers.propertyBagObserver(actual, { millisecond: 1.7, microsecond: 1.7, nanosecond: 1.7, + calendar: TemporalHelpers.calendarObserver(actual, "fields.calendar"), }, "fields"); const options = TemporalHelpers.propertyBagObserver(actual, { overflow: "constrain" }, "options"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/add/order-of-operations.js b/test/built-ins/Temporal/PlainDateTime/prototype/add/order-of-operations.js index 2b3af9ea11..e92472a1d6 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/add/order-of-operations.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/add/order-of-operations.js @@ -8,8 +8,8 @@ includes: [compareArray.js, temporalHelpers.js] features: [Temporal] ---*/ -const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); const expected = [ + // ToTemporalDurationRecord "get fields.days", "get fields.days.valueOf", "call fields.days.valueOf", @@ -40,12 +40,21 @@ const expected = [ "get fields.years", "get fields.years.valueOf", "call fields.years.valueOf", + // AddDateTime + "get this.calendar.dateAdd", + "call this.calendar.dateAdd", // inside Calendar.p.dateAdd "get options.overflow", "get options.overflow.toString", "call options.overflow.toString", ]; const actual = []; + +const calendar = TemporalHelpers.calendarObserver(actual, "this.calendar"); +const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321, calendar); +// clear observable operations that occurred during the constructor call +actual.splice(0); + const fields = TemporalHelpers.propertyBagObserver(actual, { years: 1, months: 1, diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/subtract/order-of-operations.js b/test/built-ins/Temporal/PlainDateTime/prototype/subtract/order-of-operations.js index 4c353fddda..d28bfcd743 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/subtract/order-of-operations.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/subtract/order-of-operations.js @@ -8,8 +8,8 @@ includes: [compareArray.js, temporalHelpers.js] features: [Temporal] ---*/ -const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); const expected = [ + // ToTemporalDurationRecord "get fields.days", "get fields.days.valueOf", "call fields.days.valueOf", @@ -40,12 +40,21 @@ const expected = [ "get fields.years", "get fields.years.valueOf", "call fields.years.valueOf", + // AddDateTime + "get this.calendar.dateAdd", + "call this.calendar.dateAdd", // inside Calendar.p.dateAdd "get options.overflow", "get options.overflow.toString", "call options.overflow.toString", ]; const actual = []; + +const calendar = TemporalHelpers.calendarObserver(actual, "this.calendar"); +const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321, calendar); +// clear observable operations that occurred during the constructor call +actual.splice(0); + const fields = TemporalHelpers.propertyBagObserver(actual, { years: 1, months: 1, diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/with/order-of-operations.js b/test/built-ins/Temporal/PlainDateTime/prototype/with/order-of-operations.js index d203d938cd..0bf4b66933 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/with/order-of-operations.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/with/order-of-operations.js @@ -8,10 +8,14 @@ includes: [compareArray.js, temporalHelpers.js] features: [Temporal] ---*/ -const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321); const expected = [ + // RejectObjectWithCalendarOrTimeZone "get fields.calendar", "get fields.timeZone", + // CalendarFields + "get this.calendar.fields", + "call this.calendar.fields", + // PrepareTemporalFields "get fields.day", "get fields.day.valueOf", "call fields.day.valueOf", @@ -42,16 +46,36 @@ const expected = [ "get fields.year", "get fields.year.valueOf", "call fields.year.valueOf", + // PrepareTemporalFields on receiver + "get this.calendar.day", + "call this.calendar.day", + "get this.calendar.month", + "call this.calendar.month", + "get this.calendar.monthCode", + "call this.calendar.monthCode", + "get this.calendar.year", + "call this.calendar.year", + // CalendarMergeFields + "get this.calendar.mergeFields", + "call this.calendar.mergeFields", // InterpretTemporalDateTimeFields "get options.overflow", "get options.overflow.toString", "call options.overflow.toString", + "get this.calendar.dateFromFields", + "call this.calendar.dateFromFields", // inside Calendar.p.dateFromFields "get options.overflow", "get options.overflow.toString", "call options.overflow.toString", ]; const actual = []; + +const calendar = TemporalHelpers.calendarObserver(actual, "this.calendar"); +const instance = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 654, 321, calendar); +// clear observable operations that occurred during the constructor call +actual.splice(0); + const fields = TemporalHelpers.propertyBagObserver(actual, { year: 1.7, month: 1.7, diff --git a/test/built-ins/Temporal/PlainMonthDay/from/order-of-operations.js b/test/built-ins/Temporal/PlainMonthDay/from/order-of-operations.js index ccf701ff3e..a6f3c7fcfe 100644 --- a/test/built-ins/Temporal/PlainMonthDay/from/order-of-operations.js +++ b/test/built-ins/Temporal/PlainMonthDay/from/order-of-operations.js @@ -10,6 +10,12 @@ features: [Temporal] const expected = [ "get fields.calendar", + // ToTemporalCalendarWithISODefault + "has fields.calendar.calendar", + // CalendarFields + "get fields.calendar.fields", + "call fields.calendar.fields", + // PrepareTemporalFields "get fields.day", "get fields.day.valueOf", "call fields.day.valueOf", @@ -22,17 +28,22 @@ const expected = [ "get fields.year", "get fields.year.valueOf", "call fields.year.valueOf", + // CalendarMonthDayFromFields + "get fields.calendar.monthDayFromFields", + "call fields.calendar.monthDayFromFields", // inside Calendar.p.monthDayFromFields "get options.overflow", "get options.overflow.toString", "call options.overflow.toString", ]; const actual = []; + const fields = TemporalHelpers.propertyBagObserver(actual, { year: 1.7, month: 1.7, monthCode: "M01", day: 1.7, + calendar: TemporalHelpers.calendarObserver(actual, "fields.calendar"), }, "fields"); const options = TemporalHelpers.propertyBagObserver(actual, { overflow: "constrain" }, "options"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/with/order-of-operations.js b/test/built-ins/Temporal/PlainMonthDay/prototype/with/order-of-operations.js index 5fa339246f..64a66f1d81 100644 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/with/order-of-operations.js +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/with/order-of-operations.js @@ -8,10 +8,14 @@ includes: [compareArray.js, temporalHelpers.js] features: [Temporal] ---*/ -const instance = new Temporal.PlainMonthDay(5, 2); const expected = [ + // RejectObjectWithCalendarOrTimeZone "get fields.calendar", "get fields.timeZone", + // CalendarFields + "get this.calendar.fields", + "call this.calendar.fields", + // PrepareTemporalFields "get fields.day", "get fields.day.valueOf", "call fields.day.valueOf", @@ -24,12 +28,29 @@ const expected = [ "get fields.year", "get fields.year.valueOf", "call fields.year.valueOf", + // PrepareTemporalFields on receiver + "get this.calendar.day", + "call this.calendar.day", + "get this.calendar.monthCode", + "call this.calendar.monthCode", + // CalendarMergeFields + "get this.calendar.mergeFields", + "call this.calendar.mergeFields", + // CalendarMonthDayFromFields + "get this.calendar.monthDayFromFields", + "call this.calendar.monthDayFromFields", // inside Calendar.p.monthDayFromFields "get options.overflow", "get options.overflow.toString", "call options.overflow.toString", ]; const actual = []; + +const calendar = TemporalHelpers.calendarObserver(actual, "this.calendar"); +const instance = new Temporal.PlainMonthDay(5, 2, calendar); +// clear observable operations that occurred during the constructor call +actual.splice(0); + const fields = TemporalHelpers.propertyBagObserver(actual, { year: 1.7, month: 1.7, diff --git a/test/built-ins/Temporal/PlainYearMonth/from/order-of-operations.js b/test/built-ins/Temporal/PlainYearMonth/from/order-of-operations.js index c48ad1b667..2ae9926967 100644 --- a/test/built-ins/Temporal/PlainYearMonth/from/order-of-operations.js +++ b/test/built-ins/Temporal/PlainYearMonth/from/order-of-operations.js @@ -9,7 +9,13 @@ features: [Temporal] ---*/ const expected = [ + // GetTemporalCalendarWithISODefault "get fields.calendar", + "has fields.calendar.calendar", + // CalendarFields + "get fields.calendar.fields", + "call fields.calendar.fields", + // PrepareTemporalFields "get fields.month", "get fields.month.valueOf", "call fields.month.valueOf", @@ -19,16 +25,21 @@ const expected = [ "get fields.year", "get fields.year.valueOf", "call fields.year.valueOf", + // CalendarYearMonthFromFields + "get fields.calendar.yearMonthFromFields", + "call fields.calendar.yearMonthFromFields", // inside Calendar.p.yearMonthFromFields "get options.overflow", "get options.overflow.toString", "call options.overflow.toString", ]; const actual = []; + const fields = TemporalHelpers.propertyBagObserver(actual, { year: 1.7, month: 1.7, monthCode: "M01", + calendar: TemporalHelpers.calendarObserver(actual, "fields.calendar"), }, "fields"); const options = TemporalHelpers.propertyBagObserver(actual, { overflow: "constrain" }, "options"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/add/order-of-operations.js b/test/built-ins/Temporal/PlainYearMonth/prototype/add/order-of-operations.js index c16c198481..97b5206a54 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/add/order-of-operations.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/add/order-of-operations.js @@ -8,8 +8,8 @@ includes: [compareArray.js, temporalHelpers.js] features: [Temporal] ---*/ -const instance = new Temporal.PlainYearMonth(2000, 5); const expected = [ + // ToTemporalDuration "get fields.days", "get fields.days.valueOf", "call fields.days.valueOf", @@ -40,19 +40,47 @@ const expected = [ "get fields.years", "get fields.years.valueOf", "call fields.years.valueOf", + // CalendarFields + "get this.calendar.fields", + "call this.calendar.fields", + // PrepareTemporalFields on receiver + "get this.calendar.monthCode", + "call this.calendar.monthCode", + "get this.calendar.year", + "call this.calendar.year", + // CalendarDateFromFields + "get this.calendar.dateFromFields", + "call this.calendar.dateFromFields", // CopyDataProperties "ownKeys options", "getOwnPropertyDescriptor options.overflow", "get options.overflow", + // CalendarDateAdd + "get this.calendar.dateAdd", + "call this.calendar.dateAdd", // inside Calendar.p.dateAdd "get options.overflow", "get options.overflow.toString", "call options.overflow.toString", + // PrepareTemporalFields on added date + "get this.calendar.monthCode", + "call this.calendar.monthCode", + "get this.calendar.year", + "call this.calendar.year", + // CalendarYearMonthFromFields + "get this.calendar.yearMonthFromFields", + "call this.calendar.yearMonthFromFields", // inside Calendar.p.yearMonthFromFields "get options.overflow.toString", "call options.overflow.toString", ]; const actual = []; + +const calendar = TemporalHelpers.calendarObserver(actual, "this.calendar"); +const instance = new Temporal.PlainYearMonth(2000, 5, calendar); +// clear observable operations that occurred during the constructor call +actual.splice(0); + const fields = TemporalHelpers.propertyBagObserver(actual, { years: 1, months: 1, diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/subtract/order-of-operations.js b/test/built-ins/Temporal/PlainYearMonth/prototype/subtract/order-of-operations.js index a1274055b9..d0743024ef 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/subtract/order-of-operations.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/subtract/order-of-operations.js @@ -8,8 +8,8 @@ includes: [compareArray.js, temporalHelpers.js] features: [Temporal] ---*/ -const instance = new Temporal.PlainYearMonth(2000, 5); const expected = [ + // ToTemporalDuration "get fields.days", "get fields.days.valueOf", "call fields.days.valueOf", @@ -40,19 +40,50 @@ const expected = [ "get fields.years", "get fields.years.valueOf", "call fields.years.valueOf", + // CalendarFields + "get this.calendar.fields", + "call this.calendar.fields", + // PrepareTemporalFields on receiver + "get this.calendar.monthCode", + "call this.calendar.monthCode", + "get this.calendar.year", + "call this.calendar.year", + // CalendarDaysInMonth + "get this.calendar.daysInMonth", + "call this.calendar.daysInMonth", + // CalendarDateFromFields + "get this.calendar.dateFromFields", + "call this.calendar.dateFromFields", // CopyDataProperties "ownKeys options", "getOwnPropertyDescriptor options.overflow", "get options.overflow", + // CalendarDateAdd + "get this.calendar.dateAdd", + "call this.calendar.dateAdd", // inside Calendar.p.dateAdd "get options.overflow", "get options.overflow.toString", "call options.overflow.toString", + // PrepareTemporalFields on added date + "get this.calendar.monthCode", + "call this.calendar.monthCode", + "get this.calendar.year", + "call this.calendar.year", + // CalendarYearMonthFromFields + "get this.calendar.yearMonthFromFields", + "call this.calendar.yearMonthFromFields", // inside Calendar.p.yearMonthFromFields "get options.overflow.toString", "call options.overflow.toString", ]; const actual = []; + +const calendar = TemporalHelpers.calendarObserver(actual, "this.calendar"); +const instance = new Temporal.PlainYearMonth(2000, 5, calendar); +// clear observable operations that occurred during the constructor call +actual.splice(0); + const fields = TemporalHelpers.propertyBagObserver(actual, { years: 1, months: 1, diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/with/order-of-operations.js b/test/built-ins/Temporal/PlainYearMonth/prototype/with/order-of-operations.js index 31c38f846a..62751200ed 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/with/order-of-operations.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/with/order-of-operations.js @@ -8,10 +8,14 @@ includes: [compareArray.js, temporalHelpers.js] features: [Temporal] ---*/ -const instance = new Temporal.PlainYearMonth(2000, 5); const expected = [ + // RejectObjectWithCalendarOrTimeZone "get fields.calendar", "get fields.timeZone", + // CalendarFields + "get this.calendar.fields", + "call this.calendar.fields", + // PrepareTemporalFields "get fields.month", "get fields.month.valueOf", "call fields.month.valueOf", @@ -21,12 +25,31 @@ const expected = [ "get fields.year", "get fields.year.valueOf", "call fields.year.valueOf", + // PrepareTemporalFields on receiver + "get this.calendar.month", + "call this.calendar.month", + "get this.calendar.monthCode", + "call this.calendar.monthCode", + "get this.calendar.year", + "call this.calendar.year", + // CalendarMergeFields + "get this.calendar.mergeFields", + "call this.calendar.mergeFields", + // CalendarYearMonthFromFields + "get this.calendar.yearMonthFromFields", + "call this.calendar.yearMonthFromFields", // inside Calendar.p.yearMonthFromFields "get options.overflow", "get options.overflow.toString", "call options.overflow.toString", ]; const actual = []; + +const calendar = TemporalHelpers.calendarObserver(actual, "this.calendar"); +const instance = new Temporal.PlainYearMonth(2000, 5, calendar); +// clear observable operations that occurred during the constructor call +actual.splice(0); + const fields = TemporalHelpers.propertyBagObserver(actual, { year: 1.7, month: 1.7,