tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

test_window_proto.html (615B)


      1 <!DOCTYPE html>
      2 <meta charset=utf-8>
      3 <title>Test for ...</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <div id="log"></div>
      7 <script>
      8 test(function() {
      9  assert_throws(new TypeError, function() {
     10    Object.setPrototypeOf(window, Object.create(window));
     11  }, "Setting prototype via setPrototypeOf");
     12 
     13  assert_throws(new TypeError, function() {
     14    window.__proto__ = Object.create(window);
     15  }, "Setting prototype via __proto__");
     16 }, "Setting the prototype of a window to something that has the window on its proto chain should throw");
     17 </script>