michael@0: function f1(a, bIs, b=3) { michael@0: assertEq(a, 1); michael@0: assertEq(b, bIs); michael@0: } michael@0: assertEq(f1.length, 2); michael@0: f1(1, 3); michael@0: f1(1, 42, 42); michael@0: f1(1, 3, undefined); michael@0: function f2(a, bIs, cIs, b=3, c=4) { michael@0: assertEq(a, 1); michael@0: assertEq(b, bIs); michael@0: assertEq(c, cIs); michael@0: } michael@0: assertEq(f2.length, 3); michael@0: f2(1, 3, 4); michael@0: f2(1, 42, 4, 42); michael@0: f2(1, 42, 43, 42, 43); michael@0: f2(1, 3, 4, undefined); michael@0: f2(1, 42, 4, 42, undefined); michael@0: f2(1, 3, 42, undefined, 42); michael@0: function f3(a, b, c=4) { michael@0: assertEq(a, 1); michael@0: assertEq(b, undefined); michael@0: assertEq(c, 4); michael@0: } michael@0: f3(1); michael@0: function f4(a, bIs, cIs, b=3, c) { michael@0: assertEq(a, 1); michael@0: assertEq(b, bIs); michael@0: assertEq(c, cIs); michael@0: } michael@0: assertEq(f4.length, 3); michael@0: f4(1, 3, undefined); michael@0: f4(1, 4, undefined, 4); michael@0: f4(1, 4, 5, 4, 5);