Re: [whatwg/streams] Add TransformStream tests for re-entrant strategies (#795)

ricea commented on this pull request.



> +      if (calls < 2) {
+        controller.enqueue('b');
+      }
+      return 1;
+    },
+    highWaterMark: Infinity
+  });
+  const writer = ts.writable.getWriter();
+  return Promise.all([writer.write('a'), writer.close()])
+      .then(() => readableStreamToArray(ts.readable))
+      .then(array => assert_array_equals(array, ['b', 'a'], 'array should contain two chunks'));
+}, 'enqueue() inside size() should work');
+
+// The behaviour in this test may seem strange, but it is logical. The call to controller.close() happens while the
+// readable queue is still empty, so the readable transitions to the "closed" state immediately, and the chunk is left
+// stranded in the readable's queue.

Nope, readable's queue. I've changed from one big comment to commenting the individual steps, which will hopefully make it clearer.

-- 
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/795#discussion_r139132588

Received on Friday, 15 September 2017 12:12:46 UTC