tor-browser

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

bug848743-1.js (729B)


      1 function A() {};
      2 A.prototype = [];
      3 
      4 function B() {};
      5 B.prototype = new A();
      6 
      7 function C() {};
      8 C.prototype = new B();
      9 
     10 function D() {};
     11 D.prototype = new C();
     12 
     13 function E() {};
     14 E.prototype = new D();
     15 
     16 function f() {
     17    var o = new B();
     18    for (var i=0; i<10; i++)
     19 o[i] = i;
     20 
     21    var expected = '{"0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9}';
     22    assertEq(JSON.stringify(o), expected);
     23 
     24    var o = new A();
     25    for (var i=0; i<10; i++)
     26 o[i] = i;
     27 
     28    assertEq(JSON.stringify(o), expected);
     29 
     30    var o = new D();
     31    for (var i=0; i<10; i++)
     32 o[i] = i;
     33 
     34    assertEq(JSON.stringify(o), expected);
     35 
     36    var o = new E();
     37    for (var i=0; i<10; i++)
     38 o[i] = i;
     39 
     40    assertEq(JSON.stringify(o), expected);
     41 }
     42 f();