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

ricea commented on this pull request.



> +<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]];
+  1. Repeat for each _writeRequest_ that is an element of _stream_.[[writeRequests]],
+    1. <a>Reject</a> _writeRequest_ with _storedError_.
+  1. Set _stream_.[[writeRequest]] to an empty List.
+  1. if _stream_.[[pendingAbortRequest]] is *undefined*,
+    1. Perform !  WritableStreamRejectCloseAndClosedPromiseIfNeeded(_stream_).
+    1. Return.
+  1. Let _abortRequest_ by _stream_.[[pendingAbortRequest]].

I found one of these myself which means I had it wrong in three places. 'y' and 'e' aren't even close to each other on the keyboard. Very odd.

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

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