diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/LibWasm/CMakeLists.txt | 2 | ||||
-rw-r--r-- | Tests/LibWasm/test-wasm.cpp | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/Tests/LibWasm/CMakeLists.txt b/Tests/LibWasm/CMakeLists.txt index f3b3f86666..8e393132f3 100644 --- a/Tests/LibWasm/CMakeLists.txt +++ b/Tests/LibWasm/CMakeLists.txt @@ -1,2 +1,2 @@ -serenity_testjs_test(test-wasm.cpp test-wasm LIBS LibWasm) +serenity_testjs_test(test-wasm.cpp test-wasm LIBS LibWasm LibJS) install(TARGETS test-wasm RUNTIME DESTINATION bin OPTIONAL) diff --git a/Tests/LibWasm/test-wasm.cpp b/Tests/LibWasm/test-wasm.cpp index 233f9f90f5..c882b95a3f 100644 --- a/Tests/LibWasm/test-wasm.cpp +++ b/Tests/LibWasm/test-wasm.cpp @@ -246,6 +246,9 @@ JS_DEFINE_NATIVE_FUNCTION(WebAssemblyModule::wasm_invoke) if (result.is_trap()) return vm.throw_completion<JS::TypeError>(TRY_OR_THROW_OOM(vm, String::formatted("Execution trapped: {}", result.trap().reason))); + if (result.is_completion()) + return result.completion(); + if (result.values().is_empty()) return JS::js_null(); |