JS: Fixes in DeadStoreOfLocal

This commit is contained in:
Asger F
2019-09-04 11:21:26 +01:00
parent 5573279580
commit 61e1d793df
2 changed files with 5 additions and 4 deletions

View File

@@ -36,6 +36,11 @@ where
exists(v.getAnAccess()) and
// don't flag ambient variable definitions
not dead.(ASTNode).isAmbient() and
// don't flag variables with ambient uses
not exists(LexicalAccess access |
access.getALexicalName() = v.getADeclaration().getALexicalName() and
access.isAmbient()
) and
// don't flag function expressions
not exists(FunctionExpr fe | dead = fe.getId()) and
// don't flag function declarations nested inside blocks or other compound statements;