summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/arrow-functions/length.js
blob: 53ca3e64df0d0072d7d014e7b62bcd52c97d4edb (plain)
1
2
3
4
5
6
7
8
9
10
11
// Arrow functions have a .length property like ordinary functions.

assertEq((a => a).hasOwnProperty("length"), true);

assertEq((a => a).length, 1);
assertEq((() => 0).length, 0);
assertEq(((a) => 0).length, 1);
assertEq(((a, b) => 0).length, 2);

assertEq(((...arr) => arr).length, 0);
assertEq(((a=1, b=2) => 0).length, 0);