Re: [whatwg/streams] WritableStream abort logic clean up (#655)

ricea commented on this pull request.



> +  1. Let _state_ be _stream_.[[state]].
+  1. If _stream_.[[pendingAbortRequest]] is not *undefined*, let _wasAborted_ be *true*.
+  1. Otherwise, let _wasAborted_ be *false*.
+  1. If _state_ is `"writable"` and _wasAborted_ is *false* and ! WritableStreamDefaultControllerGetBackpressure(_stream_.[[writableStreamController]]) is *true*, let _readyPromiseIsPending_ be *true*.
+  1. Otherwise, let _readyPromiseIsPending_ be *false*.
+  1. If _wasAborted_ is *true*,
+    1. <a>Reject</a>  _stream_.[[pendingAbortRequest]] with _reason_.
+    1. Set _stream_.[[pendingAbortRequest]] to *undefined*.
+  1. If _state_ is `"errored"`,
+    1. Perform ! WritableStreamRejectClosedPromiseIfAny(_stream_).
+    1. Return.
+  1. Assert: _state_ is `"closing"`.
+  1. Set _stream_.[[state]] to `"errored"`.
+  1. Set _stream_.[[storedError]] to _reason_.
+  1. If _wasAborted_ is *false* and _stream_.[[writer]] is not *undefined*,
+    1. WritableStreamDefaultWriterEnsureReadyPromiseRejectedWith(_stream_.[[writer]], _reason_, _readyPromiseIsPending_).

Again can be on the same line and missing "Perform !"

-- 
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/655#pullrequestreview-18110656

Received on Tuesday, 24 January 2017 09:08:01 UTC