diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-10-24 02:17:10 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-10-24 14:52:38 -0700 |
commit | 0501330607b000e0913994e633b76410e1fd162c (patch) | |
tree | 218195aecec88c437cd99b93404ffe8b6e4eb7bb /libdeno/libdeno_test.js | |
parent | 61cda728816b5916180f22d977ba741e2fadc8d9 (diff) |
Add libdeno.shared global shared ArrayBuffer.
Diffstat (limited to 'libdeno/libdeno_test.js')
-rw-r--r-- | libdeno/libdeno_test.js | 13 |
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; +} |