Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | load(libdir + "eqArrayHelper.js"); |
michael@0 | 2 | |
michael@0 | 3 | function f1(a, bIs, b=3, ...rest) { |
michael@0 | 4 | assertEq(a, 1); |
michael@0 | 5 | assertEq(bIs, b); |
michael@0 | 6 | assertEqArray(rest, []); |
michael@0 | 7 | } |
michael@0 | 8 | assertEq(f1.length, 2); |
michael@0 | 9 | f1(1, 3); |
michael@0 | 10 | f1(1, 42, 42); |
michael@0 | 11 | function f2(a=rest, ...rest) { |
michael@0 | 12 | assertEq(a, undefined); |
michael@0 | 13 | } |
michael@0 | 14 | f2(); |
michael@0 | 15 | function f3(a=rest, ...rest) { |
michael@0 | 16 | assertEq(a, 1); |
michael@0 | 17 | assertEqArray(rest, [2, 3, 4]); |
michael@0 | 18 | } |
michael@0 | 19 | f3(1, 2, 3, 4); |
michael@0 | 20 | function f4(a=42, ...f) { |
michael@0 | 21 | assertEq(typeof f, "function"); |
michael@0 | 22 | function f() {} |
michael@0 | 23 | } |
michael@0 | 24 | f4() |