mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:18:13 +00:00
LibJS: Convert install_error_cause() to ThrowCompletionOr
This commit is contained in:
parent
4d5bd092ea
commit
867b19affb
4 changed files with 25 additions and 19 deletions
|
@ -48,9 +48,7 @@ Value ErrorConstructor::construct(FunctionObject& new_target)
|
|||
error->create_non_enumerable_data_property_or_throw(vm.names.message, js_string(vm, message));
|
||||
}
|
||||
|
||||
error->install_error_cause(vm.argument(1));
|
||||
if (vm.exception())
|
||||
return {};
|
||||
TRY_OR_DISCARD(error->install_error_cause(vm.argument(1)));
|
||||
|
||||
return error;
|
||||
}
|
||||
|
@ -97,9 +95,7 @@ Value ErrorConstructor::construct(FunctionObject& new_target)
|
|||
error->create_non_enumerable_data_property_or_throw(vm.names.message, js_string(vm, message)); \
|
||||
} \
|
||||
\
|
||||
error->install_error_cause(vm.argument(1)); \
|
||||
if (vm.exception()) \
|
||||
return {}; \
|
||||
TRY_OR_DISCARD(error->install_error_cause(vm.argument(1))); \
|
||||
\
|
||||
return error; \
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue