revert changes to js/useless-expression

This commit is contained in:
Erik Krogh Kristensen
2019-10-01 16:34:31 +02:00
parent be18adca3c
commit cdde8aea58
2 changed files with 4 additions and 6 deletions

View File

@@ -28,8 +28,6 @@ predicate inVoidContext(Expr e) {
i < n - 1 or inVoidContext(seq)
)
or
exists(ParExpr par | par.getExpression() = e and inVoidContext(par) )
or
exists(ForStmt stmt | e = stmt.getUpdate())
or
exists(ForStmt stmt | e = stmt.getInit() |
@@ -38,8 +36,4 @@ predicate inVoidContext(Expr e) {
)
or
exists(LogicalBinaryExpr logical | e = logical.getRightOperand() and inVoidContext(logical))
or
exists(TypeAssertion assert | assert.getExpression() = e and inVoidContext(assert))
or
exists(UnaryExpr unOp | unOp.getOperator() = "void" and unOp.getOperand() = e)
}

View File

@@ -42,6 +42,10 @@ predicate benignContext(Expr e) {
exists(SeqExpr parent | parent.getAnOperand() = e and benignContext(parent))
or
exists(ParExpr par | par.getExpression() = e and benignContext(par))
or
exists(TypeAssertion assert | assert.getExpression() = e and inVoidContext(assert))
or
exists(UnaryExpr unOp | unOp.getOperator() = "void" and unOp.getOperand() = e)
or
// It is ok (or to be flagged by another query?) to await a non-async function.