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

domenic commented on this pull request.



> @@ -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);

Nah, this is intended, just a little silly. IMO constructors should only be prohibited from working when doing so would break an invariant (like 1 controller <-> 1 stream). That's not the case here so it's good to have a working constructor, even if it's hidden by default.

-- 
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

Received on Wednesday, 19 October 2016 20:02:33 UTC