1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:57:45 +00:00

LibJS: Convert to_integer_or_infinity() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-10-18 19:19:57 +01:00
parent ffee3890a7
commit be28a6142b
16 changed files with 100 additions and 237 deletions

View file

@ -123,9 +123,7 @@ ThrowCompletionOr<double> to_integer_throw_on_infinity(GlobalObject& global_obje
auto& vm = global_object.vm();
// 1. Let integer be ? ToIntegerOrInfinity(argument).
auto integer = argument.to_integer_or_infinity(global_object);
if (auto* exception = vm.exception())
return throw_completion(exception->value());
auto integer = TRY(argument.to_integer_or_infinity(global_object));
// 2. If integer is −∞ or +∞ , then
if (Value(integer).is_infinity()) {