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

ricea commented on this pull request.



>    1. Let _controller_ be _stream_.[[writableStreamController]].
-  1. If _controller_ is *undefined*, or both _controller_.[[writing]] and _controller_.[[inClose]] are *false*,
-  perform ! WritableStreamRejectPromisesInReactionToError(_stream_).
-  1. Let _writer_ be _stream_.[[writer]].
-  1. If _writer_ is not undefined,
-    1. If _oldState_ is `"writable"` and !
-    WritableStreamDefaultControllerGetBackpressure(_stream_.[[writableStreamController]]) is *true*, <a>reject</a>
-    _writer_.[[readyPromise]] with _e_.
-    1. Otherwise, set _writer_.[[readyPromise]] to <a>a promise rejected with</a> _e_.
-    1. Set _writer_.[[readyPromise]].[[PromiseIsHandled]] to *true*.
+  1. If _wasAborted_ is *false*, return.
+  1. Perform ! WritableStreamFinishAbort(_stream_, _state_).
+  1. Let _abortRequest_ be _stream_.[[pendingAbortRequest]].
+  1. Set _stream_.[[pendingAbortRequest]] to *undefined*.
+  1. Let _promise_ be ! WritableStreamDefaultControllerAbort(_controller_, _abortRequest_.[[reason]]).
+  1. Transform _promise_ with a fulfillment handler which takes the argument _result_ and <a>resolves</a> _abortRequest_.[[promise]] with _result_ and a rejection handler which takes the argument _reason_ and <a>rejects</a> _abortRequest_.[[promise]] with _reason_.

Linkify Transform? #665 

-- 
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-18109145

Received on Tuesday, 24 January 2017 08:57:59 UTC