Re: [whatwg/streams] Check precisely the way that transformer.transform() is called (#689)

ricea commented on this pull request.



> +  return Promise.all([
+    promise_rejects(t, new TypeError(), ts.writable.getWriter().write('a'), 'write() should throw'),
+    promise_rejects(t, new TypeError(), ts.readable.getReader().read(), 'read() should throw')
+  ]);
+}, 'transformer.transform should be checked for undefined before being called');
+
+promise_test(() => {
+  let transformGetterCalls = 0;
+  const ts = new TransformStream({
+    get transform() {
+      ++transformGetterCalls;
+      return (chunk, controller) => controller.enqueue(chunk);
+    }
+  });
+  const writer = ts.writable.getWriter();
+  writer.write('a');

Done.

-- 
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/689#discussion_r105083521

Received on Thursday, 9 March 2017 04:12:30 UTC