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.

michael@0 1 function f1(a, bIs, b=3) {
michael@0 2 assertEq(a, 1);
michael@0 3 assertEq(b, bIs);
michael@0 4 }
michael@0 5 assertEq(f1.length, 2);
michael@0 6 f1(1, 3);
michael@0 7 f1(1, 42, 42);
michael@0 8 f1(1, 3, undefined);
michael@0 9 function f2(a, bIs, cIs, b=3, c=4) {
michael@0 10 assertEq(a, 1);
michael@0 11 assertEq(b, bIs);
michael@0 12 assertEq(c, cIs);
michael@0 13 }
michael@0 14 assertEq(f2.length, 3);
michael@0 15 f2(1, 3, 4);
michael@0 16 f2(1, 42, 4, 42);
michael@0 17 f2(1, 42, 43, 42, 43);
michael@0 18 f2(1, 3, 4, undefined);
michael@0 19 f2(1, 42, 4, 42, undefined);
michael@0 20 f2(1, 3, 42, undefined, 42);
michael@0 21 function f3(a, b, c=4) {
michael@0 22 assertEq(a, 1);
michael@0 23 assertEq(b, undefined);
michael@0 24 assertEq(c, 4);
michael@0 25 }
michael@0 26 f3(1);
michael@0 27 function f4(a, bIs, cIs, b=3, c) {
michael@0 28 assertEq(a, 1);
michael@0 29 assertEq(b, bIs);
michael@0 30 assertEq(c, cIs);
michael@0 31 }
michael@0 32 assertEq(f4.length, 3);
michael@0 33 f4(1, 3, undefined);
michael@0 34 f4(1, 4, undefined, 4);
michael@0 35 f4(1, 4, 5, 4, 5);

mercurial