1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:07:35 +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:
Linus Groh 2021-10-12 17:49:01 +01:00
parent 5d38cf4973
commit 4d8912a92b
48 changed files with 171 additions and 415 deletions

View file

@ -45,9 +45,7 @@ Value AggregateErrorConstructor::construct(FunctionObject& new_target)
auto* aggregate_error = TRY_OR_DISCARD(ordinary_create_from_constructor<AggregateError>(global_object, new_target, &GlobalObject::aggregate_error_prototype));
if (!vm.argument(1).is_undefined()) {
auto message = vm.argument(1).to_string(global_object);
if (vm.exception())
return {};
auto message = TRY_OR_DISCARD(vm.argument(1).to_string(global_object));
MUST(aggregate_error->create_non_enumerable_data_property_or_throw(vm.names.message, js_string(vm, message)));
}