Re: [whatwg/streams] In pipeTo spec, the order of checking for shuttingDown disagrees with ref. impl. (#934)

I was able to get the reference implementation to match the standard text and pass the tests. But I did it by adding a new variable, `stopLooping`, which performed the function of stopping reading that `shuttingDown` used to perform.

I essentially had to pretend that

> if **this**.[[state]] is or becomes `"closed"`, then ...

means

> if **this**.[[state]] is or becomes `"closed"`, then ... _unless you already performed these steps, in which case do nothing._

This has made me more convinced that we need to change the standard text to set _shuttingDown_ before waiting for pending writes, not afterwards.

-- 
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/934#issuecomment-403855882

Received on Tuesday, 10 July 2018 15:04:43 UTC