Temporal: Test order of property accesses

This contains tests for the normative PR
https://github.com/tc39/proposal-temporal/pull/2437, which is to be
presented for consensus to TC39 in the upcoming plenary meeting. That PR
changes the observable order of property accesses to be alphabetical where
possible.
This commit is contained in:
Philip Chimento 2022-11-17 18:30:14 -08:00 committed by Philip Chimento
parent f1fc5c6497
commit 8f752acdaa
39 changed files with 367 additions and 306 deletions

View File

@ -105,14 +105,14 @@ const expectedOpsForPlainRelativeTo = expected.concat([
"get options.relativeTo.monthCode.toString",
"call options.relativeTo.monthCode.toString",
"get options.relativeTo.nanosecond",
"get options.relativeTo.offset",
"get options.relativeTo.second",
"get options.relativeTo.timeZone",
"get options.relativeTo.year",
"get options.relativeTo.year.valueOf",
"call options.relativeTo.year.valueOf",
"get options.relativeTo.calendar.dateFromFields",
"call options.relativeTo.calendar.dateFromFields",
"get options.relativeTo.offset",
"get options.relativeTo.timeZone",
]);
const plainRelativeTo = TemporalHelpers.propertyBagObserver(actual, {
@ -181,19 +181,19 @@ const expectedOpsForZonedRelativeTo = expected.concat([
"get options.relativeTo.nanosecond",
"get options.relativeTo.nanosecond.valueOf",
"call options.relativeTo.nanosecond.valueOf",
"get options.relativeTo.offset",
"get options.relativeTo.offset.toString",
"call options.relativeTo.offset.toString",
"get options.relativeTo.second",
"get options.relativeTo.second.valueOf",
"call options.relativeTo.second.valueOf",
"get options.relativeTo.timeZone",
"get options.relativeTo.year",
"get options.relativeTo.year.valueOf",
"call options.relativeTo.year.valueOf",
"get options.relativeTo.calendar.dateFromFields",
"call options.relativeTo.calendar.dateFromFields",
"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",

View File

@ -89,16 +89,15 @@ const expectedOpsForPlainRelativeTo = expected.concat([
"get options.relativeTo.monthCode.toString",
"call options.relativeTo.monthCode.toString",
"get options.relativeTo.nanosecond",
"get options.relativeTo.offset",
"get options.relativeTo.second",
"get options.relativeTo.timeZone",
"get options.relativeTo.year",
"get options.relativeTo.year.valueOf",
"call options.relativeTo.year.valueOf",
// InterpretTemporalDateTimeFields
"get options.relativeTo.calendar.dateFromFields",
"call options.relativeTo.calendar.dateFromFields",
// ToRelativeTemporalObject again
"get options.relativeTo.offset",
"get options.relativeTo.timeZone",
// AddDuration
"get options.relativeTo.calendar.dateAdd",
"call options.relativeTo.calendar.dateAdd",
@ -165,9 +164,13 @@ const expectedOpsForZonedRelativeTo = expected.concat([
"get options.relativeTo.nanosecond",
"get options.relativeTo.nanosecond.valueOf",
"call options.relativeTo.nanosecond.valueOf",
"get options.relativeTo.offset",
"get options.relativeTo.offset.toString",
"call options.relativeTo.offset.toString",
"get options.relativeTo.second",
"get options.relativeTo.second.valueOf",
"call options.relativeTo.second.valueOf",
"get options.relativeTo.timeZone",
"get options.relativeTo.year",
"get options.relativeTo.year.valueOf",
"call options.relativeTo.year.valueOf",
@ -175,11 +178,7 @@ const expectedOpsForZonedRelativeTo = expected.concat([
"get options.relativeTo.calendar.dateFromFields",
"call options.relativeTo.calendar.dateFromFields",
// ToRelativeTemporalObject again
"get options.relativeTo.offset",
"get options.relativeTo.timeZone",
"has options.relativeTo.timeZone.timeZone",
"get options.relativeTo.offset.toString",
"call options.relativeTo.offset.toString",
// InterpretISODateTimeOffset
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor",

View File

@ -9,20 +9,19 @@ features: [Temporal]
---*/
const expected = [
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
"get options.largestUnit",
"get options.largestUnit.toString",
"call options.largestUnit.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.relativeTo",
"get options.roundingIncrement",
"get options.roundingIncrement.valueOf",
"call options.roundingIncrement.valueOf",
// ToRelativeTemporalObject
"get options.relativeTo",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
];
const actual = [];
@ -43,8 +42,11 @@ instance.round(createOptionsObserver({ smallestUnit: "microseconds" }));
assert.compareArray(actual, expected, "order of operations");
actual.splice(0); // clear
const expectedOpsForPlainRelativeTo = expected.concat([
// ToRelativeTemporalObject
const expectedOpsForPlainRelativeTo = [
"get options.largestUnit",
"get options.largestUnit.toString",
"call options.largestUnit.toString",
"get options.relativeTo",
"get options.relativeTo.calendar",
"has options.relativeTo.calendar.calendar",
"get options.relativeTo.calendar.fields",
@ -63,15 +65,24 @@ const expectedOpsForPlainRelativeTo = expected.concat([
"get options.relativeTo.monthCode.toString",
"call options.relativeTo.monthCode.toString",
"get options.relativeTo.nanosecond",
"get options.relativeTo.offset",
"get options.relativeTo.second",
"get options.relativeTo.timeZone",
"get options.relativeTo.year",
"get options.relativeTo.year.valueOf",
"call options.relativeTo.year.valueOf",
"get options.relativeTo.calendar.dateFromFields",
"call options.relativeTo.calendar.dateFromFields",
"get options.relativeTo.offset",
"get options.relativeTo.timeZone",
]);
"get options.roundingIncrement",
"get options.roundingIncrement.valueOf",
"call options.roundingIncrement.valueOf",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
];
const plainRelativeTo = TemporalHelpers.propertyBagObserver(actual, {
year: 2001,
@ -214,8 +225,11 @@ instance8.round(createOptionsObserver({ largestUnit: "weeks", smallestUnit: "day
assert.compareArray(actual, expectedOpsForDayToWeekBalancing, "order of operations with largestUnit = weeks, smallestUnit = days");
actual.splice(0); // clear
const expectedOpsForZonedRelativeTo = expected.concat([
// ToRelativeTemporalObject
const expectedOpsForZonedRelativeTo = [
"get options.largestUnit",
"get options.largestUnit.toString",
"call options.largestUnit.toString",
"get options.relativeTo",
"get options.relativeTo.calendar",
"has options.relativeTo.calendar.calendar",
"get options.relativeTo.calendar.fields",
@ -244,28 +258,37 @@ const expectedOpsForZonedRelativeTo = expected.concat([
"get options.relativeTo.nanosecond",
"get options.relativeTo.nanosecond.valueOf",
"call options.relativeTo.nanosecond.valueOf",
"get options.relativeTo.offset",
"get options.relativeTo.offset.toString",
"call options.relativeTo.offset.toString",
"get options.relativeTo.second",
"get options.relativeTo.second.valueOf",
"call options.relativeTo.second.valueOf",
"get options.relativeTo.timeZone",
"get options.relativeTo.year",
"get options.relativeTo.year.valueOf",
"call options.relativeTo.year.valueOf",
"get options.relativeTo.calendar.dateFromFields",
"call options.relativeTo.calendar.dateFromFields",
"get options.relativeTo.offset",
"get options.relativeTo.timeZone",
"has options.relativeTo.timeZone.timeZone",
"get options.relativeTo.offset.toString",
"call options.relativeTo.offset.toString",
// InterpretISODateTimeOffset
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor",
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
"get options.roundingIncrement",
"get options.roundingIncrement.valueOf",
"call options.roundingIncrement.valueOf",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
// RoundDuration → ToTemporalDate
"get options.relativeTo.timeZone.getOffsetNanosecondsFor",
"call options.relativeTo.timeZone.getOffsetNanosecondsFor",
]);
];
const zonedRelativeTo = TemporalHelpers.propertyBagObserver(actual, {
year: 2001,

View File

@ -89,16 +89,15 @@ const expectedOpsForPlainRelativeTo = expected.concat([
"get options.relativeTo.monthCode.toString",
"call options.relativeTo.monthCode.toString",
"get options.relativeTo.nanosecond",
"get options.relativeTo.offset",
"get options.relativeTo.second",
"get options.relativeTo.timeZone",
"get options.relativeTo.year",
"get options.relativeTo.year.valueOf",
"call options.relativeTo.year.valueOf",
// InterpretTemporalDateTimeFields
"get options.relativeTo.calendar.dateFromFields",
"call options.relativeTo.calendar.dateFromFields",
// ToRelativeTemporalObject again
"get options.relativeTo.offset",
"get options.relativeTo.timeZone",
// AddDuration
"get options.relativeTo.calendar.dateAdd",
"call options.relativeTo.calendar.dateAdd",
@ -165,9 +164,13 @@ const expectedOpsForZonedRelativeTo = expected.concat([
"get options.relativeTo.nanosecond",
"get options.relativeTo.nanosecond.valueOf",
"call options.relativeTo.nanosecond.valueOf",
"get options.relativeTo.offset",
"get options.relativeTo.offset.toString",
"call options.relativeTo.offset.toString",
"get options.relativeTo.second",
"get options.relativeTo.second.valueOf",
"call options.relativeTo.second.valueOf",
"get options.relativeTo.timeZone",
"get options.relativeTo.year",
"get options.relativeTo.year.valueOf",
"call options.relativeTo.year.valueOf",
@ -175,11 +178,7 @@ const expectedOpsForZonedRelativeTo = expected.concat([
"get options.relativeTo.calendar.dateFromFields",
"call options.relativeTo.calendar.dateFromFields",
// ToRelativeTemporalObject again
"get options.relativeTo.offset",
"get options.relativeTo.timeZone",
"has options.relativeTo.timeZone.timeZone",
"get options.relativeTo.offset.toString",
"call options.relativeTo.offset.toString",
// InterpretISODateTimeOffset
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor",

View File

@ -17,10 +17,13 @@ features: [Temporal]
const duration = new Temporal.Duration(1, 2, 3, 4, 5, 6, 7, 987, 650, 0);
let string = duration.toString({ fractionalSecondDigits: 2.5 });
assert.sameValue(string, "P1Y2M3W4DT5H6M7.98S", "fractionalSecondDigits 2.5 truncates to 2");
assert.sameValue(string, "P1Y2M3W4DT5H6M7.98S", "fractionalSecondDigits 2.5 floors to 2");
string = duration.toString({ fractionalSecondDigits: 9.7 });
assert.sameValue(string, "P1Y2M3W4DT5H6M7.987650000S", "fractionalSecondDigits 9.7 truncates to 9 and is not out of range");
assert.sameValue(string, "P1Y2M3W4DT5H6M7.987650000S", "fractionalSecondDigits 9.7 floors to 9 and is not out of range");
string = duration.toString({ fractionalSecondDigits: -0.6 });
assert.sameValue(string, "P1Y2M3W4DT5H6M7S", "fractionalSecondDigits -0.6 truncates to 0 and is not out of range");
assert.throws(
RangeError,
() => duration.toString({ fractionalSecondDigits: -0.6 }),
"fractionalSecondDigits -0.6 floors to -1 and is out of range"
);

View File

@ -9,36 +9,32 @@ features: [Temporal]
---*/
const expected = [
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
];
const actual = [];
const instance = new Temporal.Duration(1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
instance.toString(
TemporalHelpers.propertyBagObserver(actual, {
fractionalSecondDigits: 3,
roundingMode: "halfExpand",
smallestUnit: "millisecond",
}, "options"),
);
assert.compareArray(actual, expected, "order of operations");
actual.splice(0); // clear
const expectedForFractionalSecondDigits = [
"get options.smallestUnit",
"get options.fractionalSecondDigits",
"get options.fractionalSecondDigits.toString",
"call options.fractionalSecondDigits.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
];
const actual = [];
const instance = new Temporal.Duration(1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
const expectedForSmallestUnit = expected.concat([
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
]);
instance.toString(
TemporalHelpers.propertyBagObserver(actual, {
fractionalSecondDigits: "auto",
roundingMode: "halfExpand",
smallestUnit: "millisecond",
}, "options"),
);
assert.compareArray(actual, expectedForSmallestUnit, "order of operations");
actual.splice(0); // clear
instance.toString(
TemporalHelpers.propertyBagObserver(actual, {
@ -47,4 +43,4 @@ instance.toString(
smallestUnit: undefined,
}, "options"),
);
assert.compareArray(actual, expectedForFractionalSecondDigits, "order of operations with smallestUnit undefined");
assert.compareArray(actual, expected, "order of operations with smallestUnit undefined");

View File

@ -18,12 +18,12 @@ const tests = [
for (const [smallestUnit, expected] of tests) {
const string = duration.toString({
smallestUnit,
get fractionalSecondDigits() { throw new Test262Error("should not get fractionalSecondDigits") }
fractionalSecondDigits: 5,
});
assert.sameValue(string, expected, `smallestUnit: "${smallestUnit}" overrides fractionalSecondDigits`);
}
assert.throws(RangeError, () => duration.toString({
smallestUnit: "hour",
get fractionalSecondDigits() { throw new Test262Error("should not get fractionalSecondDigits") }
fractionalSecondDigits: 5,
}), "hour is an invalid smallestUnit but still overrides fractionalSecondDigits");

View File

@ -53,14 +53,14 @@ const expectedOpsForPlainRelativeTo = [
"get options.relativeTo.monthCode.toString",
"call options.relativeTo.monthCode.toString",
"get options.relativeTo.nanosecond",
"get options.relativeTo.offset",
"get options.relativeTo.second",
"get options.relativeTo.timeZone",
"get options.relativeTo.year",
"get options.relativeTo.year.valueOf",
"call options.relativeTo.year.valueOf",
"get options.relativeTo.calendar.dateFromFields",
"call options.relativeTo.calendar.dateFromFields",
"get options.relativeTo.offset",
"get options.relativeTo.timeZone",
// GetTemporalUnit
"get options.unit",
"get options.unit.toString",
@ -171,19 +171,19 @@ const expectedOpsForZonedRelativeTo = [
"get options.relativeTo.nanosecond",
"get options.relativeTo.nanosecond.valueOf",
"call options.relativeTo.nanosecond.valueOf",
"get options.relativeTo.offset",
"get options.relativeTo.offset.toString",
"call options.relativeTo.offset.toString",
"get options.relativeTo.second",
"get options.relativeTo.second.valueOf",
"call options.relativeTo.second.valueOf",
"get options.relativeTo.timeZone",
"get options.relativeTo.year",
"get options.relativeTo.year.valueOf",
"call options.relativeTo.year.valueOf",
"get options.relativeTo.calendar.dateFromFields",
"call options.relativeTo.calendar.dateFromFields",
"get options.relativeTo.offset",
"get options.relativeTo.timeZone",
"has options.relativeTo.timeZone.timeZone",
"get options.relativeTo.offset.toString",
"call options.relativeTo.offset.toString",
// InterpretISODateTimeOffset
"get options.relativeTo.timeZone.getPossibleInstantsFor",
"call options.relativeTo.timeZone.getPossibleInstantsFor",

View File

@ -11,18 +11,18 @@ features: [Temporal]
const expected = [
"get other.toString",
"call other.toString",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
"get options.largestUnit",
"get options.largestUnit.toString",
"call options.largestUnit.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.roundingIncrement",
"get options.roundingIncrement.valueOf",
"call options.roundingIncrement.valueOf",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
];
const actual = [];

View File

@ -17,10 +17,13 @@ features: [Temporal]
const instant = new Temporal.Instant(1_000_000_000_987_650_000n);
let string = instant.toString({ fractionalSecondDigits: 2.5 });
assert.sameValue(string, "2001-09-09T01:46:40.98Z", "fractionalSecondDigits 2.5 truncates to 2");
assert.sameValue(string, "2001-09-09T01:46:40.98Z", "fractionalSecondDigits 2.5 floors to 2");
string = instant.toString({ fractionalSecondDigits: 9.7 });
assert.sameValue(string, "2001-09-09T01:46:40.987650000Z", "fractionalSecondDigits 9.7 truncates to 9 and is not out of range");
assert.sameValue(string, "2001-09-09T01:46:40.987650000Z", "fractionalSecondDigits 9.7 floors to 9 and is not out of range");
string = instant.toString({ fractionalSecondDigits: -0.6 });
assert.sameValue(string, "2001-09-09T01:46:40Z", "fractionalSecondDigits -0.6 truncates to 0 and is not out of range");
assert.throws(
RangeError,
() => instant.toString({ fractionalSecondDigits: -0.6 }),
"fractionalSecondDigits -0.6 floors to -1 and is out of range"
);

View File

@ -9,14 +9,17 @@ features: [Temporal]
---*/
const expected = [
"get options.timeZone",
"has options.timeZone.timeZone",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
"get options.fractionalSecondDigits",
"get options.fractionalSecondDigits.toString",
"call options.fractionalSecondDigits.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
"get options.timeZone",
"has options.timeZone.timeZone",
"get options.timeZone.getOffsetNanosecondsFor",
"call options.timeZone.getOffsetNanosecondsFor",
"get options.timeZone.getOffsetNanosecondsFor",
@ -28,7 +31,7 @@ const instance = new Temporal.Instant(0n);
instance.toString(
TemporalHelpers.propertyBagObserver(actual, {
fractionalSecondDigits: 3,
fractionalSecondDigits: "auto",
roundingMode: "halfExpand",
smallestUnit: "millisecond",
timeZone: TemporalHelpers.timeZoneObserver(actual, "options.timeZone"),
@ -38,14 +41,14 @@ assert.compareArray(actual, expected, "order of operations");
actual.splice(0); // clear
const expectedForFractionalSecondDigits = [
"get options.timeZone",
"get options.smallestUnit",
"get options.fractionalSecondDigits",
"get options.fractionalSecondDigits.toString",
"call options.fractionalSecondDigits.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get options.timeZone",
];
instance.toString(

View File

@ -19,12 +19,12 @@ const tests = [
for (const [smallestUnit, expected] of tests) {
const string = instant.toString({
smallestUnit,
get fractionalSecondDigits() { throw new Test262Error("should not get fractionalSecondDigits") }
fractionalSecondDigits: 5,
});
assert.sameValue(string, expected, `smallestUnit: "${smallestUnit}" overrides fractionalSecondDigits`);
}
assert.throws(RangeError, () => instant.toString({
smallestUnit: "hour",
get fractionalSecondDigits() { throw new Test262Error("should not get fractionalSecondDigits") }
fractionalSecondDigits: 5,
}), "hour is an invalid smallestUnit but still overrides fractionalSecondDigits");

View File

@ -11,18 +11,18 @@ features: [Temporal]
const expected = [
"get other.toString",
"call other.toString",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
"get options.largestUnit",
"get options.largestUnit.toString",
"call options.largestUnit.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.roundingIncrement",
"get options.roundingIncrement.valueOf",
"call options.roundingIncrement.valueOf",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
];
const actual = [];

View File

@ -13,7 +13,7 @@ class CustomCalendar extends Temporal.Calendar {
super("iso8601");
}
dateFromFields(fields) {
assert.compareArray(Object.keys(fields), ["b", "a"]);
assert.compareArray(Object.keys(fields), ["a", "b"]);
return new Temporal.PlainDate(2020, 7, 4);
}
fields(fields) {
@ -30,6 +30,6 @@ const plainDate = Temporal.PlainDate.from(item);
TemporalHelpers.assertPlainDate(plainDate, 2020, 7, "M07", 4);
assert.compareArray(actual, [
"get item.calendar",
"get item.b",
"get item.a",
"get item.b",
]);

View File

@ -36,18 +36,18 @@ const expected = [
"get other.calendar.toString",
"call other.calendar.toString",
// GetDifferenceSettings
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
"get options.largestUnit",
"get options.largestUnit.toString",
"call options.largestUnit.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.roundingIncrement",
"get options.roundingIncrement.valueOf",
"call options.roundingIncrement.valueOf",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
// CopyDataProperties
"ownKeys options",
"getOwnPropertyDescriptor options.roundingIncrement",

View File

@ -36,18 +36,18 @@ const expected = [
"get other.calendar.toString",
"call other.calendar.toString",
// GetDifferenceSettings
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
"get options.largestUnit",
"get options.largestUnit.toString",
"call options.largestUnit.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.roundingIncrement",
"get options.roundingIncrement.valueOf",
"call options.roundingIncrement.valueOf",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
// CopyDataProperties
"ownKeys options",
"getOwnPropertyDescriptor options.roundingIncrement",

View File

@ -54,18 +54,18 @@ const expected = [
"get other.calendar.toString",
"call other.calendar.toString",
// GetDifferenceSettings
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
"get options.largestUnit",
"get options.largestUnit.toString",
"call options.largestUnit.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.roundingIncrement",
"get options.roundingIncrement.valueOf",
"call options.roundingIncrement.valueOf",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
// CopyDataProperties
"ownKeys options",
"getOwnPropertyDescriptor options.roundingIncrement",

View File

@ -17,10 +17,13 @@ features: [Temporal]
const datetime = new Temporal.PlainDateTime(2000, 5, 2, 12, 34, 56, 987, 650, 0);
let string = datetime.toString({ fractionalSecondDigits: 2.5 });
assert.sameValue(string, "2000-05-02T12:34:56.98", "fractionalSecondDigits 2.5 truncates to 2");
assert.sameValue(string, "2000-05-02T12:34:56.98", "fractionalSecondDigits 2.5 floors to 2");
string = datetime.toString({ fractionalSecondDigits: 9.7 });
assert.sameValue(string, "2000-05-02T12:34:56.987650000", "fractionalSecondDigits 9.7 truncates to 9 and is not out of range");
assert.sameValue(string, "2000-05-02T12:34:56.987650000", "fractionalSecondDigits 9.7 floors to 9 and is not out of range");
string = datetime.toString({ fractionalSecondDigits: -0.6 });
assert.sameValue(string, "2000-05-02T12:34:56", "fractionalSecondDigits -0.6 truncates to 0 and is not out of range");
assert.throws(
RangeError,
() => datetime.toString({ fractionalSecondDigits: -0.6 }),
"fractionalSecondDigits -0.6 floors to -1 and is out of range"
);

View File

@ -9,12 +9,18 @@ features: [Temporal]
---*/
const expected = [
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.calendarName",
"get options.calendarName.toString",
"call options.calendarName.toString",
"get options.fractionalSecondDigits",
"get options.fractionalSecondDigits.toString",
"call options.fractionalSecondDigits.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
"get this.calendar[Symbol.toPrimitive]",
"get this.calendar.toString",
"call this.calendar.toString",
@ -26,29 +32,33 @@ const instance = new Temporal.PlainDateTime(1990, 11, 3, 15, 54, 37, 123, 456, 7
// clear observable operations that occurred during the constructor call
actual.splice(0);
const expectedForSmallestUnit = [
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
].concat(expected);
instance.toString(
TemporalHelpers.propertyBagObserver(actual, {
fractionalSecondDigits: 3,
fractionalSecondDigits: "auto",
roundingMode: "halfExpand",
smallestUnit: "millisecond",
calendarName: "auto",
}, "options"),
);
assert.compareArray(actual, expectedForSmallestUnit, "order of operations");
assert.compareArray(actual, expected, "order of operations");
actual.splice(0); // clear
// Same as above but without options.smallestUnit.toString
const expectedForFractionalSecondDigits = [
"get options.smallestUnit",
"get options.calendarName",
"get options.calendarName.toString",
"call options.calendarName.toString",
"get options.fractionalSecondDigits",
"get options.fractionalSecondDigits.toString",
"call options.fractionalSecondDigits.toString",
].concat(expected);
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get this.calendar[Symbol.toPrimitive]",
"get this.calendar.toString",
"call this.calendar.toString",
];
instance.toString(
TemporalHelpers.propertyBagObserver(actual, {

View File

@ -19,12 +19,12 @@ const tests = [
for (const [smallestUnit, expected] of tests) {
const string = datetime.toString({
smallestUnit,
get fractionalSecondDigits() { throw new Test262Error("should not get fractionalSecondDigits") }
fractionalSecondDigits: 5,
});
assert.sameValue(string, expected, `smallestUnit: "${smallestUnit}" overrides fractionalSecondDigits`);
}
assert.throws(RangeError, () => datetime.toString({
smallestUnit: "hour",
get fractionalSecondDigits() { throw new Test262Error("should not get fractionalSecondDigits") }
fractionalSecondDigits: 5,
}), "hour is an invalid smallestUnit but still overrides fractionalSecondDigits");

View File

@ -54,18 +54,18 @@ const expected = [
"get other.calendar.toString",
"call other.calendar.toString",
// GetDifferenceSettings
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
"get options.largestUnit",
"get options.largestUnit.toString",
"call options.largestUnit.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.roundingIncrement",
"get options.roundingIncrement.valueOf",
"call options.roundingIncrement.valueOf",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
// CopyDataProperties
"ownKeys options",
"getOwnPropertyDescriptor options.roundingIncrement",

View File

@ -32,18 +32,18 @@ const expected = [
"get other.second.valueOf",
"call other.second.valueOf",
// GetDifferenceSettings
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
"get options.largestUnit",
"get options.largestUnit.toString",
"call options.largestUnit.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.roundingIncrement",
"get options.roundingIncrement.valueOf",
"call options.roundingIncrement.valueOf",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
];
const actual = [];

View File

@ -17,10 +17,13 @@ features: [Temporal]
const time = new Temporal.PlainTime(12, 34, 56, 987, 650, 0);
let string = time.toString({ fractionalSecondDigits: 2.5 });
assert.sameValue(string, "12:34:56.98", "fractionalSecondDigits 2.5 truncates to 2");
assert.sameValue(string, "12:34:56.98", "fractionalSecondDigits 2.5 floors to 2");
string = time.toString({ fractionalSecondDigits: 9.7 });
assert.sameValue(string, "12:34:56.987650000", "fractionalSecondDigits 9.7 truncates to 9 and is not out of range");
assert.sameValue(string, "12:34:56.987650000", "fractionalSecondDigits 9.7 floors to 9 and is not out of range");
string = time.toString({ fractionalSecondDigits: -0.6 });
assert.sameValue(string, "12:34:56", "fractionalSecondDigits -0.6 truncates to 0 and is not out of range");
assert.throws(
RangeError,
() => time.toString({ fractionalSecondDigits: -0.6 }),
"fractionalSecondDigits -0.6 floors to -1 and is out of range"
);

View File

@ -9,36 +9,32 @@ features: [Temporal]
---*/
const expected = [
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
];
const actual = [];
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
instance.toString(
TemporalHelpers.propertyBagObserver(actual, {
fractionalSecondDigits: 3,
roundingMode: "halfExpand",
smallestUnit: "millisecond",
}, "options"),
);
assert.compareArray(actual, expected, "order of operations");
actual.splice(0); // clear
const expectedForFractionalSecondDigits = [
"get options.smallestUnit",
"get options.fractionalSecondDigits",
"get options.fractionalSecondDigits.toString",
"call options.fractionalSecondDigits.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
];
const actual = [];
const instance = new Temporal.PlainTime(12, 34, 56, 987, 654, 321);
const expectedForSmallestUnit = expected.concat([
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
]);
instance.toString(
TemporalHelpers.propertyBagObserver(actual, {
fractionalSecondDigits: "auto",
roundingMode: "halfExpand",
smallestUnit: "millisecond",
}, "options"),
);
assert.compareArray(actual, expectedForSmallestUnit, "order of operations");
actual.splice(0); // clear
instance.toString(
TemporalHelpers.propertyBagObserver(actual, {
@ -47,4 +43,4 @@ instance.toString(
smallestUnit: undefined,
}, "options"),
);
assert.compareArray(actual, expectedForFractionalSecondDigits, "order of operations with smallestUnit undefined");
assert.compareArray(actual, expected, "order of operations with smallestUnit undefined");

View File

@ -19,12 +19,12 @@ const tests = [
for (const [smallestUnit, expected] of tests) {
const string = time.toString({
smallestUnit,
get fractionalSecondDigits() { throw new Test262Error("should not get fractionalSecondDigits") }
fractionalSecondDigits: 5,
});
assert.sameValue(string, expected, `smallestUnit: "${smallestUnit}" overrides fractionalSecondDigits`);
}
assert.throws(RangeError, () => time.toString({
smallestUnit: "hour",
get fractionalSecondDigits() { throw new Test262Error("should not get fractionalSecondDigits") }
fractionalSecondDigits: 5,
}), "hour is an invalid smallestUnit but still overrides fractionalSecondDigits");

View File

@ -32,18 +32,18 @@ const expected = [
"get other.second.valueOf",
"call other.second.valueOf",
// GetDifferenceSettings
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
"get options.largestUnit",
"get options.largestUnit.toString",
"call options.largestUnit.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.roundingIncrement",
"get options.roundingIncrement.valueOf",
"call options.roundingIncrement.valueOf",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
];
const actual = [];

View File

@ -33,18 +33,18 @@ const expected = [
"get other.calendar.toString",
"call other.calendar.toString",
// GetDifferenceSettings
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
"get options.largestUnit",
"get options.largestUnit.toString",
"call options.largestUnit.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.roundingIncrement",
"get options.roundingIncrement.valueOf",
"call options.roundingIncrement.valueOf",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
// CalendarFields / PrepareTemporalFields / CalendarDateFromFields
"get this.calendar.fields",
"call this.calendar.fields",

View File

@ -13,15 +13,15 @@ features: [Temporal]
---*/
const expected = [
"get day",
"get day.valueOf",
"call day.valueOf",
"get monthCode",
"get monthCode.toString",
"call monthCode.toString",
"get year",
"get year.valueOf",
"call year.valueOf",
"get day", // first receiver fields, then input fields
"get day.valueOf",
"call day.valueOf",
];
const calendar = TemporalHelpers.calendarMergeFieldsGetters();

View File

@ -33,18 +33,18 @@ const expected = [
"get other.calendar.toString",
"call other.calendar.toString",
// GetDifferenceSettings
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
"get options.largestUnit",
"get options.largestUnit.toString",
"call options.largestUnit.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.roundingIncrement",
"get options.roundingIncrement.valueOf",
"call options.roundingIncrement.valueOf",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
// CalendarFields / PrepareTemporalFields / CalendarDateFromFields
"get this.calendar.fields",
"call this.calendar.fields",

View File

@ -38,16 +38,16 @@ const expected = [
"get one.nanosecond",
"get one.nanosecond.valueOf",
"call one.nanosecond.valueOf",
"get one.second",
"get one.second.valueOf",
"call one.second.valueOf",
"get one.year",
"get one.year.valueOf",
"call one.year.valueOf",
"get one.timeZone",
"get one.offset",
"get one.offset.toString",
"call one.offset.toString",
"get one.second",
"get one.second.valueOf",
"call one.second.valueOf",
"get one.timeZone",
"get one.year",
"get one.year.valueOf",
"call one.year.valueOf",
"has one.timeZone.timeZone",
// InterpretTemporalDateTimeFields
"get one.calendar.dateFromFields",
@ -87,16 +87,16 @@ const expected = [
"get two.nanosecond",
"get two.nanosecond.valueOf",
"call two.nanosecond.valueOf",
"get two.second",
"get two.second.valueOf",
"call two.second.valueOf",
"get two.year",
"get two.year.valueOf",
"call two.year.valueOf",
"get two.timeZone",
"get two.offset",
"get two.offset.toString",
"call two.offset.toString",
"get two.second",
"get two.second.valueOf",
"call two.second.valueOf",
"get two.timeZone",
"get two.year",
"get two.year.valueOf",
"call two.year.valueOf",
"has two.timeZone.timeZone",
// InterpretTemporalDateTimeFields
"get two.calendar.dateFromFields",

View File

@ -38,18 +38,24 @@ const expected = [
"get item.nanosecond",
"get item.nanosecond.valueOf",
"call item.nanosecond.valueOf",
"get item.second",
"get item.second.valueOf",
"call item.second.valueOf",
"get item.year",
"get item.year.valueOf",
"call item.year.valueOf",
"get item.timeZone",
"get item.offset",
"get item.offset.toString",
"call item.offset.toString",
"get item.second",
"get item.second.valueOf",
"call item.second.valueOf",
"get item.timeZone",
"get item.year",
"get item.year.valueOf",
"call item.year.valueOf",
"has item.timeZone.timeZone",
// InterpretTemporalDateTimeFields
"get options.disambiguation",
"get options.disambiguation.toString",
"call options.disambiguation.toString",
"get options.offset",
"get options.offset.toString",
"call options.offset.toString",
"get options.overflow",
"get options.overflow.toString",
"call options.overflow.toString",
@ -59,14 +65,6 @@ const expected = [
"get options.overflow",
"get options.overflow.toString",
"call options.overflow.toString",
// ToTemporalDisambiguation
"get options.disambiguation",
"get options.disambiguation.toString",
"call options.disambiguation.toString",
// ToTemporalOffset
"get options.offset",
"get options.offset.toString",
"call options.offset.toString",
// InterpretISODateTimeOffset
"get item.timeZone.getPossibleInstantsFor",
"call item.timeZone.getPossibleInstantsFor",

View File

@ -38,16 +38,16 @@ const expected = [
"get other.nanosecond",
"get other.nanosecond.valueOf",
"call other.nanosecond.valueOf",
"get other.second",
"get other.second.valueOf",
"call other.second.valueOf",
"get other.year",
"get other.year.valueOf",
"call other.year.valueOf",
"get other.timeZone",
"get other.offset",
"get other.offset.toString",
"call other.offset.toString",
"get other.second",
"get other.second.valueOf",
"call other.second.valueOf",
"get other.timeZone",
"get other.year",
"get other.year.valueOf",
"call other.year.valueOf",
"has other.timeZone.timeZone",
// InterpretTemporalDateTimeFields
"get other.calendar.dateFromFields",

View File

@ -38,16 +38,16 @@ const expected = [
"get other.nanosecond",
"get other.nanosecond.valueOf",
"call other.nanosecond.valueOf",
"get other.second",
"get other.second.valueOf",
"call other.second.valueOf",
"get other.year",
"get other.year.valueOf",
"call other.year.valueOf",
"get other.timeZone",
"get other.offset",
"get other.offset.toString",
"call other.offset.toString",
"get other.second",
"get other.second.valueOf",
"call other.second.valueOf",
"get other.timeZone",
"get other.year",
"get other.year.valueOf",
"call other.year.valueOf",
"has other.timeZone.timeZone",
"get other.calendar.dateFromFields",
"call other.calendar.dateFromFields",
@ -63,18 +63,18 @@ const expected = [
"get other.calendar.toString",
"call other.calendar.toString",
// GetDifferenceSettings
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
"get options.largestUnit",
"get options.largestUnit.toString",
"call options.largestUnit.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.roundingIncrement",
"get options.roundingIncrement.valueOf",
"call options.roundingIncrement.valueOf",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
];
const actual = [];

View File

@ -17,10 +17,13 @@ features: [Temporal]
const datetime = new Temporal.ZonedDateTime(1_000_000_000_987_650_000n, "UTC");
let string = datetime.toString({ fractionalSecondDigits: 2.5 });
assert.sameValue(string, "2001-09-09T01:46:40.98+00:00[UTC]", "fractionalSecondDigits 2.5 truncates to 2");
assert.sameValue(string, "2001-09-09T01:46:40.98+00:00[UTC]", "fractionalSecondDigits 2.5 floors to 2");
string = datetime.toString({ fractionalSecondDigits: 9.7 });
assert.sameValue(string, "2001-09-09T01:46:40.987650000+00:00[UTC]", "fractionalSecondDigits 9.7 truncates to 9 and is not out of range");
assert.sameValue(string, "2001-09-09T01:46:40.987650000+00:00[UTC]", "fractionalSecondDigits 9.7 floors to 9 and is not out of range");
string = datetime.toString({ fractionalSecondDigits: -0.6 });
assert.sameValue(string, "2001-09-09T01:46:40+00:00[UTC]", "fractionalSecondDigits -0.6 truncates to 0 and is not out of range");
assert.throws(
RangeError,
() => datetime.toString({ fractionalSecondDigits: -0.6 }),
"fractionalSecondDigits -0.6 floors to -1 and is out of range"
);

View File

@ -9,18 +9,24 @@ features: [Temporal]
---*/
const expected = [
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.calendarName",
"get options.calendarName.toString",
"call options.calendarName.toString",
"get options.timeZoneName",
"get options.timeZoneName.toString",
"call options.timeZoneName.toString",
"get options.fractionalSecondDigits",
"get options.fractionalSecondDigits.toString",
"call options.fractionalSecondDigits.toString",
"get options.offset",
"get options.offset.toString",
"call options.offset.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
"get options.timeZoneName",
"get options.timeZoneName.toString",
"call options.timeZoneName.toString",
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getOffsetNanosecondsFor",
@ -40,15 +46,9 @@ const instance = new Temporal.ZonedDateTime(0n, timeZone, calendar);
// clear observable operations that occurred during the constructor call
actual.splice(0);
const expectedForSmallestUnit = [
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
].concat(expected);
instance.toString(
TemporalHelpers.propertyBagObserver(actual, {
fractionalSecondDigits: 3,
fractionalSecondDigits: "auto",
roundingMode: "halfExpand",
smallestUnit: "millisecond",
offset: "auto",
@ -56,15 +56,38 @@ instance.toString(
calendarName: "auto",
}, "options"),
);
assert.compareArray(actual, expectedForSmallestUnit, "order of operations");
assert.compareArray(actual, expected, "order of operations");
actual.splice(0); // clear
// Same as above but without accessing options.smallestUnit.toString
const expectedForFractionalSecondDigits = [
"get options.smallestUnit",
"get options.calendarName",
"get options.calendarName.toString",
"call options.calendarName.toString",
"get options.fractionalSecondDigits",
"get options.fractionalSecondDigits.toString",
"call options.fractionalSecondDigits.toString",
].concat(expected);
"get options.offset",
"get options.offset.toString",
"call options.offset.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get options.timeZoneName",
"get options.timeZoneName.toString",
"call options.timeZoneName.toString",
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone[Symbol.toPrimitive]",
"get this.timeZone.toString",
"call this.timeZone.toString",
"get this.calendar[Symbol.toPrimitive]",
"get this.calendar.toString",
"call this.calendar.toString",
];
instance.toString(
TemporalHelpers.propertyBagObserver(actual, {

View File

@ -19,12 +19,12 @@ const tests = [
for (const [smallestUnit, expected] of tests) {
const string = datetime.toString({
smallestUnit,
get fractionalSecondDigits() { throw new Test262Error("should not get fractionalSecondDigits") }
fractionalSecondDigits: 5,
});
assert.sameValue(string, expected, `smallestUnit: "${smallestUnit}" overrides fractionalSecondDigits`);
}
assert.throws(RangeError, () => datetime.toString({
smallestUnit: "hour",
get fractionalSecondDigits() { throw new Test262Error("should not get fractionalSecondDigits") }
fractionalSecondDigits: 5,
}), "hour is an invalid smallestUnit but still overrides fractionalSecondDigits");

View File

@ -38,16 +38,16 @@ const expected = [
"get other.nanosecond",
"get other.nanosecond.valueOf",
"call other.nanosecond.valueOf",
"get other.second",
"get other.second.valueOf",
"call other.second.valueOf",
"get other.year",
"get other.year.valueOf",
"call other.year.valueOf",
"get other.timeZone",
"get other.offset",
"get other.offset.toString",
"call other.offset.toString",
"get other.second",
"get other.second.valueOf",
"call other.second.valueOf",
"get other.timeZone",
"get other.year",
"get other.year.valueOf",
"call other.year.valueOf",
"has other.timeZone.timeZone",
"get other.calendar.dateFromFields",
"call other.calendar.dateFromFields",
@ -63,18 +63,18 @@ const expected = [
"get other.calendar.toString",
"call other.calendar.toString",
// GetDifferenceSettings
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
"get options.largestUnit",
"get options.largestUnit.toString",
"call options.largestUnit.toString",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.roundingIncrement",
"get options.roundingIncrement.valueOf",
"call options.roundingIncrement.valueOf",
"get options.roundingMode",
"get options.roundingMode.toString",
"call options.roundingMode.toString",
"get options.smallestUnit",
"get options.smallestUnit.toString",
"call options.smallestUnit.toString",
];
const actual = [];

View File

@ -40,16 +40,16 @@ const expected = [
"get nanosecond",
"get nanosecond.valueOf",
"call nanosecond.valueOf",
"get second",
"get second.valueOf",
"call second.valueOf",
"get year",
"get year.valueOf",
"call year.valueOf",
"get offset",
"get offset.toString",
"call offset.toString",
"get second",
"get second.valueOf",
"call second.valueOf",
"get timeZone",
"get year",
"get year.valueOf",
"call year.valueOf",
];
const calendar = TemporalHelpers.calendarMergeFieldsGetters();

View File

@ -39,22 +39,15 @@ const expected = [
"get fields.nanosecond",
"get fields.nanosecond.valueOf",
"call fields.nanosecond.valueOf",
"get fields.offset",
"get fields.offset.toString",
"call fields.offset.toString",
"get fields.second",
"get fields.second.valueOf",
"call fields.second.valueOf",
"get fields.year",
"get fields.year.valueOf",
"call fields.year.valueOf",
"get fields.offset",
"get fields.offset.toString",
"call fields.offset.toString",
// options
"get options.disambiguation",
"get options.disambiguation.toString",
"call options.disambiguation.toString",
"get options.offset",
"get options.offset.toString",
"call options.offset.toString",
// PrepareTemporalFields
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor",
@ -78,18 +71,24 @@ const expected = [
"call this.calendar.monthCode",
"get this.timeZone.getOffsetNanosecondsFor", // ZonedDateTime.p.nanosecond
"call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getOffsetNanosecondsFor", // ZonedDateTime.p.offset
"call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getOffsetNanosecondsFor", // ZonedDateTime.p.second
"call this.timeZone.getOffsetNanosecondsFor",
"get this.timeZone.getOffsetNanosecondsFor",
"call this.timeZone.getOffsetNanosecondsFor",
"get this.calendar.year",
"call this.calendar.year",
"get this.timeZone.getOffsetNanosecondsFor", // ZonedDateTime.p.offset
"call this.timeZone.getOffsetNanosecondsFor",
// CalendarMergeFields
"get this.calendar.mergeFields",
"call this.calendar.mergeFields",
// InterpretTemporalDateTimeFields
"get options.disambiguation",
"get options.disambiguation.toString",
"call options.disambiguation.toString",
"get options.offset",
"get options.offset.toString",
"call options.offset.toString",
"get options.overflow",
"get options.overflow.toString",
"call options.overflow.toString",