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
Notes: sideshowbarker 2024-07-18 02:47:31 +09:00
45 changed files with 239 additions and 490 deletions

View file

@ -34,10 +34,7 @@ JS::Value WebAssemblyModuleConstructor::construct(FunctionObject&)
auto& vm = this->vm();
auto& global_object = this->global_object();
auto buffer_object = vm.argument(0).to_object(global_object);
if (vm.exception())
return {};
auto* buffer_object = TRY_OR_DISCARD(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());