Re: [whatwg/streams] Detect if the TransformStream errored inside write() and reject (#799)

domenic commented on this pull request.



> @@ -318,7 +318,12 @@ class TransformStreamDefaultSink {
 
     if (transformStream._backpressure === true) {
       return transformStream._backpressureChangePromise
-          .then(() => TransformStreamTransform(transformStream, chunk));
+          .then(() => {
+            if (transformStream._errored === true) {
+              return Promise.reject(transformStream._storedError);

Reviewing https://github.com/whatwg/streams/pull/800 I see there is a lot of pre-existing code that does return Promise.reject() from inside fulfillment/rejection handlers. So maybe not worth fixing just this one-off, but instead doing a greater alignment when or slightly before you do the spec translation.

-- 
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/799#discussion_r140462821

Received on Friday, 22 September 2017 10:40:33 UTC