tor-browser

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

destructuring-after-defaults.js (341B)


      1 load(libdir + "asserts.js");
      2 
      3 function f1(a, bIs, cIs, dIs, b=1, [c], {d}) {
      4    assertEq(a, 1);
      5    assertEq(b, bIs);
      6    assertEq(c, cIs);
      7    assertEq(d, dIs);
      8 }
      9 assertEq(f1.length, 4);
     10 f1(1, 1, 42, 43, undefined, [42], {d: 43});
     11 f1(1, 42, 43, 44, 42, [43], {d: 44});
     12 assertThrowsInstanceOf(function () {
     13  f1(1, 1, 1, 1);
     14 }, TypeError);