From 2462d8acd95354260fc1e1b173326fbef8c269cd Mon Sep 17 00:00:00 2001 From: Ms2ger Date: Mon, 11 Oct 2021 16:54:52 +0200 Subject: [PATCH] Check that PlainMonthDay#toPlainDate() rejects out-of-range dates. Fixes #3252. --- .../Temporal/PlainMonthDay/prototype/toPlainDate/basic.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/built-ins/Temporal/PlainMonthDay/prototype/toPlainDate/basic.js b/test/built-ins/Temporal/PlainMonthDay/prototype/toPlainDate/basic.js index efb577adc9..48785b0a5b 100644 --- a/test/built-ins/Temporal/PlainMonthDay/prototype/toPlainDate/basic.js +++ b/test/built-ins/Temporal/PlainMonthDay/prototype/toPlainDate/basic.js @@ -15,7 +15,7 @@ TemporalHelpers.assertPlainDate(d, 2002, 1, "M01", 22); assert.throws(TypeError, () => md.toPlainDate({ something: 'nothing' }), "missing fields"); const leapDay = Temporal.PlainMonthDay.from('02-29'); -TemporalHelpers.assertPlainDate(leapDay.toPlainDate({ year: 2019 }), 2019, 2, "M02", 28); +assert.throws(RangeError, () => leapDay.toPlainDate({ year: 2019 })); TemporalHelpers.assertPlainDate(leapDay.toPlainDate({ year: 2020 }), 2020, 2, "M02", 29); const options = { @@ -24,4 +24,4 @@ const options = { return ""; } }; -TemporalHelpers.assertPlainDate(leapDay.toPlainDate({ year: 2019 }, options), 2019, 2, "M02", 28); +TemporalHelpers.assertPlainDate(leapDay.toPlainDate({ year: 2020 }, options), 2020, 2, "M02", 29);