Re: [whatwg/streams] Refactor writable stream erroring to be centralized (#705)

tyoshino commented on this pull request.



> @@ -621,6 +596,15 @@ function WritableStreamDefaultWriterCloseWithErrorPropagation(writer) {
   return WritableStreamDefaultWriterClose(writer);
 }
 
+function WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, error) {
+  if (writer._readyPromiseState === 'pending') {

I think I've chosen to exclude the state of the promise intentionally from the condition to determine the action to take here on the promise so that we can see that all the state transitions are not broken (when there's anything wrong, the assertions on promise rejection helper would catch it).

I'm fine with switching to this way given much complexity in doing the promise-state-free calculation, but want you to be aware of the background.

-- 
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/705#pullrequestreview-29379140

Received on Tuesday, 28 March 2017 07:54:00 UTC