diff options
Diffstat (limited to 'deno2/js/mock_runtime.js')
-rw-r--r-- | deno2/js/mock_runtime.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/deno2/js/mock_runtime.js b/deno2/js/mock_runtime.js index a91546f85..cd9766685 100644 --- a/deno2/js/mock_runtime.js +++ b/deno2/js/mock_runtime.js @@ -7,3 +7,13 @@ window['foo'] = () => { return "foo"; } +function assert(cond) { + if (!cond) throw Error("assert failed"); +} + +function recvabc() { + deno_recv((msg) => { + assert(msg instanceof ArrayBuffer); + assert(msg.byteLength === 3); + }); +} |