tor-browser

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

recover-spread-opt-arguments-after-bail.js (411B)


      1 function outer(fn, x, y) {
      2  fn(...arguments);
      3 }
      4 
      5 function inner1(fn, x, y) {
      6  assertEq(fn, inner1);
      7  assertEq(x, y);
      8 }
      9 
     10 function inner2(fn, x, y) {
     11  assertEq(fn, inner2);
     12  assertEq(x, 100);
     13  assertEq(y, 200);
     14 }
     15 
     16 for (let i = 0; i < 100; i++) {
     17  outer(inner1, i, i);
     18 }
     19 
     20 // Call with a different function to cause a bailout. This will lead to
     21 // recovering the |arguments| object.
     22 outer(inner2, 100, 200);