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

ricea commented on this pull request.



> +
+  if (stream._pendingAbortRequest === undefined) {
+    stream._state = 'errored';
+    stream._storedError = reason;
+
+    const writer = stream._writer;
+    if (writer !== undefined) {
+      if (WritableStreamCloseInQueueOrInFlight(stream) === false && stream._backpressure === true) {
+        defaultWriterReadyPromiseReject(writer, reason);
+      } else {
+        defaultWriterReadyPromiseResetToRejected(writer, reason);
+      }
+      writer._readyPromise.catch(() => {});
+    }
+
+    WritableStreamRejectPromisesInReactionToError(stream, reason);
 
     return;
   }
 
   stream._state = 'errored';

I don't understand why this two lines are not shared with line 249 above (ie. moved above the loop condition).

-- 
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#pullrequestreview-25499729

Received on Tuesday, 7 March 2017 12:29:46 UTC