mirror of
https://github.com/github/codeql.git
synced 2026-04-25 00:35:20 +02:00
Update javascript/ql/lib/Expressions/ExprHasNoEffect.qll
Co-authored-by: Asger F <asgerf@github.com>
This commit is contained in:
@@ -179,7 +179,7 @@ predicate hasNoEffect(Expr e) {
|
||||
e.getLastToken().getNextToken().getValue() = ":"
|
||||
) and
|
||||
// exclude expressions that are part of a conditional expression
|
||||
not exists(ConditionalExpr cond | e.getParent() = cond |
|
||||
not exists(ConditionalExpr cond | e = cond.getABranch() |
|
||||
e instanceof NullLiteral or
|
||||
e.(GlobalVarAccess).getName() = "undefined" or
|
||||
e.(NumberLiteral).getIntValue() = 0 or
|
||||
|
||||
Reference in New Issue
Block a user