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

> +
> +    if (reader === undefined) {
> +      EnqueueInReadableByteStreamController(this, chunk);
> +    } else {
> +      if (IsReadableByteStreamReader(reader)) {
> +        if (reader._readRequests.length === 0) {
> +          EnqueueInReadableByteStreamController(this, chunk);
> +        } else {
> +          assert(this._queue.length === 0);
> +
> +          const req = reader._readRequests.shift();
> +          // TODO: Detach chunk.
> +          req.resolve(CreateIterResultObject(chunk, false));
> +
> +          if (this._closeRequested === true) {
> +            CloseReadableByteStream(stream);

I am still a little unsure why enqueue() would ever cause a close to happen but I will try to read through it again tomorrow with fresh eyes.

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

Received on Tuesday, 30 June 2015 12:28:54 UTC