JS: replace .stripParens query uses w. .getUnderlyingValue

This commit is contained in:
Esben Sparre Andreasen
2018-10-15 09:30:41 +02:00
parent 030d9202de
commit 43e215c7af
7 changed files with 14 additions and 14 deletions

View File

@@ -31,10 +31,10 @@ predicate isDefensiveInit(VarAccess va) {
va = o.getLeftOperand().stripParens() and va2.getVariable() = va.getVariable() |
exists (AssignExpr assgn | va2 = assgn.getTarget() |
assgn = o.getRightOperand().stripParens() or
o = assgn.getRhs().stripParens()
o = assgn.getRhs().getUnderlyingValue()
) or
exists (VariableDeclarator vd | va2 = vd.getBindingPattern() |
o = vd.getInit().stripParens()
o = vd.getInit().getUnderlyingValue()
)
)
}