blob: b10646cf1266327ab6b93343fb2b9daf9d602e8c [file] [edit]
import { instantiate } from "../wabt-wrapper.js";
import * as assert from "../assert.js";
let wat = `
(module
(global i32 i32.const 42)
(tag (param i32))
(func (export "test") (param i32) (result i32)
global.get 0
local.get 0
try (param i32)
throw 0
catch 0
br 0
end
)
)
`;
async function test() {
const instance = await instantiate(wat, {}, { exceptions: true });
const { test } = instance.exports;
assert.eq(test(41), 42);
}
await assert.asyncTest(test());