- From: Domenic Denicola <notifications@github.com>
- Date: Thu, 11 Jun 2015 13:31:51 -0700
- To: whatwg/streams <streams@noreply.github.com>
Received on Thursday, 11 June 2015 20:32:19 UTC
> + return new ReadableByteStreamReader(this);
> + }
> +}
> +
> +class ReadableByteStreamController {
> + constructor(controlledReadableByteStream, underlyingByteSource) {
> + if (IsReadableByteStream(controlledReadableByteStream) === false) {
> + throw new TypeError('ReadableByteStreamController can only be constructed with a ReadableByteStream instance');
> + }
> +
> + if (controlledReadableByteStream._controller !== undefined) {
> + throw new TypeError(
> + 'ReadableByteStreamController instances can only be created by the ReadableByteStream constructor');
> + }
> +
> + const pullFunction = underlyingByteSource['pull'];
I prefer letting these fail at call time instead of immediately. The values could change over time and this kind of aggressive type checking is unnecessary.
---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/361/files#r32264727
Received on Thursday, 11 June 2015 20:32:19 UTC