[whatwg/streams] Add 'Otherwise' to BYOBReaderRead (#1093)

Currently, in [ReadableStreamBYOBReaderRead](https://streams.spec.whatwg.org/commit-snapshots/41a968974c91e05b20738f77d0b2731ec7391e92/#readable-stream-byob-reader-read), even if the stream.[[state]] is "errored", we still call [ReadableByteStreamControllerPullInto](https://streams.spec.whatwg.org/commit-snapshots/41a968974c91e05b20738f77d0b2731ec7391e92/#readable-byte-stream-controller-pull-into). This causes the second assertion in [AddReadIntoRequest](https://streams.spec.whatwg.org/commit-snapshots/41a968974c91e05b20738f77d0b2731ec7391e92/#readable-stream-add-read-into-request) to fail.

In this change, we wrap the last step of ReadableStreamBYOBReaderRead i.e.

> Return ! ReadableByteStreamControllerPullInto(stream.[[controller]], view, readIntoRequest).

with an "Otherwise" to prevent this from happening.

Fixes https://github.com/whatwg/streams/issues/1091
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/streams/pull/1093

-- Commit Summary --

  * Merge pull request #1 from whatwg/master
  * Merge pull request #2 from whatwg/master
  * Merge pull request #3 from whatwg/master
  * Add 'Otherwise' to BYOBReaderRead

-- File Changes --

    M index.bs (2)

-- Patch Links --

https://github.com/whatwg/streams/pull/1093.patch
https://github.com/whatwg/streams/pull/1093.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/streams/pull/1093

Received on Wednesday, 2 December 2020 01:03:15 UTC