summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/arrow-functions/params-default-2.js
blob: 746911e578574f58476efe82dca6acb6bb2cc96e (plain)
1
2
3
4
5
6
7
8
// Parameter default values work in arrow functions

load(libdir + "asserts.js");

var f = (a=1, b=2, ...rest) => [a, b, rest];
assertDeepEq(f(), [1, 2, []]);
assertDeepEq(f(0, 0), [0, 0, []]);
assertDeepEq(f(0, 1, 1, 2, 3, 5), [0, 1, [1, 2, 3, 5]]);