1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:37:35 +00:00

LibJS: Convert to_positive_integer() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-09-16 18:02:55 +01:00
parent 2f56fd48ca
commit 9ac426c906
3 changed files with 7 additions and 10 deletions

View file

@ -157,7 +157,7 @@ double calendar_month(GlobalObject& global_object, Object& calendar, Object& dat
}
// 4. Return ? ToPositiveInteger(result).
return to_positive_integer(global_object, result);
return TRY_OR_DISCARD(to_positive_integer(global_object, result));
}
// 12.1.11 CalendarMonthCode ( calendar, dateLike ), https://tc39.es/proposal-temporal/#sec-temporal-calendarmonthcode
@ -199,7 +199,7 @@ double calendar_day(GlobalObject& global_object, Object& calendar, Object& date_
}
// 4. Return ? ToPositiveInteger(result).
return to_positive_integer(global_object, result);
return TRY_OR_DISCARD(to_positive_integer(global_object, result));
}
// 12.1.13 CalendarDayOfWeek ( calendar, dateLike ), https://tc39.es/proposal-temporal/#sec-temporal-calendardayofweek