JS: Use in MissingAwait

This commit is contained in:
Asger F
2025-04-11 13:10:44 +02:00
parent 05212e6042
commit fe06115180

View File

@@ -9,6 +9,7 @@
*/
import javascript
private import semmle.javascript.internal.TypeResolution
/**
* Holds if `call` is a call to an `async` function.
@@ -27,7 +28,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
}