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

domenic approved this pull request.

LGTM with minor suggestion.

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

These should probably be in a `t.cleanup(() => { ... })` at the top, just to be safe.

-- 
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#pullrequestreview-73683665

Received on Thursday, 2 November 2017 04:38:00 UTC