tor-browser

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

stub-fold-add-shapes.js (642B)


      1 function foo(obj) {
      2  return obj.x + obj.y + obj.x + obj.y;
      3 }
      4 function f() {
      5  with ({}) {}
      6  var arr = [{x: 1, y: 0}, {x: 0, y: 1, z: 2}];
      7  var res = 0;
      8  for (var i = 0; i < 10_000; i++) {
      9    var obj = arr[i % arr.length];
     10    res += foo(obj);
     11    if (i === 4_000) {
     12      arr.push({x: 1, y: 2, z: 3, a: 4});
     13    } else if (i === 5_000) {
     14      arr.push({x: 1, y: 3, z: 3, b: 4});
     15    } else if (i === 6_000) {
     16      arr.push({x: 3, y: 2, z: 3, c: 4});
     17    } else if (i === 7_000) {
     18      arr.push({x: 4, y: 1, z: 3, d: 4});
     19    } else if (i === 8_000) {
     20      arr.push({x: 5, y: 3, z: 3, e: 4});
     21    }
     22  }
     23  assertEq(res, 43174);
     24 }
     25 f();