Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d3de6d1

Browse files
committed
JS: Accept other changes to UnusedVariable
1 parent e745f42 commit d3de6d1

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
function sum(xs, i) {
22
var res = 0;
3-
for(;i++<xs.length;) // $ Alert - but flagged by js/unused-index-variable
3+
for(;i++<xs.length;) // OK - flagged by js/unused-index-variable
44
res += xs[0];
55
return res;
66
}

javascript/ql/test/query-tests/Declarations/UnusedVariable/eval.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
var used_by_eval = f();
88
});
99
(function(){
10-
var not_used_by_eval = f();
10+
var not_used_by_eval = f(); // $ Alert
1111
(function(){
1212
eval(src);
1313
})
@@ -16,5 +16,5 @@
1616
(function(){
1717
eval(src);
1818
})
19-
var not_used_by_eval = f();
19+
var not_used_by_eval = f(); // $ Alert
2020
});
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {a, b, c, d} from 'x';
2-
import {ordered, alphabetically} from 'x';
1+
import {a, b, c, d} from 'x'; // $ Alert
2+
import {ordered, alphabetically} from 'x'; // $ Alert
33

44
c();

0 commit comments

Comments
 (0)