js/src/jit-test/tests/arguments/defaults-with-rest.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

     1 load(libdir + "eqArrayHelper.js");
     3 function f1(a, bIs, b=3, ...rest) {
     4     assertEq(a, 1);
     5     assertEq(bIs, b);
     6     assertEqArray(rest, []);
     7 }
     8 assertEq(f1.length, 2);
     9 f1(1, 3);
    10 f1(1, 42, 42);
    11 function f2(a=rest, ...rest) {
    12     assertEq(a, undefined);
    13 }
    14 f2();
    15 function f3(a=rest, ...rest) {
    16     assertEq(a, 1);
    17     assertEqArray(rest, [2, 3, 4]);
    18 }
    19 f3(1, 2, 3, 4);
    20 function f4(a=42, ...f)  {
    21     assertEq(typeof f, "function");
    22     function f() {}
    23 }
    24 f4()

mercurial