mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
JS: annotate tests with expectations
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
var o = f1();
|
||||
while (f2()) {
|
||||
if (f4()) {
|
||||
o.p = 42;
|
||||
o.p = 42; // NOT OK
|
||||
break;
|
||||
}
|
||||
f5();
|
||||
@@ -12,8 +12,8 @@
|
||||
|
||||
(function(){
|
||||
var o = f1();
|
||||
o.p1 = o.p1 += 42;
|
||||
o.p2 -= (o.p2 *= 42);
|
||||
o.p1 = o.p1 += 42; // NOT OK
|
||||
o.p2 -= (o.p2 *= 42); // NOT OK
|
||||
});
|
||||
|
||||
(function(){
|
||||
@@ -26,7 +26,7 @@
|
||||
f3();
|
||||
} catch (e) {
|
||||
f4();
|
||||
o.p = 42;
|
||||
o.p = 42; // NOT OK
|
||||
}
|
||||
}
|
||||
o.p = 42;
|
||||
@@ -35,5 +35,5 @@
|
||||
|
||||
(function(){
|
||||
var o = f1();
|
||||
o.p = f2() ? o.p = f3() : f4();
|
||||
o.p = f2() ? o.p = f3() : f4(); // NOT OK
|
||||
});
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
(function(){
|
||||
var o = {};
|
||||
o.pure1 = 42;
|
||||
o.pure1 = 42; // NOT OK
|
||||
o.pure1 = 42;
|
||||
|
||||
o.pure2 = 42;
|
||||
o.pure2 = 42; // NOT OK
|
||||
o.pure2 = 43;
|
||||
|
||||
o.impure3 = 42;
|
||||
f();
|
||||
o.impure3 = 42;
|
||||
|
||||
o.pure4 = 42;
|
||||
o.pure4 = 42; // NOT OK
|
||||
43;
|
||||
o.pure4 = 42;
|
||||
|
||||
o.impure5 = 42;
|
||||
o.impure5 = f();
|
||||
|
||||
o.pure6 = f();
|
||||
o.pure6 = f(); // NOT OK
|
||||
o.pure6 = 42;
|
||||
|
||||
o.pure7 = 42;
|
||||
o.pure7 = 42; // NOT OK
|
||||
if(x){}
|
||||
o.pure7 = 42;
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
o15.pure15_aliasWrite = 42;
|
||||
|
||||
var o16 = x? o: null;
|
||||
o.pure16_simpleAliasWrite = 42;
|
||||
o.pure16_simpleAliasWrite = 42; // NOT OK
|
||||
o16.pure16_simpleAliasWrite = 42;
|
||||
|
||||
var o17 = {
|
||||
@@ -92,7 +92,7 @@
|
||||
o.defaulted2 = 42;
|
||||
|
||||
var o = {};
|
||||
o.pure18 = 42;
|
||||
o.pure18 = 42;
|
||||
o.pure18 = 42; // NOT OK
|
||||
o.pure18 = 42; // NOT OK
|
||||
o.pure18 = 42;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user