Skip to content

Commit 9279bfc

Browse files
committed
JS: add test case for arrow functions with duplicate parameter names
1 parent 96748ca commit 9279bfc

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

javascript/ql/test/query-tests/Declarations/UniqueParameterNames/tst.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,5 @@ function f(
1717
x,
1818
x // OK: empty function
1919
) { }
20+
21+
(a, a) => a + a; // OK: for strict mode functions, duplicate parameter names are a syntax error
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
| arrows.js:1:5:1:5 | Error: Argument name clash | Error: Argument name clash |
12
| tst.js:2:12:2:12 | Error: Unterminated string constant | Error: Unterminated string constant |
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
(a, a) => a + a;

0 commit comments

Comments
 (0)