Skip to content
This repository was archived by the owner on Mar 19, 2021. It is now read-only.

Commit c402b99

Browse files
committed
Test setting the prototype of a Window to itself.
1 parent de0e138 commit c402b99

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

js/behaviours/SetPrototypeOf-window.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@
55
<script src="/resources/testharnessreport.js"></script>
66
<div id="log"></div>
77
<script>
8+
test(function() {
9+
assert_throws(new TypeError, function() {
10+
Object.setPrototypeOf(window, window);
11+
}, "Setting the prototype should throw");
12+
}, "Setting the prototype of a window to itself via setPrototypeOf");
13+
14+
test(function() {
15+
assert_throws(new TypeError, function() {
16+
window.__proto__ = window;
17+
}, "Setting the prototype should throw");
18+
}, "Setting the prototype of a window to itself via __proto__");
19+
820
test(function() {
921
assert_throws(new TypeError, function() {
1022
Object.setPrototypeOf(window, Object.create(window));

0 commit comments

Comments
 (0)