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:
parent
ffee3890a7
commit
be28a6142b
16 changed files with 100 additions and 237 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue