diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-07-06 16:26:34 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-07-06 18:25:09 -0400 |
commit | a2dde56c5961f451b9042c1f651af372c4984034 (patch) | |
tree | 06aaf64e257d9d6bd1f6f16eca2b02aab971c04b /js/mock_runtime.js | |
parent | 9778eceaf5922b1e051859a68b2e02a2f1b1ee8b (diff) |
Remove channel parameter from deno_send/recv.
Diffstat (limited to 'js/mock_runtime.js')
-rw-r--r-- | js/mock_runtime.js | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/js/mock_runtime.js b/js/mock_runtime.js index 666cabf45..66a34657e 100644 --- a/js/mock_runtime.js +++ b/js/mock_runtime.js @@ -28,15 +28,13 @@ global.TypedArraySnapshots = () => { }; global.SendSuccess = () => { - deno.recv((channel, msg) => { - assert(channel === "SendSuccess"); + deno.recv(msg => { deno.print("SendSuccess: ok"); }); }; global.SendByteLength = () => { - deno.recv((channel, msg) => { - assert(channel === "SendByteLength"); + deno.recv(msg => { assert(msg instanceof ArrayBuffer); assert(msg.byteLength === 3); }); @@ -45,16 +43,16 @@ global.SendByteLength = () => { global.RecvReturnEmpty = () => { const ui8 = new Uint8Array("abc".split("").map(c => c.charCodeAt(0))); const ab = typedArrayToArrayBuffer(ui8); - let r = deno.send("RecvReturnEmpty", ab); + let r = deno.send(ab); assert(r == null); - r = deno.send("RecvReturnEmpty", ab); + r = deno.send(ab); assert(r == null); }; global.RecvReturnBar = () => { const ui8 = new Uint8Array("abc".split("").map(c => c.charCodeAt(0))); const ab = typedArrayToArrayBuffer(ui8); - const r = deno.send("RecvReturnBar", ab); + const r = deno.send(ab); assert(r instanceof ArrayBuffer); assert(r.byteLength === 3); const rui8 = new Uint8Array(r); @@ -84,7 +82,7 @@ global.ErrorHandling = () => { assert(line === 3); assert(col === 1); assert(error instanceof Error); - deno.send("ErrorHandling", typedArrayToArrayBuffer(new Uint8Array([42]))); + deno.send(typedArrayToArrayBuffer(new Uint8Array([42]))); }; eval("\n\n notdefined()\n//# sourceURL=helloworld.js"); }; |