mirror of
https://github.com/github/codeql.git
synced 2025-12-22 11:46:32 +01:00
JS: ignore useless-expr in first stmt in try block
This commit is contained in:
@@ -156,5 +156,7 @@ predicate hasNoEffect(Expr e) {
|
||||
not exists(fe.getName())
|
||||
) and
|
||||
// exclude block-level flow type annotations. For example: `(name: empty)`.
|
||||
not e.(ParExpr).getExpression().getLastToken().getNextToken().getValue() = ":"
|
||||
not e.(ParExpr).getExpression().getLastToken().getNextToken().getValue() = ":" and
|
||||
// exclude the first statement of a try block
|
||||
not e = any(TryStmt stmt).getBody().getStmt(0).(ExprStmt).getExpr()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user