tor-browser

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

scalar-replace-array-apply-array-03.js (366B)


      1 function escape() { with ({}) {} }
      2 
      3 function foo(i) {
      4  return i;
      5 }
      6 
      7 function bar(n, ...args) {
      8  escape(args);
      9  return foo.apply({}, args);
     10 }
     11 
     12 // |bar| must be small enough to be inlinable.
     13 assertEq(isSmallFunction(bar), true);
     14 
     15 function baz(a, n) {
     16  return bar(n, n);
     17 }
     18 
     19 var sum = 0;
     20 for (var i = 0; i < 10000; i++) {
     21  sum += baz(0, 1);
     22 }
     23 assertEq(sum, 10000);