Re: [whatwg/streams] Factor out condition to check pending operation (#672)

domenic commented on this pull request.



>  
   stream._state = 'errored';
   stream._storedError = e;
 
-  if (stream._pendingAbortRequest === undefined && stream._writer !== undefined) {
-    let readyPromiseIsPending = false;
-    if (oldState === 'writable' &&
-        WritableStreamDefaultControllerGetBackpressure(stream._writableStreamController) === true) {
-      readyPromiseIsPending = true;
+  // TODO(tyoshino): Given that writer.abort() fails immediately when the stream has been errored, shouldn't

I'm not sure I completely understand this issue; a quick code snippet or test case illustrating the two alternative sunder discussion would be good.

I'm going to assume the question is, given `const p = var writer.abort(); controller.error();`, should `p` reject immediately, or should it follow the underlying sink's abort() return value?

If my understanding is correct, then my opinion is: if an underlying sink abort is underway already, it seems reasonable to let that run to completion instead of rejecting the writer.abort() promise.


-- 
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/672#discussion_r104999901

Received on Wednesday, 8 March 2017 19:22:46 UTC