Merge pull request #9695 from asgerf/js/unused-var-template-placeholder

JS: Fix unused variable FP in template placeholders
This commit is contained in:
Asger F
2022-06-24 17:19:35 +02:00
committed by GitHub

View File

@@ -165,6 +165,9 @@ predicate whitelisted(UnusedLocal v) {
or
// ignore ambient declarations - too noisy
vd.isAmbient()
or
// ignore variables in template placeholders, as each placeholder sees a different copy of the variable
vd.getTopLevel() instanceof Templating::TemplateTopLevel
)
or
exists(Expr eval | eval instanceof DirectEval or eval instanceof GeneratedCodeExpr |