[whatwg/streams] Add some extra asserts to TransformStream to clarify invariants (#809)

It's a subtle point that TransformStreamEnqueueToReadable only ever
changes _backpressure to true, so add an assert for it.

The fact that WritableStream only ever calls sink write() when the state
is "writable" is important to the correct functioning of TransformStream,
so add an assert for that too. Also assert that
_backpressureChangePromise has been initialised in write(), for
consistency with pull().

Also a minor comment fix to TransformStreamError.

No functional changes.
You can view, comment on, or merge this pull request online at:

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

-- Commit Summary --

  * Add some extra asserts to TransformStream to clarify invariants

-- File Changes --

    M reference-implementation/lib/transform-stream.js (12)

-- Patch Links --

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

Received on Monday, 25 September 2017 14:50:19 UTC