summaryrefslogtreecommitdiff
path: root/libdeno/libdeno_test.js
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-10-24 02:17:10 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-10-24 14:52:38 -0700
commit0501330607b000e0913994e633b76410e1fd162c (patch)
tree218195aecec88c437cd99b93404ffe8b6e4eb7bb /libdeno/libdeno_test.js
parent61cda728816b5916180f22d977ba741e2fadc8d9 (diff)
Add libdeno.shared global shared ArrayBuffer.
Diffstat (limited to 'libdeno/libdeno_test.js')
-rw-r--r--libdeno/libdeno_test.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/libdeno/libdeno_test.js b/libdeno/libdeno_test.js
index 1aa09a775..c9eaaa0ca 100644
--- a/libdeno/libdeno_test.js
+++ b/libdeno/libdeno_test.js
@@ -173,3 +173,16 @@ global.PromiseRejectCatchHandling = () => {
}
})();
}
+
+global.Shared = () => {
+ const ab = libdeno.shared;
+ assert(ab instanceof ArrayBuffer);
+ assert(ab.byteLength === 3);
+ const ui8 = new Uint8Array(ab);
+ assert(ui8[0] === 0);
+ assert(ui8[1] === 1);
+ assert(ui8[2] === 2);
+ ui8[0] = 42;
+ ui8[1] = 43;
+ ui8[2] = 44;
+}