Re: [whatwg/streams] Add tests for WritableStreamDefaultWriter and Controller constructors (#544)

tyoshino commented on this pull request.

Nice

> @@ -197,3 +197,15 @@ promise_test(() => {
           assert_equals(writeCount, numberOfWrites, `should have called sink's write ${numberOfWrites} times`));
   });
 }, 'a large queue of writes should be processed completely');
+
+promise_test(() => {
+  const stream = recordingWritableStream();
+  const w = stream.getWriter();
+  const WritableStreamDefaultWriter = w.constructor;
+  w.releaseLock();
+  const writer = new WritableStreamDefaultWriter(stream);

Hmm, this looks something we didn't intend to enable. We could disallow this by letting the constructor to look at some internal slot of the stream which can be set only by getWriter(), e.g. WDYT, @domenic ?

-- 
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/544#pullrequestreview-4812374

Received on Wednesday, 19 October 2016 07:05:33 UTC