tor-browser

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

bug1375074.js (451B)


      1 // This forces the VM to start creating unboxed objects and thus stresses a
      2 // particular path into generated code for a specialized unboxed object
      3 // constructor.
      4 
      5 var K = 2000;			// 2000 should be plenty
      6 var s = "[";
      7 var i;
      8 for ( i=0; i < K-1; i++ )
      9    s = s + `{"i":${i}},`;
     10 s += `{"i":${i}}]`;
     11 var v = JSON.parse(s);
     12 
     13 assertEq(v.length == K, true);
     14 
     15 for ( i=0; i < K; i++) {
     16    assertEq(v[i] instanceof Object, true);
     17    assertEq(v[i].i, i);
     18 }