Add a test for bug 785941. r=ms2ger
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 29 Mar 2016 15:49:44 -0400
changeset 290959 2832f35108961d4b602b80950894da8aa5956b88
parent 290958 27bce8aa7584a46e01f5c1f8a094bc0099643aa3
child 290960 483533fede8d48bcbd06a5541758c81af0c4385c
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersms2ger
bugs785941
milestone48.0a1
Add a test for bug 785941. r=ms2ger
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/dom/collections/HTMLCollection-as-proto-length-get-throws.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -34862,16 +34862,22 @@
                 "=="
               ]
             ],
             "url": "/compat/webkit-text-fill-color-property-001c.html"
           }
         ]
       },
       "testharness": {
+        "dom/collections/HTMLCollection-as-proto-length-get-throws.html": [
+          {
+            "path": "dom/collections/HTMLCollection-as-proto-length-get-throws.html",
+            "url": "/dom/collections/HTMLCollection-as-proto-length-get-throws.html"
+          }
+        ],
         "js/builtins/Promise-incumbent-global.sub.html": [
           {
             "path": "js/builtins/Promise-incumbent-global.sub.html",
             "url": "/js/builtins/Promise-incumbent-global.sub.html"
           }
         ],
         "selection/extend.html": [
           {
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/dom/collections/HTMLCollection-as-proto-length-get-throws.html
@@ -0,0 +1,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>