playwright/test/assets/wasm/table2.html

10 lines
321 B
HTML
Raw Normal View History

<script>
async function loadTable() {
const tbl = new WebAssembly.Table({ initial: 2, element: 'anyfunc' });
const response = await fetch('table2.wasm');
const body = await response.arrayBuffer();
await WebAssembly.instantiate(body, { js: { tbl: tbl } });
return `${tbl.get(0)()}, ${tbl.get(1)()}`;
}
</script>