Version
main
Platform
Subsystem
stream
What steps will reproduce the bug?
import { arrayBuffer, arrayBufferSync } from 'node:stream/iter';
const shared = new SharedArrayBuffer(4);
const chunk = new Uint8Array(shared);
const asyncResult = await arrayBuffer([chunk]);
const syncResult = arrayBufferSync([chunk]);
console.log('arrayBuffer():', asyncResult.constructor.name);
console.log('arrayBufferSync():', syncResult.constructor.name);
console.log('async instanceof ArrayBuffer:', asyncResult instanceof ArrayBuffer);
console.log('sync instanceof ArrayBuffer:', syncResult instanceof ArrayBuffer);
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
arrayBuffer(): ArrayBuffer
arrayBufferSync(): ArrayBuffer
async instanceof ArrayBuffer: true
sync instanceof ArrayBuffer: true
Spec §11.3 says
- Let bytes be the result of bytes() with source and options.
Spec §11.1 says
- If chunks has exactly one element whose buffer is not shared, return that element.
- Otherwise, concatenate all chunks into a new Uint8Array and return it.
What do you see instead?
arrayBuffer(): SharedArrayBuffer
arrayBufferSync(): SharedArrayBuffer
async instanceof ArrayBuffer: false
sync instanceof ArrayBuffer: false
Additional information
No response
Version
main
Platform
Subsystem
stream
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
Spec §11.3 says
Spec §11.1 says
What do you see instead?
Additional information
No response