Merge pull request #2868 from asger-semmle/js/missing-await-void

Approved by max-schaefer
This commit is contained in:
semmle-qlci
2020-02-20 10:56:47 +00:00
committed by GitHub
2 changed files with 8 additions and 1 deletions

View File

@@ -43,7 +43,10 @@ predicate isBadPromiseContext(Expr expr) {
or
expr = any(LogicalBinaryExpr e).getLeftOperand()
or
expr = any(UnaryExpr e).getOperand()
exists(UnaryExpr e |
expr = e.getOperand() and
not e instanceof VoidExpr
)
or
expr = any(UpdateExpr e).getOperand()
or

View File

@@ -61,3 +61,7 @@ function useThingPossiblySync(b) {
return thing + "bar"; // NOT OK - but we don't flag it
}
function useThingInVoid() {
void getThing(); // OK
}