diff options
author | Linus Groh <mail@linusgroh.de> | 2021-10-12 19:24:57 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-10-13 09:55:10 +0100 |
commit | 52976bfac675f9166fd1a9bf0bf6082e4615a086 (patch) | |
tree | 7cb7b7971db2f4df59472b7887b1304c38b94e30 /Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableConstructor.cpp | |
parent | 9eb065a1f62f34f62f2484139cf3063ef42565dd (diff) | |
download | serenity-52976bfac675f9166fd1a9bf0bf6082e4615a086.zip |
LibJS: Convert to_object() to ThrowCompletionOr
Diffstat (limited to 'Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableConstructor.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableConstructor.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableConstructor.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableConstructor.cpp index cfe8b67d05..dc58bf4b42 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableConstructor.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableConstructor.cpp @@ -34,10 +34,7 @@ JS::Value WebAssemblyTableConstructor::construct(FunctionObject&) auto& vm = this->vm(); auto& global_object = this->global_object(); - auto descriptor = vm.argument(0).to_object(global_object); - if (vm.exception()) - return {}; - + auto descriptor = TRY_OR_DISCARD(vm.argument(0).to_object(global_object)); auto element_value = TRY_OR_DISCARD(descriptor->get("element")); if (!element_value.is_string()) { vm.throw_exception<JS::TypeError>(global_object, JS::ErrorType::InvalidHint, element_value.to_string_without_side_effects()); |