Skip to content

Commit 6ac35f1

Browse files
committed
JS: Use in MissingAwait
1 parent 4e44fda commit 6ac35f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

javascript/ql/src/Expressions/MissingAwait.ql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
*/
1111

1212
import javascript
13+
private import semmle.javascript.internal.TypeResolution
1314

1415
/**
1516
* Holds if `call` is a call to an `async` function.
@@ -28,7 +29,7 @@ predicate isPromise(DataFlow::SourceNode node, boolean nullable) {
2829
isAsyncCall(node, nullable)
2930
or
3031
not isAsyncCall(node, _) and
31-
node.asExpr().getType() instanceof PromiseType and
32+
TypeResolution::valueHasPromiseType(node.asExpr()) and
3233
nullable = true
3334
}
3435

0 commit comments

Comments
 (0)