mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:28:11 +00:00
LibJS: Convert to_number() to ThrowCompletionOr
This commit is contained in:
parent
a36ee213b9
commit
20d990563c
22 changed files with 149 additions and 343 deletions
|
@ -964,10 +964,7 @@ JS_DEFINE_NATIVE_FUNCTION(ReplObject::exit_interpreter)
|
|||
{
|
||||
if (!vm.argument_count())
|
||||
exit(0);
|
||||
auto exit_code = vm.argument(0).to_number(global_object);
|
||||
if (::vm->exception())
|
||||
return {};
|
||||
exit(exit_code.as_double());
|
||||
exit(TRY_OR_DISCARD(vm.argument(0).to_number(global_object)).as_double());
|
||||
}
|
||||
|
||||
JS_DEFINE_NATIVE_FUNCTION(ReplObject::repl_help)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue