diff --git a/test/built-ins/Temporal/Duration/prototype/toString/options-undefined.js b/test/built-ins/Temporal/Duration/prototype/toString/options-undefined.js index c0d7bbfc7f1..2938964b58b 100644 --- a/test/built-ins/Temporal/Duration/prototype/toString/options-undefined.js +++ b/test/built-ins/Temporal/Duration/prototype/toString/options-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/since/largestunit-undefined.js b/test/built-ins/Temporal/Instant/prototype/since/largestunit-undefined.js index 71dfed57102..fbb51d8b684 100644 --- a/test/built-ins/Temporal/Instant/prototype/since/largestunit-undefined.js +++ b/test/built-ins/Temporal/Instant/prototype/since/largestunit-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/since/options-undefined.js b/test/built-ins/Temporal/Instant/prototype/since/options-undefined.js index d631ec2214e..f2a2c7b0eee 100644 --- a/test/built-ins/Temporal/Instant/prototype/since/options-undefined.js +++ b/test/built-ins/Temporal/Instant/prototype/since/options-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/since/roundingincrement-undefined.js b/test/built-ins/Temporal/Instant/prototype/since/roundingincrement-undefined.js index 7292eb9f649..acdfc472cc2 100644 --- a/test/built-ins/Temporal/Instant/prototype/since/roundingincrement-undefined.js +++ b/test/built-ins/Temporal/Instant/prototype/since/roundingincrement-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/since/smallestunit-undefined.js b/test/built-ins/Temporal/Instant/prototype/since/smallestunit-undefined.js index 2193dbd54ab..7835398dcbd 100644 --- a/test/built-ins/Temporal/Instant/prototype/since/smallestunit-undefined.js +++ b/test/built-ins/Temporal/Instant/prototype/since/smallestunit-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/toString/options-undefined.js b/test/built-ins/Temporal/Instant/prototype/toString/options-undefined.js index 9e225f32cbd..94221494d77 100644 --- a/test/built-ins/Temporal/Instant/prototype/toString/options-undefined.js +++ b/test/built-ins/Temporal/Instant/prototype/toString/options-undefined.js @@ -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" +); diff --git a/test/built-ins/Temporal/Instant/prototype/until/largestunit-undefined.js b/test/built-ins/Temporal/Instant/prototype/until/largestunit-undefined.js index b769ac2e814..8a2e6391425 100644 --- a/test/built-ins/Temporal/Instant/prototype/until/largestunit-undefined.js +++ b/test/built-ins/Temporal/Instant/prototype/until/largestunit-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/until/options-undefined.js b/test/built-ins/Temporal/Instant/prototype/until/options-undefined.js index c5f1469de21..6342cc60ed9 100644 --- a/test/built-ins/Temporal/Instant/prototype/until/options-undefined.js +++ b/test/built-ins/Temporal/Instant/prototype/until/options-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/until/roundingincrement-undefined.js b/test/built-ins/Temporal/Instant/prototype/until/roundingincrement-undefined.js index 447dc903028..ba37ed67e03 100644 --- a/test/built-ins/Temporal/Instant/prototype/until/roundingincrement-undefined.js +++ b/test/built-ins/Temporal/Instant/prototype/until/roundingincrement-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/Instant/prototype/until/smallestunit-undefined.js b/test/built-ins/Temporal/Instant/prototype/until/smallestunit-undefined.js index 2a8586f10e7..808081cc0be 100644 --- a/test/built-ins/Temporal/Instant/prototype/until/smallestunit-undefined.js +++ b/test/built-ins/Temporal/Instant/prototype/until/smallestunit-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/from/options-undefined.js b/test/built-ins/Temporal/PlainDate/from/options-undefined.js index cb7b138ad39..48dc2f5a36e 100644 --- a/test/built-ins/Temporal/PlainDate/from/options-undefined.js +++ b/test/built-ins/Temporal/PlainDate/from/options-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/add/options-undefined.js b/test/built-ins/Temporal/PlainDate/prototype/add/options-undefined.js index df27f6e5af9..17b7df2b535 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/add/options-undefined.js +++ b/test/built-ins/Temporal/PlainDate/prototype/add/options-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/since/largestunit-undefined.js b/test/built-ins/Temporal/PlainDate/prototype/since/largestunit-undefined.js index 2db29287050..5f31f23e423 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/since/largestunit-undefined.js +++ b/test/built-ins/Temporal/PlainDate/prototype/since/largestunit-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/since/roundingincrement-undefined.js b/test/built-ins/Temporal/PlainDate/prototype/since/roundingincrement-undefined.js index 50bdfeb4832..4acdaad9649 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/since/roundingincrement-undefined.js +++ b/test/built-ins/Temporal/PlainDate/prototype/since/roundingincrement-undefined.js @@ -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 () => {} diff --git a/test/built-ins/Temporal/PlainDate/prototype/since/smallestunit-undefined.js b/test/built-ins/Temporal/PlainDate/prototype/since/smallestunit-undefined.js index 3a37e058533..3601bed7ddc 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/since/smallestunit-undefined.js +++ b/test/built-ins/Temporal/PlainDate/prototype/since/smallestunit-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/subtract/options-undefined.js b/test/built-ins/Temporal/PlainDate/prototype/subtract/options-undefined.js index baf542fddd3..6b302e94945 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/subtract/options-undefined.js +++ b/test/built-ins/Temporal/PlainDate/prototype/subtract/options-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/subtract/overflow-undefined.js b/test/built-ins/Temporal/PlainDate/prototype/subtract/overflow-undefined.js index 4f03e13bc00..d3cae72f4bc 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/subtract/overflow-undefined.js +++ b/test/built-ins/Temporal/PlainDate/prototype/subtract/overflow-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/toString/calendarname-undefined.js b/test/built-ins/Temporal/PlainDate/prototype/toString/calendarname-undefined.js index e1c5052a01e..b6031048d86 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/toString/calendarname-undefined.js +++ b/test/built-ins/Temporal/PlainDate/prototype/toString/calendarname-undefined.js @@ -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 () => {} diff --git a/test/built-ins/Temporal/PlainDate/prototype/until/largestunit-undefined.js b/test/built-ins/Temporal/PlainDate/prototype/until/largestunit-undefined.js index dd6acd17dfe..690b0508e43 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/until/largestunit-undefined.js +++ b/test/built-ins/Temporal/PlainDate/prototype/until/largestunit-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/until/roundingincrement-undefined.js b/test/built-ins/Temporal/PlainDate/prototype/until/roundingincrement-undefined.js index 51b05721923..cbfe776f004 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/until/roundingincrement-undefined.js +++ b/test/built-ins/Temporal/PlainDate/prototype/until/roundingincrement-undefined.js @@ -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 () => {} diff --git a/test/built-ins/Temporal/PlainDate/prototype/until/smallestunit-undefined.js b/test/built-ins/Temporal/PlainDate/prototype/until/smallestunit-undefined.js index 3e52556ca59..079be1d5bb0 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/until/smallestunit-undefined.js +++ b/test/built-ins/Temporal/PlainDate/prototype/until/smallestunit-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDate/prototype/with/options-undefined.js b/test/built-ins/Temporal/PlainDate/prototype/with/options-undefined.js index 9c2b40bcd38..8128b20e6a8 100644 --- a/test/built-ins/Temporal/PlainDate/prototype/with/options-undefined.js +++ b/test/built-ins/Temporal/PlainDate/prototype/with/options-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/from/options-undefined.js b/test/built-ins/Temporal/PlainDateTime/from/options-undefined.js index f3ee167090a..dfe6378e813 100644 --- a/test/built-ins/Temporal/PlainDateTime/from/options-undefined.js +++ b/test/built-ins/Temporal/PlainDateTime/from/options-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/from/overflow-undefined.js b/test/built-ins/Temporal/PlainDateTime/from/overflow-undefined.js index d26c5c96ceb..9065ec04669 100644 --- a/test/built-ins/Temporal/PlainDateTime/from/overflow-undefined.js +++ b/test/built-ins/Temporal/PlainDateTime/from/overflow-undefined.js @@ -36,6 +36,8 @@ 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 }; @@ -43,3 +45,5 @@ 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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/add/options-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/add/options-undefined.js index 3c1795c636a..df9e3a0fca9 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/add/options-undefined.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/add/options-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/add/overflow-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/add/overflow-undefined.js index 752304f435b..acd027796b1 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/add/overflow-undefined.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/add/overflow-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/since/largestunit-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/since/largestunit-undefined.js index db8b37c1cc7..e7003a58e8e 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/since/largestunit-undefined.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/since/largestunit-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/since/options-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/since/options-undefined.js index 9eb9db1ae2e..05f4b7c619d 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/since/options-undefined.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/since/options-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/since/roundingincrement-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/since/roundingincrement-undefined.js index a11d4730000..66c42cbcd58 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/since/roundingincrement-undefined.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/since/roundingincrement-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/since/smallestunit-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/since/smallestunit-undefined.js index 8d0b34f9635..f2d5679b9a8 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/since/smallestunit-undefined.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/since/smallestunit-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/subtract/options-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/subtract/options-undefined.js index 04dd700532a..53f10be51e8 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/subtract/options-undefined.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/subtract/options-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/subtract/overflow-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/subtract/overflow-undefined.js index ccdce7624bd..39121cdb38e 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/subtract/overflow-undefined.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/subtract/overflow-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/toString/calendarname-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/toString/calendarname-undefined.js index 9687ce048be..4d6a9ed1b4b 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/toString/calendarname-undefined.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/toString/calendarname-undefined.js @@ -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 () => {} diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/until/largestunit-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/until/largestunit-undefined.js index 32b872dc31e..9972d38f5cf 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/until/largestunit-undefined.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/until/largestunit-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/until/options-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/until/options-undefined.js index b3cd4d74035..6b9ef9c18a4 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/until/options-undefined.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/until/options-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/until/roundingincrement-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/until/roundingincrement-undefined.js index d9cf9cccf1b..aa87fb3e060 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/until/roundingincrement-undefined.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/until/roundingincrement-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/until/smallestunit-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/until/smallestunit-undefined.js index b707e016083..16e64ba6f4f 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/until/smallestunit-undefined.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/until/smallestunit-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/with/copy-properties-not-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/with/copy-properties-not-undefined.js index 7a86dcd6266..ed6248994e7 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/with/copy-properties-not-undefined.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/with/copy-properties-not-undefined.js @@ -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 () => {} diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/with/options-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/with/options-undefined.js index 62f6ec1b1b2..9ab7c8d0352 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/with/options-undefined.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/with/options-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/PlainDateTime/prototype/with/overflow-undefined.js b/test/built-ins/Temporal/PlainDateTime/prototype/with/overflow-undefined.js index 2602bbb1db6..a1b3470d9da 100644 --- a/test/built-ins/Temporal/PlainDateTime/prototype/with/overflow-undefined.js +++ b/test/built-ins/Temporal/PlainDateTime/prototype/with/overflow-undefined.js @@ -23,3 +23,5 @@ const explicit = datetime.with({ minute: 67 }, { overflow: undefined }); TemporalHelpers.assertPlainDateTime(explicit, 2000, 5, "M05", 2, 12, 59, 0, 0, 0, 0, "default overflow is constrain"); const implicit = datetime.with({ minute: 67 }, {}); TemporalHelpers.assertPlainDateTime(implicit, 2000, 5, "M05", 2, 12, 59, 0, 0, 0, 0, "default overflow is constrain"); +const lambda = datetime.with({ minute: 67 }, () => {}); +TemporalHelpers.assertPlainDateTime(lambda, 2000, 5, "M05", 2, 12, 59, 0, 0, 0, 0, "default overflow is constrain"); diff --git a/test/built-ins/Temporal/PlainMonthDay/from/options-undefined.js b/test/built-ins/Temporal/PlainMonthDay/from/options-undefined.js index 61a73e506da..9f91eeb6ff8 100644 --- a/test/built-ins/Temporal/PlainMonthDay/from/options-undefined.js +++ b/test/built-ins/Temporal/PlainMonthDay/from/options-undefined.js @@ -15,3 +15,6 @@ TemporalHelpers.assertPlainMonthDay(explicit, "M02", 29, "default overflow is co const implicit = Temporal.PlainMonthDay.from(fields); TemporalHelpers.assertPlainMonthDay(implicit, "M02", 29, "default overflow is constrain"); + +const lambda = Temporal.PlainMonthDay.from(fields, () => {}); +TemporalHelpers.assertPlainMonthDay(lambda, "M02", 29, "default overflow is constrain"); diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/toString/calendarname-undefined.js b/test/built-ins/Temporal/PlainMonthDay/prototype/toString/calendarname-undefined.js index 7d963de36b7..283ca2d680b 100644 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/toString/calendarname-undefined.js +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/toString/calendarname-undefined.js @@ -17,4 +17,4 @@ features: [Temporal] const monthday = new Temporal.PlainMonthDay(5, 2); const result = monthday.toString({ calendarName: undefined }); assert.sameValue(result, "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 () => {} diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/with/copy-properties-not-undefined.js b/test/built-ins/Temporal/PlainMonthDay/prototype/with/copy-properties-not-undefined.js index eb7a0a25259..13abee1178c 100644 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/with/copy-properties-not-undefined.js +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/with/copy-properties-not-undefined.js @@ -20,3 +20,4 @@ TemporalHelpers.assertPlainMonthDay(plainMonthDay.with({ day: 1, monthCode: unde "M10", 1, "only the properties that are present and defined in the plain object are copied" ); +// See options-object for {} and () => {} diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/with/options-undefined.js b/test/built-ins/Temporal/PlainMonthDay/prototype/with/options-undefined.js index 035f174b71a..ef0f0b82ae6 100644 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/with/options-undefined.js +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/with/options-undefined.js @@ -15,3 +15,6 @@ assert.sameValue(explicit.day, 29, "default overflow is constrain"); const implicit = monthday.with(fields); assert.sameValue(implicit.day, 29, "default overflow is constrain"); + +const lambda = monthday.with(fields, () => {}); +assert.sameValue(lambda.day, 29, "default overflow is constrain"); diff --git a/test/built-ins/Temporal/PlainTime/from/options-undefined.js b/test/built-ins/Temporal/PlainTime/from/options-undefined.js index 060636b2fee..1a09523593e 100644 --- a/test/built-ins/Temporal/PlainTime/from/options-undefined.js +++ b/test/built-ins/Temporal/PlainTime/from/options-undefined.js @@ -14,3 +14,6 @@ assert.sameValue(explicit.minute, 59, "default overflow is constrain"); const implicit = Temporal.PlainTime.from(fields); assert.sameValue(implicit.minute, 59, "default overflow is constrain"); + +const lambda = Temporal.PlainTime.from(fields, () => {}); +assert.sameValue(lambda.minute, 59, "default overflow is constrain"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/since/largestunit-undefined.js b/test/built-ins/Temporal/PlainTime/prototype/since/largestunit-undefined.js index 2893685f290..6681a4189de 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/since/largestunit-undefined.js +++ b/test/built-ins/Temporal/PlainTime/prototype/since/largestunit-undefined.js @@ -15,3 +15,5 @@ const explicit = later.since(earlier, { largestUnit: undefined }); TemporalHelpers.assertDuration(explicit, 0, 0, 0, 0, 1, 1, 1, 987, 654, 321, "default largestUnit is hour"); const implicit = later.since(earlier, {}); TemporalHelpers.assertDuration(implicit, 0, 0, 0, 0, 1, 1, 1, 987, 654, 321, "default largestUnit is hour"); +const lambda = later.since(earlier, () => {}); +TemporalHelpers.assertDuration(lambda, 0, 0, 0, 0, 1, 1, 1, 987, 654, 321, "default largestUnit is hour"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/since/options-undefined.js b/test/built-ins/Temporal/PlainTime/prototype/since/options-undefined.js index 5971f0246f4..248aecefc4a 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/since/options-undefined.js +++ b/test/built-ins/Temporal/PlainTime/prototype/since/options-undefined.js @@ -17,3 +17,7 @@ assert.sameValue(explicit.nanoseconds, 1, "default smallest unit is nanoseconds const implicit = later.since(earlier); assert.sameValue(implicit.hours, 6, "default largest unit is hours"); assert.sameValue(implicit.nanoseconds, 1, "default smallest unit is nanoseconds and no rounding"); + +const lambda = later.since(earlier, () => {}); +assert.sameValue(lambda.hours, 6, "default largest unit is hours"); +assert.sameValue(lambda.nanoseconds, 1, "default smallest unit is nanoseconds and no rounding"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/since/roundingincrement-undefined.js b/test/built-ins/Temporal/PlainTime/prototype/since/roundingincrement-undefined.js index 8dcd5c2bea4..98f2079e6d6 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/since/roundingincrement-undefined.js +++ b/test/built-ins/Temporal/PlainTime/prototype/since/roundingincrement-undefined.js @@ -23,3 +23,6 @@ TemporalHelpers.assertDuration(explicit, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, "default const implicit = later.since(earlier, {}); TemporalHelpers.assertDuration(implicit, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, "default roundingIncrement is 1"); + +const lambda = later.since(earlier, () => {}); +TemporalHelpers.assertDuration(lambda, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, "default roundingIncrement is 1"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/toString/options-undefined.js b/test/built-ins/Temporal/PlainTime/prototype/toString/options-undefined.js index c03c5994cb2..846dc1fac67 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/toString/options-undefined.js +++ b/test/built-ins/Temporal/PlainTime/prototype/toString/options-undefined.js @@ -21,4 +21,7 @@ for (const [input, expected] of tests) { const implicit = time.toString(); assert.sameValue(implicit, expected, "default precision is auto and no rounding"); + + const lambda = time.toString(() => {}); + assert.sameValue(lambda, expected, "default precision is auto and no rounding"); } diff --git a/test/built-ins/Temporal/PlainTime/prototype/until/largestunit-undefined.js b/test/built-ins/Temporal/PlainTime/prototype/until/largestunit-undefined.js index d333e67d7a7..d01f0095b76 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/until/largestunit-undefined.js +++ b/test/built-ins/Temporal/PlainTime/prototype/until/largestunit-undefined.js @@ -15,3 +15,5 @@ const explicit = earlier.until(later, { largestUnit: undefined }); TemporalHelpers.assertDuration(explicit, 0, 0, 0, 0, 1, 1, 1, 987, 654, 321, "default largestUnit is hour"); const implicit = earlier.until(later, {}); TemporalHelpers.assertDuration(implicit, 0, 0, 0, 0, 1, 1, 1, 987, 654, 321, "default largestUnit is hour"); +const lambda = earlier.until(later, () => {}); +TemporalHelpers.assertDuration(lambda, 0, 0, 0, 0, 1, 1, 1, 987, 654, 321, "default largestUnit is hour"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/until/options-undefined.js b/test/built-ins/Temporal/PlainTime/prototype/until/options-undefined.js index 7bfafe83024..c05d6a88244 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/until/options-undefined.js +++ b/test/built-ins/Temporal/PlainTime/prototype/until/options-undefined.js @@ -17,3 +17,7 @@ assert.sameValue(explicit.nanoseconds, 1, "default smallest unit is nanoseconds const implicit = earlier.until(later); assert.sameValue(implicit.hours, 6, "default largest unit is hours"); assert.sameValue(implicit.nanoseconds, 1, "default smallest unit is nanoseconds and no rounding"); + +const lambda = earlier.until(later, () => {}); +assert.sameValue(lambda.hours, 6, "default largest unit is hours"); +assert.sameValue(lambda.nanoseconds, 1, "default smallest unit is nanoseconds and no rounding"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/until/roundingincrement-undefined.js b/test/built-ins/Temporal/PlainTime/prototype/until/roundingincrement-undefined.js index 4cea2367c05..a0aaabb1f36 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/until/roundingincrement-undefined.js +++ b/test/built-ins/Temporal/PlainTime/prototype/until/roundingincrement-undefined.js @@ -23,3 +23,6 @@ TemporalHelpers.assertDuration(explicit, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, "default const implicit = earlier.until(later, {}); TemporalHelpers.assertDuration(implicit, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, "default roundingIncrement is 1"); + +const lambda = earlier.until(later, () => {}); +TemporalHelpers.assertDuration(lambda, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, "default roundingIncrement is 1"); diff --git a/test/built-ins/Temporal/PlainTime/prototype/with/copy-properties-not-undefined.js b/test/built-ins/Temporal/PlainTime/prototype/with/copy-properties-not-undefined.js index 598b10d52d4..c161f6e29b5 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/with/copy-properties-not-undefined.js +++ b/test/built-ins/Temporal/PlainTime/prototype/with/copy-properties-not-undefined.js @@ -20,3 +20,4 @@ TemporalHelpers.assertPlainTime(plainTime.with({ hour: 8, second: undefined }), 8, 45, 55, 0, 0, 0, "only the properties that are present and defined in the plain object are copied" ); +// See options-object for {} and () => {} diff --git a/test/built-ins/Temporal/PlainTime/prototype/with/overflow-undefined.js b/test/built-ins/Temporal/PlainTime/prototype/with/overflow-undefined.js index 49e4ae8f293..64bed5b4498 100644 --- a/test/built-ins/Temporal/PlainTime/prototype/with/overflow-undefined.js +++ b/test/built-ins/Temporal/PlainTime/prototype/with/overflow-undefined.js @@ -20,3 +20,5 @@ const explicit = time.with({ minute: 67 }, { overflow: undefined }); TemporalHelpers.assertPlainTime(explicit, 12, 59, 0, 0, 0, 0, "default overflow is constrain"); const implicit = time.with({ minute: 67 }, {}); TemporalHelpers.assertPlainTime(implicit, 12, 59, 0, 0, 0, 0, "default overflow is constrain"); +const lambda = time.with({ minute: 67 }, () => {}); +TemporalHelpers.assertPlainTime(lambda, 12, 59, 0, 0, 0, 0, "default overflow is constrain"); diff --git a/test/built-ins/Temporal/PlainYearMonth/from/options-undefined.js b/test/built-ins/Temporal/PlainYearMonth/from/options-undefined.js index 88573c9c10f..a7364809831 100644 --- a/test/built-ins/Temporal/PlainYearMonth/from/options-undefined.js +++ b/test/built-ins/Temporal/PlainYearMonth/from/options-undefined.js @@ -14,3 +14,6 @@ assert.sameValue(explicit.month, 12, "default overflow is constrain"); const implicit = Temporal.PlainYearMonth.from(fields); assert.sameValue(implicit.month, 12, "default overflow is constrain"); + +const lambda = Temporal.PlainYearMonth.from(fields, () => {}); +assert.sameValue(lambda.month, 12, "default overflow is constrain"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/since/options-undefined.js b/test/built-ins/Temporal/PlainYearMonth/prototype/since/options-undefined.js index 061104a651d..9d485e74e5f 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/since/options-undefined.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/since/options-undefined.js @@ -20,3 +20,8 @@ TemporalHelpers.assertDuration(later.since(earlier), 2, 7, 0, 0, 0, 0, 0, 0, 0, 0, "default largestUnit is year (implicit, pos)"); TemporalHelpers.assertDuration(earlier.since(later), -2, -7, 0, 0, 0, 0, 0, 0, 0, 0, "default largestUnit is year (implicit, neg)"); + +TemporalHelpers.assertDuration(later.since(earlier, () => {}), + 2, 7, 0, 0, 0, 0, 0, 0, 0, 0, "default largestUnit is year (lambda, pos)"); +TemporalHelpers.assertDuration(earlier.since(later, () => {}), + -2, -7, 0, 0, 0, 0, 0, 0, 0, 0, "default largestUnit is year (lambda, neg)"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/since/roundingincrement-undefined.js b/test/built-ins/Temporal/PlainYearMonth/prototype/since/roundingincrement-undefined.js index a5ed492f617..c23151bf218 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/since/roundingincrement-undefined.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/since/roundingincrement-undefined.js @@ -23,3 +23,6 @@ TemporalHelpers.assertDuration(explicit, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "default const implicit = later.since(earlier, {}); TemporalHelpers.assertDuration(implicit, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "default roundingIncrement is 1"); + +const lambda = later.since(earlier, () => {}); +TemporalHelpers.assertDuration(lambda, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "default roundingIncrement is 1"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/since/smallestunit-undefined.js b/test/built-ins/Temporal/PlainYearMonth/prototype/since/smallestunit-undefined.js index 5e84ad20be1..155b4611187 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/since/smallestunit-undefined.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/since/smallestunit-undefined.js @@ -15,3 +15,5 @@ const explicit = later.since(earlier, { smallestUnit: undefined }); TemporalHelpers.assertDuration(explicit, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "default smallestUnit is month"); const implicit = later.since(earlier, {}); TemporalHelpers.assertDuration(implicit, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "default smallestUnit is month"); +const lambda = later.since(earlier, () => {}); +TemporalHelpers.assertDuration(lambda, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "default smallestUnit is month"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/toString/calendarname-undefined.js b/test/built-ins/Temporal/PlainYearMonth/prototype/toString/calendarname-undefined.js index 33886ab4be0..fb1cca8b66e 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/toString/calendarname-undefined.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/toString/calendarname-undefined.js @@ -17,4 +17,4 @@ features: [Temporal] const yearmonth = new Temporal.PlainYearMonth(2000, 5); const result = yearmonth.toString({ calendarName: undefined }); assert.sameValue(result, "2000-05", `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 () => {} diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/until/options-undefined.js b/test/built-ins/Temporal/PlainYearMonth/prototype/until/options-undefined.js index 6b87be9db0f..4bace823d67 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/until/options-undefined.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/until/options-undefined.js @@ -20,3 +20,8 @@ TemporalHelpers.assertDuration(earlier.until(later), 2, 7, 0, 0, 0, 0, 0, 0, 0, 0, "default largestUnit is year (implicit, pos)"); TemporalHelpers.assertDuration(later.until(earlier), -2, -7, 0, 0, 0, 0, 0, 0, 0, 0, "default largestUnit is year (implicit, neg)"); + +TemporalHelpers.assertDuration(earlier.until(later, () => {}), + 2, 7, 0, 0, 0, 0, 0, 0, 0, 0, "default largestUnit is year (lambda, pos)"); +TemporalHelpers.assertDuration(later.until(earlier, () => {}), + -2, -7, 0, 0, 0, 0, 0, 0, 0, 0, "default largestUnit is year (lambda, neg)"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/until/roundingincrement-undefined.js b/test/built-ins/Temporal/PlainYearMonth/prototype/until/roundingincrement-undefined.js index a601448bbb8..59ff914f8b0 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/until/roundingincrement-undefined.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/until/roundingincrement-undefined.js @@ -23,3 +23,6 @@ TemporalHelpers.assertDuration(explicit, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "default const implicit = earlier.until(later, {}); TemporalHelpers.assertDuration(implicit, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "default roundingIncrement is 1"); + +const lambda = earlier.until(later, () => {}); +TemporalHelpers.assertDuration(lambda, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "default roundingIncrement is 1"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/until/smallestunit-undefined.js b/test/built-ins/Temporal/PlainYearMonth/prototype/until/smallestunit-undefined.js index 54aa1e8d9f8..f0a3ba89a89 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/until/smallestunit-undefined.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/until/smallestunit-undefined.js @@ -15,3 +15,5 @@ const explicit = earlier.until(later, { smallestUnit: undefined }); TemporalHelpers.assertDuration(explicit, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "default smallestUnit is month"); const implicit = earlier.until(later, {}); TemporalHelpers.assertDuration(implicit, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "default smallestUnit is month"); +const lambda = earlier.until(later, () => {}); +TemporalHelpers.assertDuration(lambda, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, "default smallestUnit is month"); diff --git a/test/built-ins/Temporal/PlainYearMonth/prototype/with/options-undefined.js b/test/built-ins/Temporal/PlainYearMonth/prototype/with/options-undefined.js index a6c0c1abceb..e874ae700a6 100644 --- a/test/built-ins/Temporal/PlainYearMonth/prototype/with/options-undefined.js +++ b/test/built-ins/Temporal/PlainYearMonth/prototype/with/options-undefined.js @@ -15,3 +15,6 @@ assert.sameValue(explicit.month, 12, "default overflow is constrain"); const implicit = yearmonth.with(fields); assert.sameValue(implicit.month, 12, "default overflow is constrain"); + +const lambda = yearmonth.with(fields, () => {}); +assert.sameValue(lambda.month, 12, "default overflow is constrain"); diff --git a/test/built-ins/Temporal/ZonedDateTime/from/offset-undefined.js b/test/built-ins/Temporal/ZonedDateTime/from/offset-undefined.js index a3c67e1b527..b0614b1d663 100644 --- a/test/built-ins/Temporal/ZonedDateTime/from/offset-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/from/offset-undefined.js @@ -23,4 +23,4 @@ features: [Temporal] const propertyBag = { timeZone: "-04:00", offset: "+01:00", year: 2020, month: 2, day: 16, hour: 23, minute: 45 }; assert.throws(RangeError, () => Temporal.ZonedDateTime.from(propertyBag, { offset: undefined }), "default offset is reject"); -// See options-undefined.js for {} +// See options-object.js for {} and () => {} diff --git a/test/built-ins/Temporal/ZonedDateTime/from/overflow-undefined.js b/test/built-ins/Temporal/ZonedDateTime/from/overflow-undefined.js index 0caf0fb4fe1..659dd4e2489 100644 --- a/test/built-ins/Temporal/ZonedDateTime/from/overflow-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/from/overflow-undefined.js @@ -36,10 +36,12 @@ validValues.forEach((value) => { assert.sameValue(explicit.epochNanoseconds, 1_000_000_000_987_654_321n, "overflow is ignored"); const implicit = Temporal.ZonedDateTime.from(value, {}); assert.sameValue(implicit.epochNanoseconds, 1_000_000_000_987_654_321n, "overflow is ignored"); + const lambda = Temporal.ZonedDateTime.from(value, () => {}); + assert.sameValue(lambda.epochNanoseconds, 1_000_000_000_987_654_321n, "overflow is ignored"); }); const propertyBag = { year: 2000, month: 15, day: 34, hour: 12, timeZone: "UTC" }; const explicit = Temporal.ZonedDateTime.from(propertyBag, { overflow: undefined }); assert.sameValue(explicit.epochNanoseconds, 978_264_000_000_000_000n, "default overflow is constrain"); -// See options-undefined for {} +// See options-object.js for {} and () => {} diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/add/options-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/add/options-undefined.js index db10979fb0c..eea5ca8ed80 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/add/options-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/add/options-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/add/overflow-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/add/overflow-undefined.js index 04b6dc0bd3a..be62fd357e5 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/add/overflow-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/add/overflow-undefined.js @@ -25,3 +25,5 @@ const explicit = datetime.add(duration, { overflow: undefined }); assert.sameValue(explicit.epochNanoseconds, 5097599_999_999_999n, "default overflow is constrain"); const implicit = datetime.add(duration, {}); assert.sameValue(implicit.epochNanoseconds, 5097599_999_999_999n, "default overflow is constrain"); +const lambda = datetime.add(duration, () => {}); +assert.sameValue(lambda.epochNanoseconds, 5097599_999_999_999n, "default overflow is constrain"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZoneTransition/direction-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZoneTransition/direction-undefined.js index a1cacf2be8d..9371ba10640 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZoneTransition/direction-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/getTimeZoneTransition/direction-undefined.js @@ -12,3 +12,4 @@ features: [Temporal] const zdt = new Temporal.ZonedDateTime(0n, "UTC"); assert.throws(RangeError, () => zdt.getTimeZoneTransition({})); assert.throws(RangeError, () => zdt.getTimeZoneTransition({ direction: undefined })); +assert.throws(RangeError, () => zdt.getTimeZoneTransition(() => {})); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/largestunit-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/largestunit-undefined.js index 9b532ebd712..fca70f5106c 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/largestunit-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/largestunit-undefined.js @@ -15,3 +15,5 @@ const explicit = later.since(earlier, { largestUnit: undefined }); TemporalHelpers.assertDuration(explicit, 0, 0, 0, 0, 25, 1, 1, 987, 654, 321, "default largestUnit is hour"); const implicit = later.since(earlier, {}); TemporalHelpers.assertDuration(implicit, 0, 0, 0, 0, 25, 1, 1, 987, 654, 321, "default largestUnit is hour"); +const lambda = later.since(earlier, () => {}); +TemporalHelpers.assertDuration(lambda, 0, 0, 0, 0, 25, 1, 1, 987, 654, 321, "default largestUnit is hour"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/options-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/options-undefined.js index 562654dfb45..e589017bb5b 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/options-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/options-undefined.js @@ -25,3 +25,11 @@ assert.sameValue(implicit.weeks, 0, "default largest unit is hours"); assert.sameValue(implicit.days, 0, "default largest unit is hours"); assert.sameValue(implicit.hours, 744, "default largest unit is hours"); 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 hours"); +assert.sameValue(lambda.months, 0, "default largest unit is hours"); +assert.sameValue(lambda.weeks, 0, "default largest unit is hours"); +assert.sameValue(lambda.days, 0, "default largest unit is hours"); +assert.sameValue(lambda.hours, 744, "default largest unit is hours"); +assert.sameValue(lambda.nanoseconds, 1, "default smallest unit is nanoseconds and no rounding"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/roundingincrement-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/roundingincrement-undefined.js index 9a0bf0fd06e..3420f948a4b 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/roundingincrement-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/roundingincrement-undefined.js @@ -23,3 +23,6 @@ TemporalHelpers.assertDuration(explicit, 0, 0, 0, 0, 25, 1, 1, 1, 1, 1, "default const implicit = later.since(earlier, {}); TemporalHelpers.assertDuration(implicit, 0, 0, 0, 0, 25, 1, 1, 1, 1, 1, "default roundingIncrement is 1"); + +const lambda = later.since(earlier, () => {}); +TemporalHelpers.assertDuration(lambda, 0, 0, 0, 0, 25, 1, 1, 1, 1, 1, "default roundingIncrement is 1"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/since/smallestunit-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/since/smallestunit-undefined.js index a2c0bca6564..29590cc6726 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/since/smallestunit-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/since/smallestunit-undefined.js @@ -15,3 +15,5 @@ const explicit = later.since(earlier, { smallestUnit: undefined }); TemporalHelpers.assertDuration(explicit, 0, 0, 0, 0, 25, 1, 1, 987, 654, 321, "default smallestUnit is nanosecond"); const implicit = later.since(earlier, {}); TemporalHelpers.assertDuration(implicit, 0, 0, 0, 0, 25, 1, 1, 987, 654, 321, "default smallestUnit is nanosecond"); +const lambda = later.since(earlier, () => {}); +TemporalHelpers.assertDuration(lambda, 0, 0, 0, 0, 25, 1, 1, 987, 654, 321, "default smallestUnit is nanosecond"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/subtract/options-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/subtract/options-undefined.js index 96e8b044109..01ebcf6e52e 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/subtract/options-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/subtract/options-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/subtract/overflow-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/subtract/overflow-undefined.js index b585fbe0d3d..9e3e3f66185 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/subtract/overflow-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/subtract/overflow-undefined.js @@ -25,3 +25,5 @@ const explicit = datetime.subtract(duration, { overflow: undefined }); assert.sameValue(explicit.epochNanoseconds, -2678400_000_000_001n, "default overflow is constrain"); const implicit = datetime.subtract(duration, {}); assert.sameValue(implicit.epochNanoseconds, -2678400_000_000_001n, "default overflow is constrain"); +const lambda = datetime.subtract(duration, () => {}); +assert.sameValue(lambda.epochNanoseconds, -2678400_000_000_001n, "default overflow is constrain"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/toString/calendarname-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/toString/calendarname-undefined.js index 13a21aaa1c5..dfddad9cff9 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/toString/calendarname-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/toString/calendarname-undefined.js @@ -17,4 +17,4 @@ features: [Temporal] const datetime = new Temporal.ZonedDateTime(3661_987_654_321n, "UTC"); const result = datetime.toString({ calendarName: undefined }); assert.sameValue(result, "1970-01-01T01:01:01.987654321+00:00[UTC]", `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 () => {} diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/toString/offset-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/toString/offset-undefined.js index dd81e25e62a..dfb25ace547 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/toString/offset-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/toString/offset-undefined.js @@ -19,4 +19,4 @@ const datetime = new Temporal.ZonedDateTime(1_000_000_000_987_654_321n, "UTC"); const explicit = datetime.toString({ offset: undefined }); assert.sameValue(explicit, "2001-09-09T01:46:40.987654321+00:00[UTC]", "default offset option is auto"); -// See options-undefined.js for {} +// See options-object.js for {} and () => {} diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/toString/timezonename-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/toString/timezonename-undefined.js index 15430dfe11a..e3a4b478030 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/toString/timezonename-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/toString/timezonename-undefined.js @@ -19,4 +19,4 @@ const datetime = new Temporal.ZonedDateTime(1_000_000_000_987_654_321n, "UTC"); const explicit = datetime.toString({ timeZoneName: undefined }); assert.sameValue(explicit, "2001-09-09T01:46:40.987654321+00:00[UTC]", "default timeZoneName option is auto"); -// See options-object.js for {} and options-undefined.js for absent +// See options-object.js for {} and () => {} diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/largestunit-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/largestunit-undefined.js index 84619cbab91..c256c9eec1b 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/largestunit-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/largestunit-undefined.js @@ -15,3 +15,5 @@ const explicit = earlier.until(later, { largestUnit: undefined }); TemporalHelpers.assertDuration(explicit, 0, 0, 0, 0, 25, 1, 1, 987, 654, 321, "default largestUnit is hour"); const implicit = earlier.until(later, {}); TemporalHelpers.assertDuration(implicit, 0, 0, 0, 0, 25, 1, 1, 987, 654, 321, "default largestUnit is hour"); +const lambda = earlier.until(later, () => {}); +TemporalHelpers.assertDuration(lambda, 0, 0, 0, 0, 25, 1, 1, 987, 654, 321, "default largestUnit is hour"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/options-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/options-undefined.js index a85c673b2b1..a38471dc3b5 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/options-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/options-undefined.js @@ -25,3 +25,11 @@ assert.sameValue(implicit.weeks, 0, "default largest unit is hours"); assert.sameValue(implicit.days, 0, "default largest unit is hours"); assert.sameValue(implicit.hours, 744, "default largest unit is hours"); 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 hours"); +assert.sameValue(lambda.months, 0, "default largest unit is hours"); +assert.sameValue(lambda.weeks, 0, "default largest unit is hours"); +assert.sameValue(lambda.days, 0, "default largest unit is hours"); +assert.sameValue(lambda.hours, 744, "default largest unit is hours"); +assert.sameValue(lambda.nanoseconds, 1, "default smallest unit is nanoseconds and no rounding"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/roundingincrement-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/roundingincrement-undefined.js index 6684ddef2a5..277d209f23e 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/roundingincrement-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/roundingincrement-undefined.js @@ -23,3 +23,6 @@ TemporalHelpers.assertDuration(explicit, 0, 0, 0, 0, 25, 1, 1, 1, 1, 1, "default const implicit = earlier.until(later, {}); TemporalHelpers.assertDuration(implicit, 0, 0, 0, 0, 25, 1, 1, 1, 1, 1, "default roundingIncrement is 1"); + +const lambda = earlier.until(later, () => {}); +TemporalHelpers.assertDuration(lambda, 0, 0, 0, 0, 25, 1, 1, 1, 1, 1, "default roundingIncrement is 1"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/until/smallestunit-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/until/smallestunit-undefined.js index f1496a3253f..355dbfe626e 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/until/smallestunit-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/until/smallestunit-undefined.js @@ -15,3 +15,5 @@ const explicit = earlier.until(later, { smallestUnit: undefined }); TemporalHelpers.assertDuration(explicit, 0, 0, 0, 0, 25, 1, 1, 987, 654, 321, "default smallestUnit is nanosecond"); const implicit = earlier.until(later, {}); TemporalHelpers.assertDuration(implicit, 0, 0, 0, 0, 25, 1, 1, 987, 654, 321, "default smallestUnit is nanosecond"); +const lambda = earlier.until(later, () => {}); +TemporalHelpers.assertDuration(lambda, 0, 0, 0, 0, 25, 1, 1, 987, 654, 321, "default smallestUnit is nanosecond"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/with/offset-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/with/offset-undefined.js index 0d96c9aacc6..74caba51d76 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/with/offset-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/with/offset-undefined.js @@ -19,3 +19,5 @@ const explicit = datetime.with({ minute: 31 }, { offset: undefined }); assert.sameValue(explicit.epochNanoseconds, 1572757261_000_000_000n, "default offset is prefer"); const implicit = datetime.with({ minute: 31 }, {}); assert.sameValue(implicit.epochNanoseconds, 1572757261_000_000_000n, "default offset is prefer"); +const lambda = datetime.with({ minute: 31 }, () => {}); +assert.sameValue(lambda.epochNanoseconds, 1572757261_000_000_000n, "default offset is prefer"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/with/options-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/with/options-undefined.js index 63d6f06867a..ddb467dcaaa 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/with/options-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/with/options-undefined.js @@ -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"); diff --git a/test/built-ins/Temporal/ZonedDateTime/prototype/with/overflow-undefined.js b/test/built-ins/Temporal/ZonedDateTime/prototype/with/overflow-undefined.js index b3c630c5378..8693cf85da4 100644 --- a/test/built-ins/Temporal/ZonedDateTime/prototype/with/overflow-undefined.js +++ b/test/built-ins/Temporal/ZonedDateTime/prototype/with/overflow-undefined.js @@ -22,3 +22,5 @@ const explicit = datetime.with({ second: 67 }, { overflow: undefined }); assert.sameValue(explicit.epochNanoseconds, 1_000_000_019_987_654_321n, "default overflow is constrain"); const implicit = datetime.with({ second: 67 }, {}); assert.sameValue(implicit.epochNanoseconds, 1_000_000_019_987_654_321n, "default overflow is constrain"); +const lambda = datetime.with({ second: 67 }, () => {}); +assert.sameValue(lambda.epochNanoseconds, 1_000_000_019_987_654_321n, "default overflow is constrain"); diff --git a/test/intl402/Temporal/PlainDate/prototype/toString/options-undefined.js b/test/intl402/Temporal/PlainDate/prototype/toString/options-undefined.js index a311d02267d..806871b9a17 100644 --- a/test/intl402/Temporal/PlainDate/prototype/toString/options-undefined.js +++ b/test/intl402/Temporal/PlainDate/prototype/toString/options-undefined.js @@ -19,4 +19,7 @@ const date2 = new Temporal.PlainDate(2000, 5, 2, "gregory"); const implicit = date.toString(); assert.sameValue(implicit, expected, "default calendarName option is auto"); + + const lambda = date.toString(() => {}); + assert.sameValue(lambda, expected, "default calendarName option is auto"); });