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

> +      CloseReadableByteStreamReader(this);
> +    }
> +  }
> +}
> +
> +function CallPull(controller) {
> +  const source = controller._underlyingByteSource;
> +
> +  const pullFunction = source['pull'];
> +  if (pullFunction === undefined) {
> +    return;
> +  }
> +
> +  const stream = controller._controlledReadableByteStream;
> +
> +  if (typeof pullFunction !== 'function') {

Hmm, but that is really just an artifact of how we are implementing. In the spec we would use Call(...) and not .call(...), and of course in the spec error texts don't matter. I think it is better to just consolidate. A real implementation would probably work to have better error messages (and it's quite possible, see e.g. line 694 of ReadableStream2.js in https://codereview.chromium.org/1167343002) but it's not for the spec/reference impl.

In fact, maybe using CallOrNoop here would help clean up? Not sure.

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

Received on Wednesday, 1 July 2015 07:31:09 UTC