1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:37:36 +00:00

LibJS: Remove call to ToPositiveInteger after CalendarDaysInMonth

Implements: tc39/proposal-temporal@261692a

In order to remove the call to to_positive_integer() there neeeded
to be a change of return type from ThrowCompletionOr<Value> to
ThrowCompletionOr<double>.
This is one of the changes that will come anyways with the following
commit: tc39/proposal-temporal@11aad40. :^)
This commit is contained in:
BodilessSleeper 2022-12-30 05:05:46 +01:00 committed by Andreas Kling
parent 86995be111
commit 84db0c8dbf
3 changed files with 3 additions and 6 deletions

View file

@ -324,10 +324,7 @@ ThrowCompletionOr<PlainYearMonth*> add_duration_to_or_subtract_duration_from_pla
// 9. If sign < 0, then
if (sign < 0) {
// a. Let dayFromCalendar be ? CalendarDaysInMonth(calendar, yearMonth).
auto day_from_calendar = TRY(calendar_days_in_month(vm, calendar, year_month));
// b. Let day be ? ToPositiveInteger(dayFromCalendar).
day = TRY(to_positive_integer(vm, day_from_calendar));
day = TRY(calendar_days_in_month(vm, calendar, year_month));
}
// 10. Else,
else {