1 const memory = new WebAssembly.Memory( { initial: 2, maximum: 8 })
4 __syscall1: (n, a) => console.log(n),
5 __syscall3: (n, a, b, c) => console.log(n),
6 __syscall5: (n, a, b, c, d, e) => console.log(n)
10 const sock = new WebSocket('ws://localhost:8889')
11 sock.onmessage = function (e) {
15 function instantiate(bytes) {
16 return WebAssembly.compile(bytes).
17 then(m => new WebAssembly.Instance(m, imports));
21 .then(response => response.arrayBuffer())
22 .then(bytes => instantiate(bytes))
23 .then(instance => console.log(instance.exports.foo()));