Bug 1892041 - Part 1: Update test262 features. r=spidermonkey-reviewers,dminor
[gecko.git] / dom / base / test / test_window_proto.html
blob944f953bc4e251da867806517bb2578f13dd005e
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");
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>