Re: [whatwg/streams] Why does the `read` method of `ReadableStreamBYOBReader` class, need to _transfer_ the buffer it is provided? (Issue #1348)

BlackAsLight left a comment (whatwg/streams#1348)

> But if the ReadableStream implementation insists on calling `.transfer()`, then it can just throw/reject, no? No existing code would break, because today you can't pass a SharedArrayBuffer to `ReadableStreamBYOBReader.read` at all.

You have it backwards. Because you can't pass a SharedArrayBuffer to a byob stream currently, code can assume the buffer that's passed in is transferable and call `.transfer()` on it. It would break existing code that is relying on the fact that the buffer being passed in is in-fact transferable.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/issues/1348#issuecomment-3190366095
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/streams/issues/1348/3190366095@github.com>

Received on Friday, 15 August 2025 01:34:40 UTC