tizen beta release
[framework/web/webkit-efl.git] / LayoutTests / fast / dom / Window / script-tests / window-custom-prototype.js
1 description("Test what happens when you set the window's prototype to various values.");
2
3 var originalWindowPrototype = __proto__;
4 var chainPointingBackToWindow = { __proto__: window };
5 var anotherObject = { };
6
7 shouldThrow("__proto__ = window; __proto", "'Error: cyclic __proto__ value'");
8 shouldThrow("__proto__ = chainPointingBackToWindow; __proto__", "'Error: cyclic __proto__ value'");
9 shouldBe("__proto__ = 1; __proto__", "originalWindowPrototype");
10 shouldBe("__proto__ = 'a string'; __proto__", "originalWindowPrototype");
11 shouldBe("__proto__ = anotherObject; __proto__", "anotherObject");
12 shouldThrow("anotherObject.__proto__ = window; __proto__", "'Error: cyclic __proto__ value'");
13 shouldBe("__proto__ = null; __proto__", "null");
14 shouldBe("__proto__ = 1; __proto__", "null");
15 shouldBe("__proto__ = 'a string'; __proto__", "null");
16 shouldBe("__proto__ = anotherObject; __proto__", "anotherObject");
17 shouldBe("__proto__ = originalWindowPrototype; __proto__", "originalWindowPrototype");
18 shouldBe("anotherObject.__proto__ = window; anotherObject.__proto__", "window");