mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-13 04:51:23 +00:00
Add an accessor for the function table
This commit adds an intrinsics to the `wasm_bindgen` crate which accesses the `WebAssembly.Table` which is the function table of the module. Eventually the thinking is that a module would import its own function table via native wasm functionality (via `anyref` and such), but until that's implemented let's add a binding for it ourselves! Closes #1427
This commit is contained in:
@ -55,3 +55,9 @@ exports.debug_values = () => ([
|
||||
() => (null),
|
||||
new Set(),
|
||||
]);
|
||||
|
||||
exports.assert_function_table = (x, i) => {
|
||||
const rawWasm = require('wasm-bindgen-test_bg.js');
|
||||
assert.ok(x instanceof WebAssembly.Table);
|
||||
assert.strictEqual(x.get(i), rawWasm.function_table_lookup);
|
||||
};
|
||||
|
Reference in New Issue
Block a user