tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

NodeList-static-length-getter-tampered-indexOf-3.html (661B)


      1 <!doctype html>
      2 <meta charset="utf-8">
      3 <meta name=timeout content=long>
      4 <title>NodeList (static collection) "length" getter tampered (Array.prototype.indexOf)</title>
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 
      8 <body>
      9 
     10 <script src="support/NodeList-static-length-tampered.js"></script>
     11 <script>
     12 test(() => {
     13    const nodeList = makeStaticNodeList(100);
     14 
     15    for (var i = 0; i < 50; i++) {
     16        if (i === 25)
     17            Object.defineProperty(NodeList.prototype, "length", { get() { return 10; } });
     18 
     19        assert_equals(arrayIndexOfNodeList(nodeList), i >= 25 ? -1 : 50);
     20    }
     21 });
     22 </script>