Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3ed0f36

Browse files
committed
JS: Use forceLocal to localize MkTypeUse
1 parent 385bb32 commit 3ed0f36

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

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
@@ -772,9 +780,7 @@ module API {
772780
} or
773781
MkUse(DataFlow::Node nd) { nd instanceof DataFlow::SourceNode } or
774782
/** A use of a TypeScript type. */
775-
MkTypeUse(string moduleName, string exportName) {
776-
any(TypeAnnotation n).hasUnderlyingType(moduleName, exportName)
777-
} or
783+
MkTypeUse(string moduleName, string exportName) { hasTypeUseLocal(moduleName, exportName) } or
778784
MkSyntheticCallbackArg(DataFlow::InvokeNode nd)
779785

780786
class TDef = MkModuleDef or TNonModuleDef;

0 commit comments

Comments
 (0)