Skip to content

Commit ce3b4a6

Browse files
author
Esben Sparre Andreasen
committed
JS: add additional js/unused-local-variable tests
1 parent 47096bb commit ce3b4a6

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

javascript/ql/test/query-tests/Declarations/UnusedVariable/UnusedVariable.expected

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
| decorated.ts:1:1:1:126 | import ... where'; | Unused import actionHandler. |
22
| decorated.ts:4:10:4:12 | fun | Unused function fun. |
3+
| eval.js:2:9:2:20 | used_by_eval | Unused variable used_by_eval. |
4+
| eval.js:7:9:7:20 | used_by_eval | Unused variable used_by_eval. |
5+
| eval.js:10:9:10:24 | not_used_by_eval | Unused variable not_used_by_eval. |
6+
| eval.js:19:9:19:24 | not_used_by_eval | Unused variable not_used_by_eval. |
37
| externs.js:6:5:6:13 | iAmUnused | Unused variable iAmUnused. |
48
| multi-imports.js:1:1:1:29 | import ... om 'x'; | Unused imports a, b, d. |
59
| multi-imports.js:2:1:2:42 | import ... om 'x'; | Unused imports alphabetically, ordered. |
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
(function(){
2+
var used_by_eval = f();
3+
eval(src);
4+
});
5+
(function(){
6+
eval(src);
7+
var used_by_eval = f();
8+
});
9+
(function(){
10+
var not_used_by_eval = f();
11+
(function(){
12+
eval(src);
13+
})
14+
});
15+
(function(){
16+
(function(){
17+
eval(src);
18+
})
19+
var not_used_by_eval = f();
20+
});

0 commit comments

Comments
 (0)