mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
JS: add test cases
This commit is contained in:
@@ -15,7 +15,8 @@
|
||||
| UselessConditional.js:65:5:65:5 | x | Variable 'x' always evaluates to true here. |
|
||||
| UselessConditional.js:76:13:76:13 | x | Variable 'x' always evaluates to true here. |
|
||||
| UselessConditional.js:82:13:82:13 | x | Variable 'x' always evaluates to true here. |
|
||||
| UselessConditional.js:89:10:89:16 | x, true | This expression always evaluates to true. |
|
||||
| UselessConditional.js:94:16:94:16 | x | Variable 'x' always evaluates to false here. |
|
||||
| UselessConditional.js:101:18:101:18 | x | Variable 'x' always evaluates to false here. |
|
||||
| UselessConditionalGood.js:58:12:58:13 | x2 | Variable 'x2' always evaluates to false here. |
|
||||
| UselessConditionalGood.js:69:12:69:13 | xy | Variable 'xy' always evaluates to false here. |
|
||||
| UselessConditionalGood.js:85:12:85:13 | xy | Variable 'xy' always evaluates to false here. |
|
||||
|
||||
@@ -89,4 +89,17 @@ async function awaitFlow(){
|
||||
if ((x, true));
|
||||
});
|
||||
|
||||
(function (x, y) {
|
||||
if (!x) {
|
||||
while (x) { // NOT OK
|
||||
f();
|
||||
}
|
||||
while (true) { // OK
|
||||
break;
|
||||
}
|
||||
if (true && true) {} // OK
|
||||
if (y && x) {} // NOT OK
|
||||
}
|
||||
});
|
||||
|
||||
// semmle-extractor-options: --experimental
|
||||
|
||||
Reference in New Issue
Block a user