testing/web-platform/tests/dom/collections/HTMLCollection-as-proto-length-get-throws.html
author Boris Zbarsky <bzbarsky@mit.edu>
Tue, 29 Mar 2016 15:49:44 -0400
changeset 290959 2832f35108961d4b602b80950894da8aa5956b88
permissions -rw-r--r--
Add a test for bug 785941. r=ms2ger

<!doctype html>
<meta charset=utf-8>
<title>Make sure browsers throw when getting .length on some random object whose proto is an HTMLCollection</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
test(function() {
  var obj = Object.create(document.getElementsByTagName("script"));
  assert_throws(new TypeError(), function() {
    obj.length;
  });
}, "HTMLcollection as a prototype should not allow getting .length on the base object")
</script>