mirror of
https://github.com/github/codeql.git
synced 2026-05-20 06:07:07 +02:00
JS: Use in MissingAwait
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user