1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 20:28:11 +00:00

LibJS: Convert to_numeric() to ThrowCompletionOr

This commit is contained in:
Idan Horowitz 2021-10-16 21:42:32 +03:00 committed by Linus Groh
parent e35222a76e
commit b8f101888b
5 changed files with 44 additions and 98 deletions

View file

@ -66,9 +66,7 @@ static Value get_value_from_constructor_argument(GlobalObject& global_object)
Value number;
if (vm.argument_count() > 0) {
auto primitive = vm.argument(0).to_numeric(global_object);
if (vm.exception())
return {};
auto primitive = TRY_OR_DISCARD(vm.argument(0).to_numeric(global_object));
if (primitive.is_bigint()) {
// FIXME: How should huge values be handled here?
auto& big_integer = primitive.as_bigint().big_integer();