mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
Merge pull request #2868 from asger-semmle/js/missing-await-void
Approved by max-schaefer
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -61,3 +61,7 @@ function useThingPossiblySync(b) {
|
||||
|
||||
return thing + "bar"; // NOT OK - but we don't flag it
|
||||
}
|
||||
|
||||
function useThingInVoid() {
|
||||
void getThing(); // OK
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user