Skip to content

Commit b2720c4

Browse files
committed
JS: Use forceLocal to localize MkTypeUse
1 parent 5cfabff commit b2720c4

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

javascript/ql/lib/semmle/javascript/ApiGraphs.qll

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,14 @@ module API {
735735
*/
736736
cached
737737
private module Impl {
738+
private predicate hasTypeUse(string moduleName, string exportName) {
739+
any(TypeAnnotation n).hasUnderlyingType(moduleName, exportName)
740+
}
741+
742+
overlay[local]
743+
private predicate hasTypeUseLocal(string moduleName, string exportName) =
744+
forceLocal(hasTypeUse/2)(moduleName, exportName)
745+
738746
cached
739747
newtype TApiNode =
740748
MkRoot() or
@@ -764,9 +772,7 @@ module API {
764772
} or
765773
MkUse(DataFlow::Node nd) { nd instanceof DataFlow::SourceNode } or
766774
/** A use of a TypeScript type. */
767-
MkTypeUse(string moduleName, string exportName) {
768-
any(TypeAnnotation n).hasUnderlyingType(moduleName, exportName)
769-
} or
775+
MkTypeUse(string moduleName, string exportName) { hasTypeUseLocal(moduleName, exportName) } or
770776
MkSyntheticCallbackArg(DataFlow::InvokeNode nd)
771777

772778
class TDef = MkModuleDef or TNonModuleDef;

0 commit comments

Comments
 (0)