Re: [streams] Byte stream update, including reference implementation (#361)

> +  }
> +
> +  DetachReadableByteStreamReader(reader);
> +}
> +
> +function DestroyReadableByteStreamController(controller) {
> +  controller._pendingPullIntos = []
> +  controller._queue = [];
> +}
> +
> +function DetachReadableByteStreamReader(reader) {
> +  reader._ownerReadableByteStream._reader = undefined;
> +  reader._ownerReadableByteStream = undefined;
> +}
> +
> +function EnqueueInReadableByteStreamController(controller, chunk) {

Yeah, I also wondered why I didn't use it, but just remembered. The BYOB reader may consume only a part of a chunk in a queue. Since the existing queue-with-sizes machinery is designed to work chunk-wise, we need to shift, update (partially consume), and then unshift.

See `FillPullIntoDescriptorFromQueue()`.

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/361/files#r33675719

Received on Wednesday, 1 July 2015 13:07:11 UTC