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

domenic approved this pull request.

LGTM with nit

> @@ -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);

I think this will be better as `throw transformStream._storedError`? They're equivalent, but thinking of how we'll write it in spec language, I think we'll say "transforming by a function that throws ... if ..., and otherwise returns ..."

-- 
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#pullrequestreview-64540753

Received on Friday, 22 September 2017 10:37:42 UTC