Re: [whatwg/streams] WritableStream: clear algorithms once they will no longer be called (#940)

ricea commented on this pull request.



> @@ -919,6 +929,9 @@ function WritableStreamDefaultControllerProcessWrite(controller, chunk) {
       WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);
     },
     reason => {
+      if (stream._state === 'writable') {

Great catch! Actually this check is required, and I failed to add it to the spec text. Without this check, if a write() rejects while an abort() is already in progress, the abortAlgorithm will be cleared too early and so when the time comes to call the underlying source abort() it will fail.

-- 
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/940#discussion_r202516941

Received on Saturday, 14 July 2018 14:49:45 UTC