JS: Use in MissingAwait

This commit is contained in:
Asger F
2025-04-11 13:10:44 +02:00
parent 4e44fdaa7b
commit 6ac35f1c66

View File

@@ -10,6 +10,7 @@
*/
import javascript
private import semmle.javascript.internal.TypeResolution
/**
* Holds if `call` is a call to an `async` function.
@@ -28,7 +29,7 @@ predicate isPromise(DataFlow::SourceNode node, boolean nullable) {
isAsyncCall(node, nullable)
or
not isAsyncCall(node, _) and
node.asExpr().getType() instanceof PromiseType and
TypeResolution::valueHasPromiseType(node.asExpr()) and
nullable = true
}