diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2021-09-23 20:56:28 +0300 |
---|---|---|
committer | Idan Horowitz <idan.horowitz@gmail.com> | 2021-09-23 23:59:13 +0300 |
commit | ab594e5f2f60af7301d4a9e138d113389b25d40d (patch) | |
tree | d25f095a4881fb1cd82110e1c083279411b30fa7 /Userland/Libraries/LibWeb | |
parent | a90107b02a4e8501593b582da2fe46cad123b372 (diff) | |
download | serenity-ab594e5f2f60af7301d4a9e138d113389b25d40d.zip |
LibJS: Convert Value::invoke and VM::call to ThrowCompletionOr
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r-- | Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp index 1f1459ef9a..8511d69aaa 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyObject.cpp @@ -190,8 +190,8 @@ Result<size_t, JS::Value> WebAssemblyObject::instantiate_module(Wasm::Module con for (auto& entry : arguments) argument_values.append(to_js_value(entry, global_object)); - auto result = vm.call(function, JS::js_undefined(), move(argument_values)); - if (vm.exception()) { + auto result_or_error = vm.call(function, JS::js_undefined(), move(argument_values)); + if (result_or_error.is_error()) { vm.clear_exception(); return Wasm::Trap(); } @@ -199,7 +199,7 @@ Result<size_t, JS::Value> WebAssemblyObject::instantiate_module(Wasm::Module con return Wasm::Result { Vector<Wasm::Value> {} }; if (type.results().size() == 1) { - auto value = to_webassembly_value(result, type.results().first(), global_object); + auto value = to_webassembly_value(result_or_error.release_value(), type.results().first(), global_object); if (!value.has_value()) return Wasm::Trap {}; |