tor-browser

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

throw-apply-too-many-args.js (600B)


      1 function g(a, b, c, d) {}
      2 function f(a, b, c)
      3 {
      4  arguments.length = getMaxArgs() + 1;
      5  g.apply(this, arr);
      6 }
      7 let x = [];
      8 x.length = getMaxArgs() + 1;
      9 var args = [[5], [5], [5], [5], [5], [5], [5], [5], [5], [5], [5], x]
     10 try
     11 {
     12  for (var i = 0; i < args.length; i++) { arr = args[i]; f(); }
     13  throw new Error("didn't throw");
     14 }
     15 catch (e)
     16 {
     17  assertEq(e instanceof RangeError, true, "wrong exception: " + e);
     18 }
     19 try
     20 {
     21  for (var i = 0; i < args.length; i++) { arr = args[i]; f(); }
     22  throw new Error("didn't throw");
     23 }
     24 catch (e)
     25 {
     26  assertEq(e instanceof RangeError, true, "wrong exception: " + e);
     27 }