summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/dom/collections/HTMLCollection-as-proto-length-get-throws.html
blob: 225c9e61a38835c1d1b90ca11014068e62883a49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
<!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>