Skip to content

Commit

Permalink
WindowProxy: add same-origin indexed property tests
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk authored Apr 18, 2017
1 parent bda18ad commit 8bb5fdc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
assert_throws(new TypeError(), function() {
window[0] = "foo";
});
assert_throws(new TypeError(), () => Object.defineProperty(window, 0, { value: "bar" }))
assert_equals(window[0],
document.getElementsByTagName("iframe")[0].contentWindow);
});
Expand All @@ -31,7 +32,10 @@
assert_throws(new TypeError(), function() {
window[1] = "foo";
});
assert_throws(new TypeError(), () => Object.defineProperty(window, 1, { value: "bar" }))
assert_equals(window[1], undefined);
assert_equals(Object.getOwnPropertyDescriptor(window, 1), undefined);
assert_equals(delete window[1], true);
});
test(function() {
"use strict";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@
});
test(function() {
window[0] = "foo";
assert_throws(new TypeError(), () => Object.defineProperty(window, 0, { value: "bar" }))
assert_equals(window[0],
document.getElementsByTagName("iframe")[0].contentWindow);
});
test(function() {
window[1] = "foo";
assert_throws(new TypeError(), () => Object.defineProperty(window, 1, { value: "bar" }))
assert_equals(window[1], undefined);
assert_equals(Object.getOwnPropertyDescriptor(window, 1), undefined);
assert_equals(delete window[1], true);
});
test(function() {
var proto = Window.prototype;
Expand Down

0 comments on commit 8bb5fdc

Please sign in to comment.