TypeScript: fix alerts in ambient code

This commit is contained in:
Asger F
2018-09-04 12:10:04 +01:00
parent af3f855491
commit 7bd53e72dc
4 changed files with 12 additions and 2 deletions

View File

@@ -15,5 +15,6 @@ private import semmle.javascript.dataflow.InferredTypes
from InvokeExpr invk, DataFlow::AnalyzedNode callee
where callee.asExpr() = invk.getCallee() and
forex (InferredType tp | tp = callee.getAType() | tp != TTFunction() and tp != TTClass())
forex (InferredType tp | tp = callee.getAType() | tp != TTFunction() and tp != TTClass()) and
not invk.isAmbient()
select invk, "Callee is not a function: it has type " + callee.ppTypes() + "."