mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
Add libdeno.shared global shared ArrayBuffer.
This commit is contained in:
parent
61cda72881
commit
0501330607
10 changed files with 128 additions and 55 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue