MCPcopy Index your code
hub / github.com/nodejs/node / testArrayBufferAsyncSAB

Function testArrayBufferAsyncSAB

test/parallel/test-stream-iter-sharedarraybuffer.js:87–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

85}
86
87async function testArrayBufferAsyncSAB() {
88 const sab = new SharedArrayBuffer(4);
89 new Uint8Array(sab).set([1, 2, 3, 4]);
90 const result = await arrayBuffer(from(sab));
91 assert.ok(result instanceof SharedArrayBuffer || result instanceof ArrayBuffer);
92 assert.deepStrictEqual(new Uint8Array(result), new Uint8Array([1, 2, 3, 4]));
93}
94
95// =============================================================================
96// pipeTo / pipeToSync with SAB source

Calls 4

arrayBufferFunction · 0.50
fromFunction · 0.50
setMethod · 0.45
okMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…