mirror of
https://github.com/tc39/test262.git
synced 2025-07-29 17:04:31 +02:00
Temporal: Test change from MergeLargestUnitOption to CopyDataProperties
This tests some of the normative changes in https://github.com/tc39/proposal-temporal/pull/2245, which achieved consensus in the July 2022 TC39 meeting, specifically as they apply to places where the MergeLargestUnitOperation was called. Due to the use of the pre-existing spec operation CopyDataProperties, the order of observable property operations has changed from a batch of [[GetOwnProperty]] followed by a batch of [[Get]], to a series of interleaved [[GetOwnProperty]]/[[Get]] pairs. This previously wasn't tested because TemporalHelpers.propertyBagObserver didn't track [[GetOwnProperty]] operations, but now it does.
This commit is contained in:
parent
dfbeca3c79
commit
99bc91e0f5
@ -1612,6 +1612,10 @@ var TemporalHelpers = {
|
||||
calls.push(`ownKeys ${objectName}`);
|
||||
return Reflect.ownKeys(target);
|
||||
},
|
||||
getOwnPropertyDescriptor(target, key) {
|
||||
calls.push(`getOwnPropertyDescriptor ${formatPropertyName(key, objectName)}`);
|
||||
return Reflect.getOwnPropertyDescriptor(target, key);
|
||||
},
|
||||
get(target, key, receiver) {
|
||||
calls.push(`get ${formatPropertyName(key, objectName)}`);
|
||||
const result = Reflect.get(target, key, receiver);
|
||||
|
@ -48,12 +48,17 @@ const expected = [
|
||||
"get options.roundingIncrement",
|
||||
"get options.roundingIncrement.valueOf",
|
||||
"call options.roundingIncrement.valueOf",
|
||||
// MergeLargestUnitOption
|
||||
// CopyDataProperties
|
||||
"ownKeys options",
|
||||
"getOwnPropertyDescriptor options.roundingIncrement",
|
||||
"get options.roundingIncrement",
|
||||
"getOwnPropertyDescriptor options.roundingMode",
|
||||
"get options.roundingMode",
|
||||
"getOwnPropertyDescriptor options.largestUnit",
|
||||
"get options.largestUnit",
|
||||
"getOwnPropertyDescriptor options.smallestUnit",
|
||||
"get options.smallestUnit",
|
||||
"getOwnPropertyDescriptor options.additional",
|
||||
"get options.additional",
|
||||
// CalendarDateUntil
|
||||
"get this.calendar.dateUntil",
|
||||
|
@ -48,12 +48,17 @@ const expected = [
|
||||
"get options.roundingIncrement",
|
||||
"get options.roundingIncrement.valueOf",
|
||||
"call options.roundingIncrement.valueOf",
|
||||
// MergeLargestUnitOption
|
||||
// CopyDataProperties
|
||||
"ownKeys options",
|
||||
"getOwnPropertyDescriptor options.roundingIncrement",
|
||||
"get options.roundingIncrement",
|
||||
"getOwnPropertyDescriptor options.roundingMode",
|
||||
"get options.roundingMode",
|
||||
"getOwnPropertyDescriptor options.largestUnit",
|
||||
"get options.largestUnit",
|
||||
"getOwnPropertyDescriptor options.smallestUnit",
|
||||
"get options.smallestUnit",
|
||||
"getOwnPropertyDescriptor options.additional",
|
||||
"get options.additional",
|
||||
// CalendarDateUntil
|
||||
"get this.calendar.dateUntil",
|
||||
|
@ -66,12 +66,17 @@ const expected = [
|
||||
"get options.roundingIncrement",
|
||||
"get options.roundingIncrement.valueOf",
|
||||
"call options.roundingIncrement.valueOf",
|
||||
// MergeLargestUnitOption
|
||||
// CopyDataProperties
|
||||
"ownKeys options",
|
||||
"getOwnPropertyDescriptor options.roundingIncrement",
|
||||
"get options.roundingIncrement",
|
||||
"getOwnPropertyDescriptor options.roundingMode",
|
||||
"get options.roundingMode",
|
||||
"getOwnPropertyDescriptor options.largestUnit",
|
||||
"get options.largestUnit",
|
||||
"getOwnPropertyDescriptor options.smallestUnit",
|
||||
"get options.smallestUnit",
|
||||
"getOwnPropertyDescriptor options.additional",
|
||||
"get options.additional",
|
||||
// CalendarDateUntil
|
||||
"get this.calendar.dateUntil",
|
||||
|
@ -66,12 +66,17 @@ const expected = [
|
||||
"get options.roundingIncrement",
|
||||
"get options.roundingIncrement.valueOf",
|
||||
"call options.roundingIncrement.valueOf",
|
||||
// MergeLargestUnitOption
|
||||
// CopyDataProperties
|
||||
"ownKeys options",
|
||||
"getOwnPropertyDescriptor options.roundingIncrement",
|
||||
"get options.roundingIncrement",
|
||||
"getOwnPropertyDescriptor options.roundingMode",
|
||||
"get options.roundingMode",
|
||||
"getOwnPropertyDescriptor options.largestUnit",
|
||||
"get options.largestUnit",
|
||||
"getOwnPropertyDescriptor options.smallestUnit",
|
||||
"get options.smallestUnit",
|
||||
"getOwnPropertyDescriptor options.additional",
|
||||
"get options.additional",
|
||||
// CalendarDateUntil
|
||||
"get this.calendar.dateUntil",
|
||||
|
@ -14,9 +14,14 @@ features: [Temporal]
|
||||
|
||||
const actual = [];
|
||||
const expected = [
|
||||
// CopyDataProperties
|
||||
"ownKeys options",
|
||||
"getOwnPropertyDescriptor options.extra",
|
||||
"get options.extra",
|
||||
// Temporal.Calendar.prototype.dateAdd
|
||||
"get options.overflow",
|
||||
// overwriting property in custom calendar dateAdd
|
||||
"getOwnPropertyDescriptor options.overflow",
|
||||
];
|
||||
const options = TemporalHelpers.propertyBagObserver(actual, { extra: 5 }, "options");
|
||||
|
||||
|
@ -14,11 +14,17 @@ features: [Temporal]
|
||||
|
||||
const actual = [];
|
||||
const expected = [
|
||||
// CopyDataProperties
|
||||
"ownKeys options",
|
||||
"getOwnPropertyDescriptor options.overflow",
|
||||
"get options.overflow",
|
||||
// Temporal.Calendar.prototype.dateAdd
|
||||
"get options.overflow",
|
||||
"get options.overflow.toString",
|
||||
"call options.overflow.toString",
|
||||
// overwriting property in custom calendar dateAdd
|
||||
"getOwnPropertyDescriptor options.overflow",
|
||||
// Temporal.Calendar.prototype.yearMonthFromFields (toPrimitiveObserver copied but not options object)
|
||||
"get options.overflow.toString",
|
||||
"call options.overflow.toString",
|
||||
];
|
||||
|
@ -60,12 +60,17 @@ const expected = [
|
||||
"call this.calendar.year",
|
||||
"get this.calendar.dateFromFields",
|
||||
"call this.calendar.dateFromFields",
|
||||
// MergeLargestUnitOption
|
||||
// CopyDataProperties
|
||||
"ownKeys options",
|
||||
"getOwnPropertyDescriptor options.roundingIncrement",
|
||||
"get options.roundingIncrement",
|
||||
"getOwnPropertyDescriptor options.roundingMode",
|
||||
"get options.roundingMode",
|
||||
"getOwnPropertyDescriptor options.largestUnit",
|
||||
"get options.largestUnit",
|
||||
"getOwnPropertyDescriptor options.smallestUnit",
|
||||
"get options.smallestUnit",
|
||||
"getOwnPropertyDescriptor options.additional",
|
||||
"get options.additional",
|
||||
// CalendarDateUntil
|
||||
"get this.calendar.dateUntil",
|
||||
|
@ -14,9 +14,14 @@ features: [Temporal]
|
||||
|
||||
const actual = [];
|
||||
const expected = [
|
||||
// CopyDataProperties
|
||||
"ownKeys options",
|
||||
"getOwnPropertyDescriptor options.extra",
|
||||
"get options.extra",
|
||||
// Temporal.Calendar.prototype.dateAdd
|
||||
"get options.overflow",
|
||||
// overwriting property in custom calendar dateAdd
|
||||
"getOwnPropertyDescriptor options.overflow",
|
||||
];
|
||||
const options = TemporalHelpers.propertyBagObserver(actual, { extra: 5 }, "options");
|
||||
|
||||
|
@ -14,11 +14,17 @@ features: [Temporal]
|
||||
|
||||
const actual = [];
|
||||
const expected = [
|
||||
// CopyDataProperties
|
||||
"ownKeys options",
|
||||
"getOwnPropertyDescriptor options.overflow",
|
||||
"get options.overflow",
|
||||
// Temporal.Calendar.prototype.dateAdd
|
||||
"get options.overflow",
|
||||
"get options.overflow.toString",
|
||||
"call options.overflow.toString",
|
||||
// overwriting property in custom calendar dateAdd
|
||||
"getOwnPropertyDescriptor options.overflow",
|
||||
// Temporal.Calendar.prototype.yearMonthFromFields (toPrimitiveObserver copied but not options object)
|
||||
"get options.overflow.toString",
|
||||
"call options.overflow.toString",
|
||||
];
|
||||
|
@ -60,12 +60,17 @@ const expected = [
|
||||
"call this.calendar.year",
|
||||
"get this.calendar.dateFromFields",
|
||||
"call this.calendar.dateFromFields",
|
||||
// MergeLargestUnitOption
|
||||
// CopyDataProperties
|
||||
"ownKeys options",
|
||||
"getOwnPropertyDescriptor options.roundingIncrement",
|
||||
"get options.roundingIncrement",
|
||||
"getOwnPropertyDescriptor options.roundingMode",
|
||||
"get options.roundingMode",
|
||||
"getOwnPropertyDescriptor options.largestUnit",
|
||||
"get options.largestUnit",
|
||||
"getOwnPropertyDescriptor options.smallestUnit",
|
||||
"get options.smallestUnit",
|
||||
"getOwnPropertyDescriptor options.additional",
|
||||
"get options.additional",
|
||||
// CalendarDateUntil
|
||||
"get this.calendar.dateUntil",
|
||||
|
@ -122,12 +122,17 @@ const expectedOpsForCalendarDifference = [
|
||||
"get other.timeZone[Symbol.toPrimitive]",
|
||||
"get other.timeZone.toString",
|
||||
"call other.timeZone.toString",
|
||||
// MergeLargestUnitOption
|
||||
// CopyDataProperties
|
||||
"ownKeys options",
|
||||
"getOwnPropertyDescriptor options.roundingIncrement",
|
||||
"get options.roundingIncrement",
|
||||
"getOwnPropertyDescriptor options.roundingMode",
|
||||
"get options.roundingMode",
|
||||
"getOwnPropertyDescriptor options.largestUnit",
|
||||
"get options.largestUnit",
|
||||
"getOwnPropertyDescriptor options.smallestUnit",
|
||||
"get options.smallestUnit",
|
||||
"getOwnPropertyDescriptor options.additional",
|
||||
"get options.additional",
|
||||
// DifferenceZonedDateTime
|
||||
"get this.timeZone.getOffsetNanosecondsFor",
|
||||
|
@ -122,12 +122,17 @@ const expectedOpsForCalendarDifference = [
|
||||
"get other.timeZone[Symbol.toPrimitive]",
|
||||
"get other.timeZone.toString",
|
||||
"call other.timeZone.toString",
|
||||
// MergeLargestUnitOption
|
||||
// CopyDataProperties
|
||||
"ownKeys options",
|
||||
"getOwnPropertyDescriptor options.roundingIncrement",
|
||||
"get options.roundingIncrement",
|
||||
"getOwnPropertyDescriptor options.roundingMode",
|
||||
"get options.roundingMode",
|
||||
"getOwnPropertyDescriptor options.largestUnit",
|
||||
"get options.largestUnit",
|
||||
"getOwnPropertyDescriptor options.smallestUnit",
|
||||
"get options.smallestUnit",
|
||||
"getOwnPropertyDescriptor options.additional",
|
||||
"get options.additional",
|
||||
// DifferenceZonedDateTime
|
||||
"get this.timeZone.getOffsetNanosecondsFor",
|
||||
|
Loading…
x
Reference in New Issue
Block a user