summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-07-01 17:03:17 +0430
committerAli Mohammad Pur <Ali.mpfard@gmail.com>2021-07-02 04:53:01 +0430
commitb538e15548cf3760c71e4b60cf3820c902748c8f (patch)
tree5daed8e96d8ed5043c3528baef31559c7d07f9a6 /Tests
parent62ca81fdcc7ab999739e3ddb6c26e196e9357962 (diff)
downloadserenity-b538e15548cf3760c71e4b60cf3820c902748c8f.zip
LibWasm: Give traps a reason and display it when needed
This makes debugging wasm code a bit easier, as we now know what fails instead of just "too bad, something went wrong".
Diffstat (limited to 'Tests')
-rw-r--r--Tests/LibWasm/test-wasm.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Tests/LibWasm/test-wasm.cpp b/Tests/LibWasm/test-wasm.cpp
index 24563898c2..f2cea9f057 100644
--- a/Tests/LibWasm/test-wasm.cpp
+++ b/Tests/LibWasm/test-wasm.cpp
@@ -254,7 +254,7 @@ JS_DEFINE_NATIVE_FUNCTION(WebAssemblyModule::wasm_invoke)
auto result = WebAssemblyModule::machine().invoke(function_address, arguments);
if (result.is_trap()) {
- vm.throw_exception<JS::TypeError>(global_object, "Execution trapped");
+ vm.throw_exception<JS::TypeError>(global_object, String::formatted("Execution trapped: {}", result.trap().reason));
return {};
}