- From: Mattias Buelens <notifications@github.com>
- Date: Sun, 12 Apr 2026 09:26:14 -0700
- To: whatwg/streams <streams@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <whatwg/streams/issues/1366/4231912851@github.com>
MattiasBuelens left a comment (whatwg/streams#1366) Indeed, `ReadableStreamBYOBRequest.view` can be `Uint8Array?`. All controller methods that *enqueue* bytes into the stream (i.e. `controller.enqueue()` and `byobRequest.respondWithNewView()`) accept `ArrayBufferView` to allow maximum flexibility for the underlying byte source. However, `byobRequest.view` is provided by the `ReadableStream`, so we should try to be as specific as possible. We "deconstruct" the `ArrayBufferView` provided by `byobReader.read(view)` into a [pull-into descriptor](https://streams.spec.whatwg.org/#pull-into-descriptor) and then we construct a `Uint8Array` on that descriptor's buffer so the underlying byte source can write into it. It looks like the `ArrayBufferView` type was specified when we first switched to Web IDL in caf3cea28134d8be2ec69b6a1105748a7c8d10b5. It looks like this was just a small oversight during that refactor, since we've been constructing `Uint8Array`s since [all the way back in 2016](https://streams.spec.whatwg.org/commit-snapshots/e601d69f3ba40e6f4b5506e4bb1fbe3f3eabf393/#rs-byob-controller-byob-request). 😅 -- Reply to this email directly or view it on GitHub: https://github.com/whatwg/streams/issues/1366#issuecomment-4231912851 You are receiving this because you are subscribed to this thread. Message ID: <whatwg/streams/issues/1366/4231912851@github.com>
Received on Sunday, 12 April 2026 16:26:18 UTC