diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-07-23 14:11:41 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-07-24 12:29:54 -0400 |
commit | b79ce93010d0cc80a9345f646e562326de4588e5 (patch) | |
tree | 3117c6b795b593bd369880ea36be18533c766a73 /js/mock_runtime.js | |
parent | b87e6d560477354e8c1b3c69e9836cd92eaf9984 (diff) |
Allow deno_buf with null alloc_ptr to be memcpy'd
This is a temporary hack to allow for easier restructuring of
the serialization code as we move Flatbuffer stuff from C++ to Rust.
Diffstat (limited to 'js/mock_runtime.js')
-rw-r--r-- | js/mock_runtime.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/js/mock_runtime.js b/js/mock_runtime.js index b4f353cdc..9fe59ae06 100644 --- a/js/mock_runtime.js +++ b/js/mock_runtime.js @@ -134,3 +134,14 @@ global.ErrorHandling = () => { }; eval("\n\n notdefined()\n//# sourceURL=helloworld.js"); }; + +global.SendNullAllocPtr = () => { + deno.recv(msg => { + assert(msg instanceof Uint8Array); + assert(msg.byteLength === 4); + assert(msg[0] === "a".charCodeAt(0)); + assert(msg[1] === "b".charCodeAt(0)); + assert(msg[2] === "c".charCodeAt(0)); + assert(msg[3] === "d".charCodeAt(0)); + }); +}; |