mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +00:00
LibJS: Convert to_string() to ThrowCompletionOr
Also update get_function_name() to use ThrowCompletionOr, but this is not a standard AO and should be refactored out of existence eventually.
This commit is contained in:
parent
5d38cf4973
commit
4d8912a92b
48 changed files with 171 additions and 415 deletions
|
@ -141,10 +141,7 @@ JS_DEFINE_NATIVE_FUNCTION(TestRunnerGlobalObject::fuzzilli)
|
|||
if (!vm.argument_count())
|
||||
return JS::js_undefined();
|
||||
|
||||
auto operation = vm.argument(0).to_string(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
|
||||
auto operation = TRY_OR_DISCARD(vm.argument(0).to_string(global_object));
|
||||
if (operation == "FUZZILLI_CRASH") {
|
||||
auto type = vm.argument(1).to_i32(global_object);
|
||||
if (vm.exception())
|
||||
|
@ -164,9 +161,7 @@ JS_DEFINE_NATIVE_FUNCTION(TestRunnerGlobalObject::fuzzilli)
|
|||
fzliout = stdout;
|
||||
}
|
||||
|
||||
auto string = vm.argument(1).to_string(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto string = TRY_OR_DISCARD(vm.argument(1).to_string(global_object));
|
||||
fprintf(fzliout, "%s\n", string.characters());
|
||||
fflush(fzliout);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue