Skip to content

Commit

Permalink
Add a test for proto cycle checking on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
bzbarsky authored and Ms2ger committed Jul 28, 2015
1 parent 12d3e15 commit a426a86
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions js/behaviours/SetPrototypeOf-window.html
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<meta charset=utf-8>
<title>Test for [[SetPrototypeOf]] with Windows</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<script>
test(function() {
assert_throws(new TypeError, function() {
Object.setPrototypeOf(window, Object.create(window));
}, "Setting prototype via setPrototypeOf");

assert_throws(new TypeError, function() {
window.__proto__ = Object.create(window);
}, "Setting prototype via __proto__");
}, "Setting the prototype of a window to something that has the window on its proto chain should throw");
</script>

0 comments on commit a426a86

Please sign in to comment.