Skip to content

Commit 91d28fb

Browse files
committed
cleanup in API-graphs
1 parent 63f087a commit 91d28fb

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

javascript/ql/src/semmle/javascript/ApiGraphs.qll

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -374,15 +374,13 @@ module API {
374374
exists(SSA::implicitInit([nm.getModuleVariable(), nm.getExportsVariable()]))
375375
)
376376
)
377-
or
378-
m = any(CanonicalName n | isDefined(n)).getExternalModuleName()
379377
} or
380378
MkModuleImport(string m) {
381379
imports(_, m)
382380
or
383-
m = any(CanonicalName n | isUsed(n)).getExternalModuleName()
384-
or
385381
any(TypeAnnotation n).hasQualifiedName(m, _)
382+
or
383+
any(Type t).hasUnderlyingType(m, _)
386384
} or
387385
MkClassInstance(DataFlow::ClassNode cls) { cls = trackDefNode(_) and hasSemantics(cls) } or
388386
MkAsyncFuncResult(DataFlow::FunctionNode f) {
@@ -431,20 +429,6 @@ module API {
431429
)
432430
}
433431

434-
private predicate isUsed(CanonicalName n) {
435-
exists(n.(TypeName).getAnAccess()) or
436-
exists(n.(Namespace).getAnAccess())
437-
}
438-
439-
private predicate isDefined(CanonicalName n) {
440-
exists(ASTNode def |
441-
def = n.(TypeName).getADefinition() or
442-
def = n.(Namespace).getADefinition()
443-
|
444-
not def.isAmbient()
445-
)
446-
}
447-
448432
/**
449433
* Holds if `rhs` is the right-hand side of a definition of a node that should have an
450434
* incoming edge from `base` labeled `lbl` in the API graph.

0 commit comments

Comments
 (0)