mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
JS: add test for js/trivial-conditional
This commit is contained in:
@@ -33,3 +33,5 @@
|
||||
| UselessConditionalGood.js:69:12:69:13 | xy | This use of variable 'xy' always evaluates to false. |
|
||||
| UselessConditionalGood.js:85:12:85:13 | xy | This use of variable 'xy' always evaluates to false. |
|
||||
| UselessConditionalGood.js:97:12:97:13 | xy | This use of variable 'xy' always evaluates to false. |
|
||||
| UselessConditionalGood.js:114:8:114:8 | p | This use of variable 'p' always evaluates to false. |
|
||||
| UselessConditionalGood.js:122:8:122:8 | p | This use of variable 'p' always evaluates to false. |
|
||||
|
||||
@@ -99,3 +99,30 @@ function getLastLine(input) {
|
||||
f10(undefined, undefined);
|
||||
|
||||
})();
|
||||
|
||||
(function(){
|
||||
function g(p) {
|
||||
return function() {
|
||||
if (p) { // OK, whitelisted
|
||||
g(p);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function f(p = false) {
|
||||
return function() {
|
||||
if (p) { // OK, whitelisted
|
||||
f(p);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function h(p = false) {
|
||||
(function() {
|
||||
if (p) { // OK, whitelisted
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
h();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user