LibJS: Convert to_integer_or_infinity() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-10-18 19:19:57 +01:00
commit be28a6142b
Notes: sideshowbarker 2024-07-18 02:11:12 +09:00
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()) {