From b79ce93010d0cc80a9345f646e562326de4588e5 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 23 Jul 2018 14:11:41 -0400 Subject: 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. --- js/mock_runtime.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'js') 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)); + }); +}; -- cgit v1.2.3