[whatwg/streams] Do not throw when calling RS's controller.error() (#895)

Previously, we would throw an exception when calling controller.error() for a readable stream that was not readable. As noted in #821, this is inconsistent with the behavior introduced for writable and transform streams. The fact that the spec is constantly checking whether it's in the right state, e.g. via ReadableStreamDefaultControllerCallPullIfNeeded, is also a strong indicator that we should not throw.

This simplifies various abstract operations by centralizing state checks and removing ReadableStreamDefaultControllerCallPullIfNeeded.

Closes #821.

Tests incoming, will edit.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Do not throw when calling RS's controller.error()

-- File Changes --

    M index.bs (36)
    M reference-implementation/lib/readable-stream.js (44)
    M reference-implementation/lib/transform-stream.js (4)

-- Patch Links --

https://github.com/whatwg/streams/pull/895.patch
https://github.com/whatwg/streams/pull/895.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/895

Received on Wednesday, 7 March 2018 09:11:26 UTC