Re: [whatwg/streams] Update TransformStream API & misc. fixups (#519)

tyoshino commented on this pull request.

lgtm once the 2 comments are addressed. thanks so much.

> -          transformStream._enqueueFunction,
-          transformStream._closeFunction,
-          transformStream._errorFunction);
-    }
-  } catch (e) {
-    if (transformStream._errored === false) {
-      TransformStreamErrorInternal(transformStream, e);
-    }
-  }
-}
-
-function TransformStreamStart(transformStream) {
-  if (transformStream._transformer.start === undefined) {
-    return;
-  }
+  const p = PromiseInvokeOrNoop(transformStream._transformer, 'transform', [chunk, transformStream._controller]);

s/p/transformPromise/

> +        .then(() => { transformDone = true; });
+    },
+    flush() {
+      t.ok(transformDone, 'pending transform promise must resolve before flush is called');
+      return new Promise(resolve => setTimeout(resolve, 50))
+        .then(() => { flushDone = true; });
+    }
+  });
+
+  t.ok(startCalled, 'start is called synchronously');
+
+  const writer = ts.writable.getWriter();
+  writer.write('a');
+  writer.close().then(() => {
+    t.ok(flushDone, 'flushPromise resolved');
+    t.end();

unnecessary as you have t.plan()

-- 
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/519#pullrequestreview-2468778

Received on Monday, 3 October 2016 08:09:18 UTC