Skip to content

Commit

Permalink
Test setting the prototype of a Window to itself.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ms2ger committed Sep 1, 2015
1 parent 3334c0f commit 0cb0025
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions js/behaviours/SetPrototypeOf-window.html
Expand Up @@ -5,6 +5,18 @@
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function() {
assert_throws(new TypeError, function() {
Object.setPrototypeOf(window, window);
}, "Setting the prototype should throw");
}, "Setting the prototype of a window to itself via setPrototypeOf");

test(function() {
assert_throws(new TypeError, function() {
window.__proto__ = window;
}, "Setting the prototype should throw");
}, "Setting the prototype of a window to itself via __proto__");

test(function() {
assert_throws(new TypeError, function() {
Object.setPrototypeOf(window, Object.create(window));
Expand Down

0 comments on commit 0cb0025

Please sign in to comment.