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

> +      this._closeRequested = true;
> +
> +      return;
> +    }
> +
> +    const reader = stream._reader;
> +
> +    if (reader === undefined || IsReadableByteStreamReader(reader)) {
> +      CloseReadableByteStream(stream);
> +      return;
> +    }
> +
> +    assert(IsReadableByteStreamByobReader(reader), 'reader must be ReadableByteStreamByobReader');
> +
> +    if (this._pendingPullIntos.length > 0 && this._pendingPullIntos[0].bytesFilled > 0) {
> +      DestroyReadableByteStreamController(this);

I was just kind of hoping there was a way to refactor so that they always happen together, instead of happening together usually except in 2 cases. But I haven't thought about it too hard so probably there is a good reason for it to be separate :)

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

Received on Tuesday, 30 June 2015 12:26:59 UTC