Add libdeno.shared global shared ArrayBuffer.

This commit is contained in:
Ryan Dahl 2018-10-24 02:17:10 -04:00
parent 61cda72881
commit 0501330607
10 changed files with 128 additions and 55 deletions

View file

@ -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;
}