summaryrefslogtreecommitdiffstats
path: root/js/src/tests/ecma_6/Function/arrow-has-duplicated.js
blob: 19096ebf885a0a72678c4a8616e667ba541dbaa3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Make sure duplicated name is allowed in non-strict.
function f0(a, a) {
}

// SyntaxError should be thrown if arrow function has duplicated name.
assertThrowsInstanceOf(() => eval(`
(a, a) => {
};
`), SyntaxError);
assertThrowsInstanceOf(() => eval(`
(a, ...a) => {
};
`), SyntaxError);

reportCompare(0, 0, 'ok');