JS: Add more bad promise contexts

This commit is contained in:
Asger F
2020-01-03 14:12:55 +00:00
parent 45524d8b19
commit 30a8769dad
3 changed files with 33 additions and 2 deletions

View File

@@ -46,6 +46,14 @@ predicate isBadPromiseContext(Expr expr) {
expr = any(UnaryExpr e).getOperand()
or
expr = any(UpdateExpr e).getOperand()
or
expr = any(ConditionalExpr e).getCondition()
or
expr = any(IfStmt stmt).getCondition()
or
expr = any(ForInStmt stmt).getIterationDomain()
or
expr = any(IndexExpr e).getIndex()
}
string tryGetPromiseExplanation(Expr e) {