Re: [whatwg/streams] Test that TransformStream does not use global constructors (#852)

ricea commented on this pull request.



> +  ReadableStream = function () {
+    throw new Error('Called the global ReadableStream constructor');
+  };
+  WritableStream = function () {
+    throw new Error('Called the global WritableStream constructor');
+  };
+
+  const ts = new TransformStream();
+
+  // Just to be sure, ensure the readable and writable pass brand checks.
+  assert_not_equals(getReader.call(ts.readable), undefined,
+                    'getReader should work when called on ts.readable');
+  assert_not_equals(getWriter.call(ts.writable), undefined,
+                    'getWriter should work when called on ts.writable');
+
+  ReadableStream = oldReadableStream;

That's better, thanks.

-- 
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/852#discussion_r148445835

Received on Thursday, 2 November 2017 05:33:25 UTC