tor-browser

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

regress-327608.js (1105B)


      1 // |reftest| skip-if(xulRuntime.shell)
      2 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 //-----------------------------------------------------------------------------
      8 var BUGNUMBER = 327608;
      9 var summary = 'Do not assume we will find the prototype property';
     10 var actual = 'No Crash';
     11 var expect = 'No Crash';
     12 
     13 printBugNumber(BUGNUMBER);
     14 printStatus (summary);
     15 print('This test runs only in the browser');
     16 
     17 function countProps(obj)
     18 {
     19  var c;
     20  for (var prop in obj)
     21    ++c;
     22  return c;
     23 }
     24 
     25 function init()
     26 {
     27  var inp = document.getElementsByTagName("input")[0];
     28  countProps(inp);
     29  gc();
     30  var blurfun = inp.blur;
     31  blurfun.__proto__ = null;
     32  countProps(blurfun);
     33  reportCompare(expect, actual, summary);
     34  gDelayTestDriverEnd = false;
     35  jsTestDriverEnd();
     36 }
     37 
     38 // delay test driver end
     39 gDelayTestDriverEnd = true;
     40 
     41 document.write('<input>');
     42 window.addEventListener("load", init, false);