From 7784cc2c1537a23b8b8ffa634b1a9b1ddf88886a Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 12 Jun 2018 06:36:01 +0200 Subject: Fix protobufjs snapshotting. --- deno2/js/mock_runtime.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'deno2/js/mock_runtime.js') diff --git a/deno2/js/mock_runtime.js b/deno2/js/mock_runtime.js index 570d6cf28..07e5a2ca8 100644 --- a/deno2/js/mock_runtime.js +++ b/deno2/js/mock_runtime.js @@ -15,6 +15,17 @@ function CanCallFunction() { return "foo"; } +// This object is created to test snapshotting. +// See DeserializeInternalFieldsCallback and SerializeInternalFieldsCallback. +const snapshotted = new Uint8Array([1, 3, 3, 7]); + +function TypedArraySnapshots() { + assert(snapshotted[0] === 1); + assert(snapshotted[1] === 3); + assert(snapshotted[2] === 3); + assert(snapshotted[3] === 7); +} + function PubSuccess() { denoSub((channel, msg) => { assert(channel === "PubSuccess"); -- cgit v1.2.3