Re: [whatwg/streams] brand-check transformstream methods (#542)

ricea commented on this pull request.

lgtm with nits. Please wait for domenic's review.

It would be nice to have tests for the brand checks, but I'm sure someone will write some sooner or later.

> @@ -253,18 +279,40 @@ class TransformStreamSource {
 
 class TransformStreamDefaultController {
   constructor(transformStream) {
+    if (IsTransformStream(transformStream) === false) {
+      throw new TypeError('TransformStreamDefaultController can only be ' +
+                          'constructed with a TransformStream instance');
+    }
+
+    if (transformStream._transformStreamController !== undefined) {

I just filed #543. Depending on the outcome, it may mean changing this.

> @@ -208,7 +233,8 @@ class TransformStreamSink {
 
     transformStream._writableDone = true;
 
-    const flushPromise = PromiseInvokeOrNoop(transformStream._transformer, 'flush', [transformStream._controller]);
+    const flushPromise = PromiseInvokeOrNoop(transformStream._transformer,
+                         'flush', [transformStream._transformStreamController]);

This is inconsistent with transformPromise above, where a temporary variable called "controller" is created first. Also startResult, below.

-- 
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/542#pullrequestreview-4636429

Received on Tuesday, 18 October 2016 10:02:44 UTC