JS: Treat GeneratedCodeExpr as DirectEval in UnusedVariable.ql

This commit is contained in:
Asger Feldthaus
2021-07-21 09:33:15 +02:00
parent 623557ba39
commit 8a50d99f33

View File

@@ -167,7 +167,7 @@ predicate whitelisted(UnusedLocal v) {
vd.isAmbient()
)
or
exists(DirectEval eval |
exists(Expr eval | eval instanceof DirectEval or eval instanceof GeneratedCodeExpr |
// eval nearby
eval.getEnclosingFunction() = v.getADeclaration().getEnclosingFunction() and
// ... but not on the RHS