summaryrefslogtreecommitdiff
path: root/deno2/js/mock_runtime.js
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-06-12 06:36:01 +0200
committerRyan Dahl <ry@tinyclouds.org>2018-06-12 17:26:18 +0200
commit7784cc2c1537a23b8b8ffa634b1a9b1ddf88886a (patch)
tree9c9d1de258b586e7fe866b8a4085cecf9fda430a /deno2/js/mock_runtime.js
parentdd48f8095c3357e6ec0e66042141c4e342707da5 (diff)
Fix protobufjs snapshotting.
Diffstat (limited to 'deno2/js/mock_runtime.js')
-rw-r--r--deno2/js/mock_runtime.js11
1 files changed, 11 insertions, 0 deletions
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");