Skip to content

Commit 496d8d4

Browse files
Napalysasgerf
andauthored
Update javascript/ql/lib/Expressions/ExprHasNoEffect.qll
Co-authored-by: Asger F <[email protected]>
1 parent e6f071c commit 496d8d4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

javascript/ql/lib/Expressions/ExprHasNoEffect.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ predicate hasNoEffect(Expr e) {
179179
e.getLastToken().getNextToken().getValue() = ":"
180180
) and
181181
// exclude expressions that are part of a conditional expression
182-
not exists(ConditionalExpr cond | e.getParent() = cond |
182+
not exists(ConditionalExpr cond | e = cond.getABranch() |
183183
e instanceof NullLiteral or
184184
e.(GlobalVarAccess).getName() = "undefined" or
185185
e.(NumberLiteral).getIntValue() = 0 or

0 commit comments

Comments
 (0)