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