js/src/jit-test/tests/arguments/defaults-basic.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 function f1(a, bIs, b=3) {
     2     assertEq(a, 1);
     3     assertEq(b, bIs);
     4 }
     5 assertEq(f1.length, 2);
     6 f1(1, 3);
     7 f1(1, 42, 42);
     8 f1(1, 3, undefined);
     9 function f2(a, bIs, cIs, b=3, c=4) {
    10     assertEq(a, 1);
    11     assertEq(b, bIs);
    12     assertEq(c, cIs);
    13 }
    14 assertEq(f2.length, 3);
    15 f2(1, 3, 4);
    16 f2(1, 42, 4, 42);
    17 f2(1, 42, 43, 42, 43);
    18 f2(1, 3, 4, undefined);
    19 f2(1, 42, 4, 42, undefined);
    20 f2(1, 3, 42, undefined, 42);
    21 function f3(a, b, c=4) {
    22     assertEq(a, 1);
    23     assertEq(b, undefined);
    24     assertEq(c, 4);
    25 }
    26 f3(1);
    27 function f4(a, bIs, cIs, b=3, c) {
    28     assertEq(a, 1);
    29     assertEq(b, bIs);
    30     assertEq(c, cIs);
    31 }
    32 assertEq(f4.length, 3);
    33 f4(1, 3, undefined);
    34 f4(1, 4, undefined, 4);
    35 f4(1, 4, 5, 4, 5);

mercurial