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

bvisness left a comment (whatwg/streams#1348)

It would be very useful to see what the spec ramifications would be. My prototype in Firefox is a bit of a hack, but does work well enough in common single-threaded cases for testing.

I don't follow, though, why you would need an opt-in on the ReadableStream itself. Yes, a non-transferable buffer could now end up in the `byobRequest`. 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. And besides, it seems unreasonable to expect that every ReadableStream implementation in the wild is future-compatible with all possible options that could ever be added to `byobRequest`.

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

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

Received on Thursday, 14 August 2025 21:14:21 UTC