Skip to content

Commit 6840384

Browse files
committed
JS: Move some alerts
1 parent ae9e9e0 commit 6840384

File tree

5 files changed

+20
-20
lines changed
  • javascript/ql/test/query-tests/Statements

5 files changed

+20
-20
lines changed

javascript/ql/test/query-tests/Statements/EphemeralLoop/tst.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ while(c){ // $ Alert
77
break;
88
}
99

10-
function f() { // $ Alert
11-
for (; k < numprecincts;) {
10+
function f() {
11+
for (; k < numprecincts;) { // $ Alert
1212
var packet = createPacket(resolution, k, l);
1313
k++;
1414
return packet;

javascript/ql/test/query-tests/Statements/ImplicitReturn/tst.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
function f() { // $ Alert
2-
if (foo())
1+
function f() {
2+
if (foo()) // $ Alert
33
return true;
44
}
55

@@ -95,12 +95,12 @@ function t(n) {
9595
} while("true");
9696
}
9797

98-
var u = function() { // $ Alert
99-
if (foo())
98+
var u = function() {
99+
if (foo()) // $ Alert
100100
return true;
101101
};
102102

103-
function v(b) { // $ Alert
104-
if (b)
103+
function v(b) {
104+
if (b) // $ Alert
105105
return 1;
106106
}

javascript/ql/test/query-tests/Statements/InconsistentLoopOrientation/tst.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
for (j = i - 1; j >= 0; --j) {
33
}
44

5-
for (j = i + 1; j < strLength; --j) { // $ Alert
6-
}
5+
for (j = i + 1; j < strLength; --j) {
6+
} // $ Alert
77

8-
for (var i = 0, l = c.length; i > l; i ++) { // $ Alert
9-
}
8+
for (var i = 0, l = c.length; i > l; i ++) {
9+
} // $ Alert
1010

1111

1212
for (i=lower-1; i>=0; --i)
1313
a[i] = 0;
1414

15-
for (i=upper+1; i<a.length; --i) // $ Alert
16-
a[i] = 0;
15+
for (i=upper+1; i<a.length; --i)
16+
a[i] = 0; // $ Alert

javascript/ql/test/query-tests/Statements/ReturnAssignsLocal/tst.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
function f(x) { // $ Alert
2-
return x = 23;
1+
function f(x) {
2+
return x = 23; // $ Alert
33
}
44

5-
function g() { // $ Alert
5+
function g() {
66
var x;
7-
return x = 23;
7+
return x = 23; // $ Alert
88
}
99

1010

javascript/ql/test/query-tests/Statements/SuspiciousUnusedLoopIterationVariable/tst.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
function countOccurrences(xs, p) { // $ Alert
1+
function countOccurrences(xs, p) {
22
var count = 0;
3-
for (let x of xs)
3+
for (let x of xs) // $ Alert
44
if (p())
55
++count;
66
return count;

0 commit comments

Comments
 (0)