[whatwg/streams] Behaviour of returning a rejection from transformAlgorithm is surprising (#946)

https://streams.spec.whatwg.org/commit-snapshots/51227372cc84846bdcf68312724c4cac6a4b9e58/#create-transform-stream

> The transformAlgorithm and flushAlgorithm algorithms must return promises

If you return a rejection from transformAlgorithm, it errors the `writable` side but leaves the `readable` alone. This is inconsistent with what happens if you return a rejection from `transform()`, and very confusing.

I think the right thing to do is to move the rejection-handling code from [SetUpTransformStreamDefaultControllerFromTransformer](https://streams.spec.whatwg.org/#transform-stream-default-sink-write-algorithm) to [TransformStreamDefaultSinkWriteAlgorithm](https://streams.spec.whatwg.org/#transform-stream-default-sink-write-algorithm). This will make identity transforms slightly less efficient, since they will have unnecessary error-handling added, but I think it is the best solution.

-- 
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/issues/946

Received on Monday, 30 July 2018 13:58:04 UTC