summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-09-23 20:56:28 +0300
committerIdan Horowitz <idan.horowitz@gmail.com>2021-09-23 23:59:13 +0300
commitab594e5f2f60af7301d4a9e138d113389b25d40d (patch)
treed25f095a4881fb1cd82110e1c083279411b30fa7 /Userland/Libraries/LibWeb
parenta90107b02a4e8501593b582da2fe46cad123b372 (diff)
downloadserenity-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.cpp6
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 {};