Re: [whatwg/streams] Do not allow abort to happen when a close is about to happen (#634)

> - I'm not sure immediately returning a promise fulfilled with undefined is correct. What if closing fails? It would be better to return the appropriate underlying sink close promise, but that doesn't exist yet... hmm. Maybe we should just call WritableStreamDefaultControllerClose?

I think it should be delayed **if** we want to keep the behavior that `WritableStreamAbort()` returns a promsie resolved with **undefined**. Even before #655, we specified that `sink.close()` rejection results in erroring the stream. So, it's unknown whether we'll end up with `"errored"` or `"closed"`. I think it's not great to return a fulfilled promise immediately.

Or, we could change `WritableStreamAbort()` to return a promise rejected with a **TypeError** indicating that: the stream has already been requested to `close()` and it's about to or already processing or finished processing the `close()`, and therefore it doesn't make sense to run `WritableStreamAbort()` now.

-- 
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/634#issuecomment-274747956

Received on Tuesday, 24 January 2017 09:10:15 UTC