mirror of
https://github.com/github/codeql.git
synced 2026-05-05 13:45:19 +02:00
JS: annotate test file with expected results
This commit is contained in:
@@ -10,95 +10,95 @@
|
||||
var o_ = o;
|
||||
var x_ = x;
|
||||
|
||||
u_ = u_ || e;
|
||||
n_ = n_ || e;
|
||||
o_ = o_ || e;
|
||||
u_ = u_ || e; // NOT OK
|
||||
n_ = n_ || e; // NOT OK
|
||||
o_ = o_ || e; // NOT OK
|
||||
x_ = x_ || e;
|
||||
|
||||
u && u.p;
|
||||
n && n.p;
|
||||
o && o.p;
|
||||
u && u.p; // NOT OK
|
||||
n && n.p; // NOT OK
|
||||
o && o.p; // NOT OK
|
||||
x && x.p;
|
||||
|
||||
u && u();
|
||||
n && n();
|
||||
o && o();
|
||||
u && u(); // NOT OK
|
||||
n && n(); // NOT OK
|
||||
o && o(); // NOT OK
|
||||
x && x();
|
||||
|
||||
!u || u.p;
|
||||
!n || n.p;
|
||||
!o || o.p;
|
||||
!u || u.p; // NOT OK
|
||||
!n || n.p; // NOT OK
|
||||
!o || o.p; // NOT OK
|
||||
!x || x.p;
|
||||
|
||||
!!u && u.p;
|
||||
!!n && n.p;
|
||||
!!o && o.p;
|
||||
!!u && u.p; // NOT OK
|
||||
!!n && n.p; // NOT OK
|
||||
!!o && o.p; // NOT OK
|
||||
!!x && x.p;
|
||||
|
||||
u != undefined && u.p;
|
||||
n != undefined && n.p;
|
||||
o != undefined && o.p;
|
||||
u != undefined && u.p; // NOT OK
|
||||
n != undefined && n.p; // NOT OK
|
||||
o != undefined && o.p; // NOT OK
|
||||
x != undefined && x.p;
|
||||
|
||||
u == undefined || u.p;
|
||||
n == undefined || n.p;
|
||||
o == undefined || o.p;
|
||||
u == undefined || u.p; // NOT OK
|
||||
n == undefined || n.p; // NOT OK
|
||||
o == undefined || o.p; // NOT OK
|
||||
x == undefined || x.p;
|
||||
|
||||
u === undefined || u.p;
|
||||
n === undefined || n.p;
|
||||
o === undefined || o.p; // T, D
|
||||
u === undefined || u.p; // NOT OK
|
||||
n === undefined || n.p; // NOT OK
|
||||
o === undefined || o.p; // NOT OK
|
||||
x === undefined || x.p;
|
||||
|
||||
if (u) {
|
||||
if (u) { // NOT OK
|
||||
u.p;
|
||||
}
|
||||
if (n) {
|
||||
if (n) { // NOT OK
|
||||
n.p;
|
||||
}
|
||||
if (o) {
|
||||
if (o) { // NOT OK
|
||||
o.p;
|
||||
}
|
||||
if (x) {
|
||||
x.p;
|
||||
}
|
||||
|
||||
u? u():_;
|
||||
n? n(): _;
|
||||
o? o(): _;
|
||||
u? u():_; // NOT OK
|
||||
n? n(): _; // NOT OK
|
||||
o? o(): _; // NOT OK
|
||||
x? x(): _;
|
||||
|
||||
if (u !== undefined) {
|
||||
if (u !== undefined) { // NOT OK
|
||||
u.p;
|
||||
}
|
||||
if (n !== undefined) {
|
||||
if (n !== undefined) { // NOT OK
|
||||
n.p;
|
||||
}
|
||||
if (o !== undefined) {
|
||||
if (o !== undefined) { // NOT OK
|
||||
o.p;
|
||||
}
|
||||
if (x !== undefined) {
|
||||
x.p;
|
||||
}
|
||||
|
||||
if (u == undefined){}
|
||||
if (n == undefined){}
|
||||
if (o == undefined){}
|
||||
if (u == undefined){} // NOT OK
|
||||
if (n == undefined){} // NOT OK
|
||||
if (o == undefined){} // NOT OK
|
||||
if (x == undefined){}
|
||||
|
||||
if (u != undefined){}
|
||||
if (n != undefined){}
|
||||
if (o != undefined){}
|
||||
if (u != undefined){} // NOT OK
|
||||
if (n != undefined){} // NOT OK
|
||||
if (o != undefined){} // NOT OK
|
||||
if (x != undefined){}
|
||||
|
||||
if (typeof u === "undefined"){}
|
||||
if (typeof n === "undefined"){}
|
||||
if (typeof o === "undefined"){}
|
||||
if (typeof u === "undefined"){} // NOT OK
|
||||
if (typeof n === "undefined"){} // NOT OK
|
||||
if (typeof o === "undefined"){} // NOT OK
|
||||
if (typeof x === "undefined"){}
|
||||
|
||||
function f() { }
|
||||
typeof f === "function" && f();
|
||||
typeof u === "function" && u();
|
||||
typeof f === "function" && f(); // NOT OK
|
||||
typeof u === "function" && u(); // NOT OK
|
||||
typeof x === "function" && x();
|
||||
|
||||
var empty_array = [];
|
||||
@@ -111,33 +111,33 @@
|
||||
var _true = true;
|
||||
var _false = false;
|
||||
|
||||
empty_array && empty_array.pop();
|
||||
pseudo_empty_array && pseudo_empty_array.pop();
|
||||
non_empty_array && non_empty_array.pop();
|
||||
empty_array && empty_array.pop(); // NOT OK
|
||||
pseudo_empty_array && pseudo_empty_array.pop(); // NOT OK
|
||||
non_empty_array && non_empty_array.pop(); // NOT OK
|
||||
empty_string && empty_string.charAt(0);
|
||||
non_empty_string && non_empty_string.charAt(0);
|
||||
zero && zero();
|
||||
neg && neg();
|
||||
_true && _true();
|
||||
_false && _false();D
|
||||
_false && _false();
|
||||
|
||||
(u !== undefined && u !== null) && u.p;
|
||||
u !== undefined && u !== null && u.p;
|
||||
(u !== undefined && u !== null) && u.p; // NOT OK
|
||||
u !== undefined && u !== null && u.p; // NOT OK
|
||||
|
||||
u != undefined && u != null;
|
||||
u == undefined || u == null;
|
||||
u !== undefined && u !== null;
|
||||
!(u === undefined) && !(u === null);
|
||||
u === undefined || u === null;
|
||||
!(u === undefined || u === null);
|
||||
!(u === undefined) && u !== null;
|
||||
u != undefined && u != null; // NOT OK
|
||||
u == undefined || u == null; // NOT OK
|
||||
u !== undefined && u !== null; // NOT OK
|
||||
!(u === undefined) && !(u === null); // NOT OK
|
||||
u === undefined || u === null; // NOT OK
|
||||
!(u === undefined || u === null); // NOT OK
|
||||
!(u === undefined) && u !== null; // NOT OK
|
||||
u !== undefined && n !== null;
|
||||
u == undefined && u == null;
|
||||
u == undefined && u == null; // NOT OK
|
||||
x == undefined && x == null;
|
||||
|
||||
x === undefined && x === null;
|
||||
x === undefined && x === null; // NOT OK
|
||||
if (x === undefined) {
|
||||
if (x === null) {
|
||||
if (x === null) { // NOT OK
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,16 +153,16 @@
|
||||
}
|
||||
}
|
||||
|
||||
x != undefined && x != null;
|
||||
x != undefined && x != null; // NOT OK
|
||||
if (x != undefined) {
|
||||
if (x != null) {
|
||||
if (x != null) { // NOT OK
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof x !== undefined);
|
||||
if (typeof window !== undefined);
|
||||
if (typeof x !== x);
|
||||
if (typeof x !== u);
|
||||
if (typeof x !== u); // NOT OK
|
||||
|
||||
if (typeof window !== "undefined");
|
||||
if (typeof module !== "undefined");
|
||||
|
||||
Reference in New Issue
Block a user