LibWeb: Convert WebAssemblyObject AOs to ThrowCompletionOr

This commit is contained in:
Idan Horowitz 2021-10-31 16:53:51 +02:00
commit 3e8c76d5ab
Notes: sideshowbarker 2024-07-18 01:41:14 +09:00
6 changed files with 62 additions and 102 deletions

View file

@ -34,13 +34,9 @@ JS::ThrowCompletionOr<JS::Object*> WebAssemblyModuleConstructor::construct(Funct
auto& global_object = this->global_object();
auto* buffer_object = TRY(vm.argument(0).to_object(global_object));
auto result = parse_module(global_object, buffer_object);
if (result.is_error()) {
vm.throw_exception(global_object, result.error());
return JS::throw_completion(result.error());
}
auto result = TRY(parse_module(global_object, buffer_object));
return heap().allocate<WebAssemblyModuleObject>(global_object, global_object, result.release_value());
return heap().allocate<WebAssemblyModuleObject>(global_object, global_object, result);
}
void WebAssemblyModuleConstructor::initialize(JS::GlobalObject& global_object)