diff options
Diffstat (limited to 'index.htm')
-rw-r--r-- | index.htm | 22 |
1 files changed, 16 insertions, 6 deletions
@@ -24,13 +24,13 @@ fetch("index.wasm"), { "wasi_snapshot_preview1" : { - args_sizes_get : (...args) => { console.log(`args_sizes_get: ${args}`); }, - args_get : (...args) => { console.log(`args_get: ${args}`); }, - proc_exit : (...args) => { console.log(`proc_exit: ${args}`); }, clock_time_get : () => { return Date.now(); }, - fd_close : (...args) => { console.log(`fd_close: ${args}`); }, - fd_write : (...args) => { console.log(`fd_write: ${args}`); }, - fd_seek : (...args) => { console.log(`fd_seek: ${args}`); }, + args_sizes_get : () => { throw new Error("Unexpected args_sizes_get call"); }, + args_get : () => { throw new Error("Unexpected args_get call"); }, + proc_exit : () => { throw new Error("Unexpected proc_exit call"); }, + fd_close : () => { throw new Error("Unexpected fd_close call"); }, + fd_write : () => { throw new Error("Unexpected fd_write call"); }, + fd_seek : () => { throw new Error("Unexpected fd_seek call"); }, }, "env" : { p_init : () => { @@ -60,6 +60,16 @@ p_wait_events : () => {}, p_sleep_for : (time) => {}, p_time : Date.now, + memset : (dst, val, num) => { + // FIXME PERF + for (let i = 0; i < num; ++i) + dst[i] = val; + }, + memcpy : (dst, src, num) => { + // FIXME PERF + for (let i = 0; i < num; ++i) + dst[i] = src[i]; + }, }, } ); |