mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
JS: sharpen js/unneeded-defensive-code for negations and sequences
This commit is contained in:
@@ -70,3 +70,5 @@
|
||||
| tst.js:140:13:140:22 | x === null | This guard always evaluates to false. |
|
||||
| tst.js:156:23:156:31 | x != null | This guard always evaluates to true. |
|
||||
| tst.js:158:13:158:21 | x != null | This guard always evaluates to true. |
|
||||
| tst.js:177:2:177:2 | u | This guard always evaluates to false. |
|
||||
| tst.js:178:2:178:2 | u | This guard always evaluates to false. |
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
| tst.js:175:2:175:2 | u | This use of variable 'u' always evaluates to false. |
|
||||
| tst.js:176:2:176:2 | u | This use of variable 'u' always evaluates to false. |
|
||||
|
||||
@@ -171,4 +171,9 @@
|
||||
if (typeof window !== "undefined" && window.document);
|
||||
if (typeof module !== "undefined" && module.exports);
|
||||
if (typeof global !== "undefined" && global.process);
|
||||
|
||||
u && (f(), u.p);
|
||||
u && (u.p, f()); // technically not OK, but it seems like an unlikely pattern
|
||||
u && !u.p; // NOT OK
|
||||
u && !u(); // NOT OK
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user