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

> +  releaseLock() {
> +    if (!IsReadableByteStreamReader(this)) {
> +      throw new TypeError(
> +          'ReadableByteStreamReader.prototype.releaseLock can only be used on a ReadableByteStreamReader');
> +    }
> +
> +    if (this._ownerReadableByteStream === undefined) {
> +      return;
> +    }
> +
> +    if (this._readRequests.length > 0) {
> +      throw new TypeError('Tried to release a reader lock when that reader has pending read() calls un-settled');
> +    }
> +
> +    if (this._ownerReadableByteStream._state === 'errored') {
> +      MarkReadableByteStreamReaderErrored(this, this._ownerReadableByteStream._storedError)

Since we have auto release, actually this line is unreached. I just removed this and replaced the if with assertion. f3be413272042e204083abbf52aa875e9cd753bc

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

Received on Wednesday, 1 July 2015 04:44:08 UTC