Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ assert.sameValue(explicit, "P1Y2M3W4DT5H6M7.98765S", "default precision is auto,

const implicit = duration.toString();
assert.sameValue(implicit, "P1Y2M3W4DT5H6M7.98765S", "default precision is auto, and rounding is trunc");

const lambda = duration.toString(() => {});
assert.sameValue(lambda, "P1Y2M3W4DT5H6M7.98765S", "default precision is auto, and rounding is trunc");
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ const explicit = later.since(earlier, { largestUnit: undefined });
TemporalHelpers.assertDuration(explicit, 0, 0, 0, 0, 0, 0, 90061, 987, 654, 321, "default largestUnit is second");
const implicit = later.since(earlier, {});
TemporalHelpers.assertDuration(implicit, 0, 0, 0, 0, 0, 0, 90061, 987, 654, 321, "default largestUnit is second");
const lambda = later.since(earlier, () => {});
TemporalHelpers.assertDuration(lambda, 0, 0, 0, 0, 0, 0, 90061, 987, 654, 321, "default largestUnit is second");
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,13 @@ assert.sameValue(implicit.hours, 0, "default largest unit is seconds");
assert.sameValue(implicit.minutes, 0, "default largest unit is seconds");
assert.sameValue(implicit.seconds, 2678400, "default largest unit is seconds");
assert.sameValue(implicit.nanoseconds, 1, "default smallest unit is nanoseconds and no rounding");

const lambda = later.since(earlier, () => {});
assert.sameValue(lambda.years, 0, "default largest unit is seconds");
assert.sameValue(lambda.months, 0, "default largest unit is seconds");
assert.sameValue(lambda.weeks, 0, "default largest unit is seconds");
assert.sameValue(lambda.days, 0, "default largest unit is seconds");
assert.sameValue(lambda.hours, 0, "default largest unit is seconds");
assert.sameValue(lambda.minutes, 0, "default largest unit is seconds");
assert.sameValue(lambda.seconds, 2678400, "default largest unit is seconds");
assert.sameValue(lambda.nanoseconds, 1, "default smallest unit is nanoseconds and no rounding");
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ TemporalHelpers.assertDuration(explicit, 0, 0, 0, 0, 0, 0, 90061, 1, 1, 1, "defa

const implicit = later.since(earlier, {});
TemporalHelpers.assertDuration(implicit, 0, 0, 0, 0, 0, 0, 90061, 1, 1, 1, "default roundingIncrement is 1");

const lambda = later.since(earlier, () => {});
TemporalHelpers.assertDuration(lambda, 0, 0, 0, 0, 0, 0, 90061, 1, 1, 1, "default roundingIncrement is 1");
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ const explicit = later.since(earlier, { smallestUnit: undefined });
TemporalHelpers.assertDuration(explicit, 0, 0, 0, 0, 0, 0, 90061, 987, 654, 321, "default smallestUnit is nanosecond");
const implicit = later.since(earlier, {});
TemporalHelpers.assertDuration(implicit, 0, 0, 0, 0, 0, 0, 90061, 987, 654, 321, "default smallestUnit is nanosecond");
const lambda = later.since(earlier, () => {});
TemporalHelpers.assertDuration(lambda, 0, 0, 0, 0, 0, 0, 90061, 987, 654, 321, "default smallestUnit is nanosecond");
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,9 @@ assert.sameValue(
"1975-02-02T14:25:36.12345Z",
"default time zone is none, precision is auto, and rounding is trunc"
);

assert.sameValue(
instant.toString(() => {}),
"1975-02-02T14:25:36.12345Z",
"default time zone is none, precision is auto, and rounding is trunc"
);
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ const explicit = earlier.until(later, { largestUnit: undefined });
TemporalHelpers.assertDuration(explicit, 0, 0, 0, 0, 0, 0, 90061, 987, 654, 321, "default largestUnit is second");
const implicit = earlier.until(later, {});
TemporalHelpers.assertDuration(implicit, 0, 0, 0, 0, 0, 0, 90061, 987, 654, 321, "default largestUnit is second");
const lambda = earlier.until(later, () => {});
TemporalHelpers.assertDuration(lambda, 0, 0, 0, 0, 0, 0, 90061, 987, 654, 321, "default largestUnit is second");
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,13 @@ assert.sameValue(implicit.hours, 0, "default largest unit is seconds");
assert.sameValue(implicit.minutes, 0, "default largest unit is seconds");
assert.sameValue(implicit.seconds, 2678400, "default largest unit is seconds");
assert.sameValue(implicit.nanoseconds, 1, "default smallest unit is nanoseconds and no rounding");

const lambda = earlier.until(later, () => {});
assert.sameValue(lambda.years, 0, "default largest unit is seconds");
assert.sameValue(lambda.months, 0, "default largest unit is seconds");
assert.sameValue(lambda.weeks, 0, "default largest unit is seconds");
assert.sameValue(lambda.days, 0, "default largest unit is seconds");
assert.sameValue(lambda.hours, 0, "default largest unit is seconds");
assert.sameValue(lambda.minutes, 0, "default largest unit is seconds");
assert.sameValue(lambda.seconds, 2678400, "default largest unit is seconds");
assert.sameValue(lambda.nanoseconds, 1, "default smallest unit is nanoseconds and no rounding");
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ TemporalHelpers.assertDuration(explicit, 0, 0, 0, 0, 0, 0, 90061, 1, 1, 1, "defa

const implicit = earlier.until(later, {});
TemporalHelpers.assertDuration(implicit, 0, 0, 0, 0, 0, 0, 90061, 1, 1, 1, "default roundingIncrement is 1");

const lambda = earlier.until(later, () => {});
TemporalHelpers.assertDuration(lambda, 0, 0, 0, 0, 0, 0, 90061, 1, 1, 1, "default roundingIncrement is 1");
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ const explicit = earlier.until(later, { smallestUnit: undefined });
TemporalHelpers.assertDuration(explicit, 0, 0, 0, 0, 0, 0, 90061, 987, 654, 321, "default smallestUnit is nanosecond");
const implicit = earlier.until(later, {});
TemporalHelpers.assertDuration(implicit, 0, 0, 0, 0, 0, 0, 90061, 987, 654, 321, "default smallestUnit is nanosecond");
const lambda = earlier.until(later, () => {});
TemporalHelpers.assertDuration(lambda, 0, 0, 0, 0, 0, 0, 90061, 987, 654, 321, "default smallestUnit is nanosecond");
3 changes: 3 additions & 0 deletions test/built-ins/Temporal/PlainDate/from/options-undefined.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ assert.sameValue(implicit.month, 12, "default overflow is constrain");

const implicitEmpty = Temporal.PlainDate.from(fields, {});
assert.sameValue(implicitEmpty.month, 12, "default overflow is constrain");

const lambda = Temporal.PlainDate.from(fields, () => {});
assert.sameValue(lambda.month, 12, "default overflow is constrain");
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ assert.sameValue(explicit.day, 29, "default overflow is constrain");
const implicit = date.add(duration);
assert.sameValue(implicit.month, 2, "default overflow is constrain");
assert.sameValue(implicit.day, 29, "default overflow is constrain");

const lambda = date.add(duration, () => {});
assert.sameValue(lambda.month, 2, "default overflow is constrain");
assert.sameValue(lambda.day, 29, "default overflow is constrain");
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ const explicit = later.since(earlier, { largestUnit: undefined });
TemporalHelpers.assertDuration(explicit, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, "default largestUnit is day");
const implicit = later.since(earlier, {});
TemporalHelpers.assertDuration(implicit, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, "default largestUnit is day");
const lambda = later.since(earlier, () => {});
TemporalHelpers.assertDuration(lambda, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, "default largestUnit is day");
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ const later = new Temporal.PlainDate(2000, 5, 7);
const explicit = later.since(earlier, { roundingIncrement: undefined });
TemporalHelpers.assertDuration(explicit, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, "default roundingIncrement is 1");

// See options-undefined.js for {}
// See options-object.js for {} and () => {}
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ const explicit = later.since(earlier, { smallestUnit: undefined });
TemporalHelpers.assertDuration(explicit, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, "default smallestUnit is day");
const implicit = later.since(earlier, {});
TemporalHelpers.assertDuration(implicit, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, "default smallestUnit is day");
const lambda = later.since(earlier, () => {});
TemporalHelpers.assertDuration(lambda, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, "default smallestUnit is day");
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ assert.sameValue(explicit.day, 29, "default overflow is constrain");
const implicit = date.subtract(duration);
assert.sameValue(implicit.month, 2, "default overflow is constrain");
assert.sameValue(implicit.day, 29, "default overflow is constrain");

const lambda = date.subtract(duration, () => {});
assert.sameValue(lambda.month, 2, "default overflow is constrain");
assert.sameValue(lambda.day, 29, "default overflow is constrain");
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ const explicit = date.subtract(duration, { overflow: undefined });
TemporalHelpers.assertPlainDate(explicit, 1997, 4, "M04", 30, "default overflow is constrain");
const implicit = date.subtract(duration, {});
TemporalHelpers.assertPlainDate(implicit, 1997, 4, "M04", 30, "default overflow is constrain");
const lambda = date.subtract(duration, {});
const lambda = date.subtract(duration, () => {});
TemporalHelpers.assertPlainDate(lambda, 1997, 4, "M04", 30, "default overflow is constrain");
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ features: [Temporal]
const date = new Temporal.PlainDate(2000, 5, 2);
const result = date.toString({ calendarName: undefined });
assert.sameValue(result, "2000-05-02", `default calendarName option is auto with built-in ISO calendar`);
// See options-object.js for {} and options-undefined.js for absent options arg
// See options-object.js for {} and () => {}
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ const explicit = earlier.until(later, { largestUnit: undefined });
TemporalHelpers.assertDuration(explicit, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, "default largestUnit is day");
const implicit = earlier.until(later, {});
TemporalHelpers.assertDuration(implicit, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, "default largestUnit is day");
const lambda = earlier.until(later, () => {});
TemporalHelpers.assertDuration(lambda, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, "default largestUnit is day");
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ const later = new Temporal.PlainDate(2000, 5, 7);
const explicit = earlier.until(later, { roundingIncrement: undefined });
TemporalHelpers.assertDuration(explicit, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, "default roundingIncrement is 1");

// See options-undefined.js for {}
// See options-object.js for {} and () => {}
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ const explicit = earlier.until(later, { smallestUnit: undefined });
TemporalHelpers.assertDuration(explicit, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, "default smallestUnit is day");
const implicit = earlier.until(later, {});
TemporalHelpers.assertDuration(implicit, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, "default smallestUnit is day");
const lambda = earlier.until(later, () => {});
TemporalHelpers.assertDuration(lambda, 0, 0, 0, 397, 0, 0, 0, 0, 0, 0, "default smallestUnit is day");
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ assert.sameValue(explicit.day, 29, "default overflow is constrain");
const implicit = date.with(fields);
assert.sameValue(implicit.month, 2, "default overflow is constrain");
assert.sameValue(implicit.day, 29, "default overflow is constrain");

const lambda = date.with(fields, () => {});
assert.sameValue(lambda.month, 2, "default overflow is constrain");
assert.sameValue(lambda.day, 29, "default overflow is constrain");
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ assert.sameValue(explicit.month, 12, "default overflow is constrain");

const implicit = Temporal.PlainDateTime.from(fields);
assert.sameValue(implicit.month, 12, "default overflow is constrain");

const lambda = Temporal.PlainDateTime.from(fields, () => {});
assert.sameValue(lambda.month, 12, "default overflow is constrain");
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,14 @@ validValues.forEach((value) => {
TemporalHelpers.assertPlainDateTime(explicit, 2000, 5, "M05", 2, 12, 0, 0, 0, 0, 0, "overflow is ignored");
const implicit = Temporal.PlainDateTime.from(value, {});
TemporalHelpers.assertPlainDateTime(implicit, 2000, 5, "M05", 2, 12, 0, 0, 0, 0, 0, "overflow is ignored");
const lambda = Temporal.PlainDateTime.from(value, () => {});
TemporalHelpers.assertPlainDateTime(lambda, 2000, 5, "M05", 2, 12, 0, 0, 0, 0, 0, "overflow is ignored");
});

const propertyBag = { year: 2000, month: 13, day: 34, hour: 12 };
const explicit = Temporal.PlainDateTime.from(propertyBag, { overflow: undefined });
TemporalHelpers.assertPlainDateTime(explicit, 2000, 12, "M12", 31, 12, 0, 0, 0, 0, 0, "default overflow is constrain");
const implicit = Temporal.PlainDateTime.from(propertyBag, {});
TemporalHelpers.assertPlainDateTime(implicit, 2000, 12, "M12", 31, 12, 0, 0, 0, 0, 0, "default overflow is constrain");
const lambda = Temporal.PlainDateTime.from(propertyBag, () => {});
TemporalHelpers.assertPlainDateTime(lambda, 2000, 12, "M12", 31, 12, 0, 0, 0, 0, 0, "default overflow is constrain");
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ assert.sameValue(explicit.day, 29, "default overflow is constrain");
const implicit = datetime.add(duration);
assert.sameValue(implicit.month, 2, "default overflow is constrain");
assert.sameValue(implicit.day, 29, "default overflow is constrain");

const lambda = datetime.add(duration, () => {});
assert.sameValue(lambda.month, 2, "default overflow is constrain");
assert.sameValue(lambda.day, 29, "default overflow is constrain");
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ const explicit = datetime.add(duration, { overflow: undefined });
TemporalHelpers.assertPlainDateTime(explicit, 2003, 6, "M06", 30, 12, 0, 0, 0, 0, 0, "default overflow is constrain");
const implicit = datetime.add(duration, {});
TemporalHelpers.assertPlainDateTime(implicit, 2003, 6, "M06", 30, 12, 0, 0, 0, 0, 0, "default overflow is constrain");
const lambda = datetime.add(duration, () => {});
TemporalHelpers.assertPlainDateTime(lambda, 2003, 6, "M06", 30, 12, 0, 0, 0, 0, 0, "default overflow is constrain");
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ const explicit = later.since(earlier, { largestUnit: undefined });
TemporalHelpers.assertDuration(explicit, 0, 0, 0, 397, 1, 1, 1, 987, 654, 321, "default largestUnit is day");
const implicit = later.since(earlier, {});
TemporalHelpers.assertDuration(implicit, 0, 0, 0, 397, 1, 1, 1, 987, 654, 321, "default largestUnit is day");
const lambda = later.since(earlier, () => {});
TemporalHelpers.assertDuration(lambda, 0, 0, 0, 397, 1, 1, 1, 987, 654, 321, "default largestUnit is day");
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ assert.sameValue(implicit.months, 0, "default largest unit is days");
assert.sameValue(implicit.weeks, 0, "default largest unit is days");
assert.sameValue(implicit.days, 41, "default largest unit is days");
assert.sameValue(implicit.nanoseconds, 1, "default smallest unit is nanoseconds and no rounding");

const lambda = later.since(earlier, () => {});
assert.sameValue(lambda.years, 0, "default largest unit is days");
assert.sameValue(lambda.months, 0, "default largest unit is days");
assert.sameValue(lambda.weeks, 0, "default largest unit is days");
assert.sameValue(lambda.days, 41, "default largest unit is days");
assert.sameValue(lambda.nanoseconds, 1, "default smallest unit is nanoseconds and no rounding");
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ TemporalHelpers.assertDuration(explicit, 0, 0, 0, 397, 1, 1, 1, 1, 1, 1, "defaul

const implicit = later.since(earlier, {});
TemporalHelpers.assertDuration(implicit, 0, 0, 0, 397, 1, 1, 1, 1, 1, 1, "default roundingIncrement is 1");

const lambda = later.since(earlier, () => {});
TemporalHelpers.assertDuration(lambda, 0, 0, 0, 397, 1, 1, 1, 1, 1, 1, "default roundingIncrement is 1");
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ const explicit = later.since(earlier, { smallestUnit: undefined });
TemporalHelpers.assertDuration(explicit, 0, 0, 0, 1, 1, 1, 1, 987, 654, 321, "default smallestUnit is nanosecond");
const implicit = later.since(earlier, {});
TemporalHelpers.assertDuration(implicit, 0, 0, 0, 1, 1, 1, 1, 987, 654, 321, "default smallestUnit is nanosecond");
const lambda = later.since(earlier, () => {});
TemporalHelpers.assertDuration(lambda, 0, 0, 0, 1, 1, 1, 1, 987, 654, 321, "default smallestUnit is nanosecond");
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ assert.sameValue(explicit.day, 29, "default overflow is constrain");
const implicit = datetime.subtract(duration);
assert.sameValue(implicit.month, 2, "default overflow is constrain");
assert.sameValue(implicit.day, 29, "default overflow is constrain");

const lambda = datetime.subtract(duration, () => {});
assert.sameValue(lambda.month, 2, "default overflow is constrain");
assert.sameValue(lambda.day, 29, "default overflow is constrain");
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ const explicit = datetime.subtract(duration, { overflow: undefined });
TemporalHelpers.assertPlainDateTime(explicit, 1997, 4, "M04", 30, 12, 0, 0, 0, 0, 0, "default overflow is constrain");
const implicit = datetime.subtract(duration, {});
TemporalHelpers.assertPlainDateTime(implicit, 1997, 4, "M04", 30, 12, 0, 0, 0, 0, 0, "default overflow is constrain");
const lambda = datetime.subtract(duration, () => {});
TemporalHelpers.assertPlainDateTime(lambda, 1997, 4, "M04", 30, 12, 0, 0, 0, 0, 0, "default overflow is constrain");
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ features: [Temporal]
const datetime = new Temporal.PlainDateTime(1976, 11, 18, 15, 23, 0, 0, 0, 0);
const result = datetime.toString({ calendarName: undefined });
assert.sameValue(result, "1976-11-18T15:23:00", `default calendarName option is auto with built-in ISO calendar`);
// See options-object.js for {} and options-undefined.js for absent options arg
// See options-object.js for {} and () => {}
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ const explicit = earlier.until(later, { largestUnit: undefined });
TemporalHelpers.assertDuration(explicit, 0, 0, 0, 397, 1, 1, 1, 987, 654, 321, "default largestUnit is day");
const implicit = earlier.until(later, {});
TemporalHelpers.assertDuration(implicit, 0, 0, 0, 397, 1, 1, 1, 987, 654, 321, "default largestUnit is day");
const lambda = earlier.until(later, () => {});
TemporalHelpers.assertDuration(lambda, 0, 0, 0, 397, 1, 1, 1, 987, 654, 321, "default largestUnit is day");
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ assert.sameValue(implicit.months, 0, "default largest unit is days");
assert.sameValue(implicit.weeks, 0, "default largest unit is days");
assert.sameValue(implicit.days, 41, "default largest unit is days");
assert.sameValue(implicit.nanoseconds, 1, "default smallest unit is nanoseconds and no rounding");

const lambda = earlier.until(later, () => {});
assert.sameValue(lambda.years, 0, "default largest unit is days");
assert.sameValue(lambda.months, 0, "default largest unit is days");
assert.sameValue(lambda.weeks, 0, "default largest unit is days");
assert.sameValue(lambda.days, 41, "default largest unit is days");
assert.sameValue(lambda.nanoseconds, 1, "default smallest unit is nanoseconds and no rounding");
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ TemporalHelpers.assertDuration(explicit, 0, 0, 0, 397, 1, 1, 1, 1, 1, 1, "defaul

const implicit = earlier.until(later, {});
TemporalHelpers.assertDuration(implicit, 0, 0, 0, 397, 1, 1, 1, 1, 1, 1, "default roundingIncrement is 1");

const lambda = earlier.until(later, () => {});
TemporalHelpers.assertDuration(lambda, 0, 0, 0, 397, 1, 1, 1, 1, 1, 1, "default roundingIncrement is 1");
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ const explicit = earlier.until(later, { smallestUnit: undefined });
TemporalHelpers.assertDuration(explicit, 0, 0, 0, 1, 1, 1, 1, 987, 654, 321, "default smallestUnit is nanosecond");
const implicit = earlier.until(later, {});
TemporalHelpers.assertDuration(implicit, 0, 0, 0, 1, 1, 1, 1, 987, 654, 321, "default smallestUnit is nanosecond");
const lambda = earlier.until(later, () => {});
TemporalHelpers.assertDuration(lambda, 0, 0, 0, 1, 1, 1, 1, 987, 654, 321, "default smallestUnit is nanosecond");
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ TemporalHelpers.assertPlainDateTime(plainDateTime.with({ day: 8, hour: 10, year:
2006, 1, "M01", 8, 10, 42, 58, 0, 0, 0,
"only the properties that are present and defined in the plain object are copied"
);
// See options-empty.js for {} and () => {}
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ assert.sameValue(explicit.day, 29, "default overflow is constrain");
const implicit = datetime.with(fields);
assert.sameValue(implicit.month, 2, "default overflow is constrain");
assert.sameValue(implicit.day, 29, "default overflow is constrain");

const lambda = datetime.with(fields, () => {});
assert.sameValue(lambda.month, 2, "default overflow is constrain");
assert.sameValue(lambda.day, 29, "default overflow is constrain");
Loading
Loading