Re: [whatwg/streams] Unified error handling for WritableStream (#721)

ricea commented on this pull request.



> +  1. Let _writer_ be _stream_.[[writer]].
+  1. If _writer_ is not *undefined*, perform !
+     WritableStreamDefaultWriterEnsureReadyPromiseRejected(_writer_, _reason_).
+  1. If ! WritableStreamHasOperationMarkedInFlight(_stream_) is *false* and _controller_.[[started]] is *true*, perform
+     ! WritableStreamFinishError(_stream_).
+</emu-alg>
+
+<h4 id="writable-stream-finish-error" aoid="WritableStreamFinishError" nothrow>WritableStreamFinishError
+( <var>stream</var> )</h4>
+
+<emu-alg>
+  1. Assert: _stream_.[[state]] is `"erroring"`.
+  1. Assert: ! WritableStreamHasOperationMarkedInFlight(_stream_) is *false*.
+  1. Set _stream_.[[state]] to `"errored"`.
+  1. Perform ! _stream_.[[writableStreamController]].[[ErrorSteps]]().
+  1. Let _storedError_ by _stream_.[[storedError]];

Done.

-- 
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/721#discussion_r109874060

Received on Wednesday, 5 April 2017 09:53:14 UTC