define send_panic_msg_to_rust in our debug-wasm-test.html

This commit is contained in:
Folkert 2022-07-17 17:21:00 +02:00
parent e8b7d27e73
commit 8cec4c41f8
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -297,6 +297,11 @@
throw new Error(`Wasm exited with code ${exit_code}`);
}
// send_panic_msg_to_rust (i32, i32) => {}
function send_panic_msg_to_rust(msg, length) {
throw new Error("Wasm hit a panic");
}
// Signatures from wasm_test_platform.o
const sig2 = (i32) => {};
const sig6 = (i32a, i32b) => 0;
@ -318,6 +323,9 @@
const sig22 = () => 0;
return {
env: {
send_panic_msg_to_rust,
},
wasi_snapshot_preview1: {
args_get: sig6,
args_sizes_get: sig6,