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

> +    return CancelReadableByteStream(this._ownerReadableByteStream, reason);
> +  }
> +
> +  read(view) {
> +    if (!IsReadableByteStreamByobReader(this)) {
> +      return Promise.reject(
> +        new TypeError(
> +            'ReadableByteStreamByobReader.prototype.read can only be used on a ReadableByteStreamByobReader'));
> +    }
> +
> +    if (view === undefined) {
> +      return Promise.reject(new TypeError('Valid view must be provided'));
> +    }
> +
> +    const ctor = view.constructor;
> +    let elementSize = 1;

Can't we use `ctor.BYTES_PER_ELEMENT`? In spec-speak it looks like https://people.mozilla.org/~jorendorff/es6-draft.html#sec-typedarray.bytes_per_element

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

Received on Thursday, 11 June 2015 20:58:42 UTC