[whatwg/streams] "If flushPromise was rejected with reason r, the..." (Issue #1262)

https://streams.spec.whatwg.org/commit-snapshots/b45c0c5a6c66c73c1e17254976e8a271aecc5592/#transform-stream-default-sink-close-algorithm

> If flushPromise was rejected with reason r, then:​
> 
> Perform \! TransformStreamError\(stream, r\)\.
> 
> Throw readable\.\[\[storedError\]\]\.

This may throw an undefined value if _readable_ is closed when the microtask runs after _flushPromise_ is rejected. Maybe we should do something like

1. Let _error_ be _readable_.\[\[storedError\]\] if _readable_.\[\[state\]\] is "errored", or _r_ otherwise.
2. Throw _error_.

What do you think?

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

Message ID: <whatwg/streams/issues/1262@github.com>

Received on Thursday, 23 March 2023 14:01:48 UTC