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

> +          'ReadableByteStreamController instances can only be created by the ReadableByteStream constructor');
> +    }
> +
> +    const pullFunction = underlyingByteSource['pull'];
> +    if (pullFunction !== undefined && typeof pullFunction !== 'function') {
> +      throw new TypeError('pull property of an underlying byte source must be a function');
> +    }
> +
> +    const pullIntoFunction = underlyingByteSource['pullInto'];
> +    if (pullIntoFunction !== undefined && typeof pullIntoFunction !== 'function') {
> +      throw new TypeError('pullInto property of an underlying byte source must be a function');
> +    }
> +
> +    this._controlledReadableByteStream = controlledReadableByteStream;
> +
> +    this._underlyingByteSource = underlyingByteSource;

This is attempt to satisfy https://github.com/whatwg/streams/issues/312. I've put all the helper stuff (buffering, fragmentation, coalescing) into `ReadableByteStreamController` experimentally. `ReadableByteStream` and `ReadableByteStream.*Reader` doesn't have any variable for these work.

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

Received on Tuesday, 16 June 2015 07:39:46 UTC