We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e6f071c commit 496d8d4Copy full SHA for 496d8d4
javascript/ql/lib/Expressions/ExprHasNoEffect.qll
@@ -179,7 +179,7 @@ predicate hasNoEffect(Expr e) {
179
e.getLastToken().getNextToken().getValue() = ":"
180
) and
181
// exclude expressions that are part of a conditional expression
182
- not exists(ConditionalExpr cond | e.getParent() = cond |
+ not exists(ConditionalExpr cond | e = cond.getABranch() |
183
e instanceof NullLiteral or
184
e.(GlobalVarAccess).getName() = "undefined" or
185
e.(NumberLiteral).getIntValue() = 0 or
0 commit comments