playwright/test/assets/wasm/table2.html
2020-01-31 08:57:47 -08:00

10 lines
321 B
HTML

<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>