Skip to content

Commit f380898

Browse files
committed
JS: Add test showing duplicate alerts
1 parent 51d143d commit f380898

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

javascript/ql/test/query-tests/LanguageFeatures/NonLinearPattern/NonLinearPattern.expected

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
| ts-test.ts:8:16:8:16 | x | Repeated binding of pattern variable 'x' previously bound $@. | ts-test.ts:8:10:8:10 | x | here |
33
| ts-test.ts:11:10:11:10 | x | Repeated binding of pattern variable 'x' previously bound $@. | ts-test.ts:11:7:11:7 | x | here |
44
| ts-test.ts:21:8:21:13 | string | Repeated binding of pattern variable 'string' previously bound $@. | ts-test.ts:20:8:20:13 | string | here |
5+
| ts-test.ts:32:16:32:16 | x | Repeated binding of pattern variable 'x' previously bound $@. | ts-test.ts:30:12:30:12 | x | here |
6+
| ts-test.ts:34:20:34:20 | x | Repeated binding of pattern variable 'x' previously bound $@. | ts-test.ts:30:12:30:12 | x | here |
7+
| ts-test.ts:34:20:34:20 | x | Repeated binding of pattern variable 'x' previously bound $@. | ts-test.ts:32:16:32:16 | x | here |
58
| tst.js:3:13:3:13 | x | Repeated binding of pattern variable 'x' previously bound $@. | tst.js:3:10:3:10 | x | here |
69
| tst.js:8:16:8:16 | x | Repeated binding of pattern variable 'x' previously bound $@. | tst.js:8:10:8:10 | x | here |
710
| tst.js:11:10:11:10 | x | Repeated binding of pattern variable 'x' previously bound $@. | tst.js:11:7:11:7 | x | here |

javascript/ql/test/query-tests/LanguageFeatures/NonLinearPattern/ts-test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,15 @@ function f({
2424

2525
function g({x, y}: {x: string, y: string}) { // OK
2626
}
27+
28+
function blah(arg) {
29+
var {
30+
x: x,
31+
y: {
32+
x: x, // NOT OK
33+
y: {
34+
x: x // NOT OK
35+
}
36+
}
37+
} = arg;
38+
}

0 commit comments

Comments
 (0)