LibJS: Fix incorrect ErrorType in Temporal.PlainMonthDay constructor

This commit is contained in:
Linus Groh 2022-06-30 20:17:16 +01:00
parent a999b82882
commit e1ee33ba7c
Notes: sideshowbarker 2024-07-17 09:48:27 +09:00

View File

@ -76,7 +76,7 @@ ThrowCompletionOr<Object*> PlainMonthDayConstructor::construct(FunctionObject& n
// This does not change the exposed behavior as the call to CreateTemporalMonthDay will immediately check that these values are valid
// ISO values (for years: -273975 - 273975, for months: 1 - 12, for days: 1 - 31) all of which are subsets of this check.
if (!AK::is_within_range<i32>(ref) || !AK::is_within_range<u8>(m) || !AK::is_within_range<u8>(d))
return vm.throw_completion<RangeError>(global_object, ErrorType::TemporalInvalidPlainYearMonth);
return vm.throw_completion<RangeError>(global_object, ErrorType::TemporalInvalidPlainMonthDay);
// 7. Return ? CreateTemporalMonthDay(m, d, calendar, ref, NewTarget).
return TRY(create_temporal_month_day(global_object, m, d, *calendar, ref, &new_target));