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

LibJS: Convert to_object() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-10-12 19:24:57 +01:00
parent 9eb065a1f6
commit 52976bfac6
45 changed files with 239 additions and 490 deletions

View file

@ -33,11 +33,7 @@ JS::Value WebAssemblyInstanceConstructor::construct(FunctionObject&)
{
auto& vm = this->vm();
auto& global_object = this->global_object();
auto module_argument = vm.argument(0).to_object(global_object);
if (vm.exception())
return {};
auto* module_argument = TRY_OR_DISCARD(vm.argument(0).to_object(global_object));
if (!is<WebAssemblyModuleObject>(module_argument)) {
vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::NotAnObjectOfType, "WebAssembly.Module");
return {};