mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
JS: Update API usage in MissingAwait
This commit is contained in:
@@ -132,6 +132,11 @@ class TypeNameBindingNode extends NameResolution::Node {
|
||||
* and enums and enum members have this property.
|
||||
*/
|
||||
predicate isSanitizingPrimitiveType() { TypeResolution::isSanitizingPrimitiveType(this) }
|
||||
|
||||
/**
|
||||
* Holds if the given type is a Promise object. Does not hold for unions unless all parts of the union are promises.
|
||||
*/
|
||||
predicate isPromiseType() { TypeResolution::isPromiseType(this) }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
*/
|
||||
|
||||
import javascript
|
||||
private import semmle.javascript.internal.TypeResolution
|
||||
|
||||
/**
|
||||
* Holds if `call` is a call to an `async` function.
|
||||
@@ -30,7 +29,7 @@ predicate isPromise(DataFlow::SourceNode node, boolean nullable) {
|
||||
isAsyncCall(node, nullable)
|
||||
or
|
||||
not isAsyncCall(node, _) and
|
||||
TypeResolution::valueHasPromiseType(node.asExpr()) and
|
||||
node.asExpr().getTypeBinding().isPromiseType() and
|
||||
nullable = true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user