tor-browser

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

scalar-replace-array-apply-array-01.js (337B)


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