OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../js/resources/js-test-pre.js"></script> | 2 <script src="../../js/resources/js-test-pre.js"></script> |
3 <script> | 3 <script> |
4 | 4 |
5 description("This tests the prototype chain of DOMException objects.") | 5 description("This tests the prototype chain of DOMException objects.") |
6 | 6 |
7 var e; | 7 var e; |
8 try { | 8 try { |
9 document.appendChild(document); | 9 document.appendChild(document); |
10 // raises a HIERARCHY_REQUEST_ERR | 10 // raises a HIERARCHY_REQUEST_ERR |
11 } catch (err) { | 11 } catch (err) { |
12 e = err; | 12 e = err; |
13 } | 13 } |
14 | 14 |
15 shouldBeEqualToString("e.toString()", "HierarchyRequestError: Failed to execute
'appendChild' on 'Node': The new child element contains the parent."); | 15 shouldBeEqualToString("e.toString()", "HierarchyRequestError: Failed to execute
'appendChild' on 'Node': The new child element contains the parent."); |
16 shouldBeEqualToString("Object.prototype.toString.call(e)", "[object DOMException
]"); | 16 shouldBeEqualToString("Object.prototype.toString.call(e)", "[object DOMException
]"); |
17 shouldBeEqualToString("Object.prototype.toString.call(e.__proto__)", "[object DO
MExceptionPrototype]"); | 17 shouldBeEqualToString("Object.prototype.toString.call(e.__proto__)", "[object DO
MExceptionPrototype]"); |
18 shouldBeEqualToString("Object.prototype.toString.call(e.__proto__.__proto__)", "
[object Error]"); | 18 shouldBeEqualToString("Object.prototype.toString.call(e.__proto__.__proto__)", "
[object Error]"); |
19 shouldBeEqualToString("e.constructor.toString()", "function DOMException() { [na
tive code] }"); | 19 shouldBeEqualToString("e.constructor.toString()", "function DOMException() { [na
tive code] }"); |
20 shouldBeTrue("e instanceof DOMException"); | 20 shouldBeTrue("e instanceof DOMException"); |
21 shouldBeTrue("e instanceof Error"); | 21 shouldBeTrue("e instanceof Error"); |
22 shouldBe("e.constructor", "window.DOMException"); | 22 shouldBe("e.constructor", "window.DOMException"); |
23 shouldBe("e.HIERARCHY_REQUEST_ERR", "e.constructor.HIERARCHY_REQUEST_ERR"); | 23 shouldBe("e.HIERARCHY_REQUEST_ERR", "e.constructor.HIERARCHY_REQUEST_ERR"); |
24 shouldBe("e.HIERARCHY_REQUEST_ERR", "3"); | 24 shouldBe("e.HIERARCHY_REQUEST_ERR", "3"); |
25 shouldBe("e.code", "3"); | 25 shouldBe("e.code", "3"); |
26 shouldBeEqualToString("e.name", "HierarchyRequestError"); | 26 shouldBeEqualToString("e.name", "HierarchyRequestError"); |
27 shouldBeEqualToString("e.message", "Failed to execute 'appendChild' on 'Node': T
he new child element contains the parent."); | 27 shouldBeEqualToString("e.message", "Failed to execute 'appendChild' on 'Node': T
he new child element contains the parent."); |
28 | 28 |
29 </script> | 29 </script> |
30 <script src="../../js/resources/js-test-post.js"></script> | |
OLD | NEW |