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

Co-Authored-By: Asger F <316427+asgerf@users.noreply.github.com>
This commit is contained in:
Napalys Klicius
2025-06-10 13:23:31 +02:00
parent 496d8d44eb
commit e46581163a

View File

@@ -183,7 +183,7 @@ predicate hasNoEffect(Expr e) {
e instanceof NullLiteral or
e.(GlobalVarAccess).getName() = "undefined" or
e.(NumberLiteral).getIntValue() = 0 or
e.(UnaryExpr).getOperator() = "void"
e instanceof VoidExpr
) and
// exclude the first statement of a try block
not e = any(TryStmt stmt).getBody().getStmt(0).(ExprStmt).getExpr() and