Skip to content

Commit b2440d2

Browse files
committed
JS: Use in MissingAwait
1 parent 84439ae commit b2440d2

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
@@ -9,6 +9,7 @@
99
*/
1010

1111
import javascript
12+
private import semmle.javascript.internal.TypeResolution
1213

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

0 commit comments

Comments
 (0)