OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <body> |
| 4 <script src="../../resources/js-test.js"></script> |
| 5 <a id="testLink"></a> |
| 6 <script> |
| 7 description("This tests verifies that HTMLCollection.namedItem() argument is man
datory"); |
| 8 |
| 9 var testLink = document.getElementById("testLink"); |
| 10 var htmlCollection = document.getElementsByTagName("a"); |
| 11 shouldBe("htmlCollection.__proto__", "HTMLCollection.prototype"); |
| 12 shouldBe("htmlCollection.length", "1"); |
| 13 shouldBe("htmlCollection.namedItem('testLink')", "testLink"); |
| 14 shouldThrow("htmlCollection.namedItem()", '"TypeError: Failed to execute \'named
Item\' on \'HTMLCollection\': 1 argument required, but only 0 present."'); |
| 15 </script> |
| 16 </body> |
| 17 </html> |
OLD | NEW |