Update javascript/ql/lib/Expressions/ExprHasNoEffect.qll

Co-authored-by: Asger F <asgerf@github.com>
This commit is contained in:
Napalys Klicius
2025-06-10 13:19:48 +02:00
committed by GitHub
parent e6f071ce46
commit 496d8d44eb

View File

@@ -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