Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1d994b0 commit 430bf2dCopy full SHA for 430bf2d
2 files changed
javascript/ql/src/Statements/UselessConditional.ql
@@ -62,6 +62,14 @@ predicate isInitialParameterUse(Expr e) {
62
not p.isRestParameter()
63
)
64
or
65
+ // same as above, but for captured variables
66
+ exists(SimpleParameter p, LocalVariable var |
67
+ var = p.getVariable() and
68
+ var.isCaptured() and
69
+ e = var.getAnAccess() and
70
+ not p.isRestParameter()
71
+ )
72
+ or
73
isInitialParameterUse(e.(LogNotExpr).getOperand())
74
}
75
javascript/ql/test/query-tests/Statements/UselessConditional/UselessConditional.js
@@ -79,7 +79,7 @@ async function awaitFlow(){
79
80
function f3(x) {
81
(function(){
82
- x || y // NOT OK
+ x || y // NOT OK, but whitelisted
83
});
84
85
f3(true);
0 commit comments