diff options
Diffstat (limited to 'deno2/js/mock_runtime.js')
-rw-r--r-- | deno2/js/mock_runtime.js | 11 |
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"); |