JS: Add classHasGlobalName into NameResolution

This commit is contained in:
Asger F
2025-06-04 12:26:28 +02:00
parent de9dab9ba3
commit 2a0c7c8801
2 changed files with 6 additions and 6 deletions

View File

@@ -513,4 +513,10 @@ module NameResolution {
qualifiedName = append(prefix, step)
)
}
pragma[nomagic]
predicate classHasGlobalName(DataFlow::ClassNode cls, string name) {
cls.flowsTo(AccessPath::getAnAssignmentTo(name)) and
not cls.getTopLevel().isExterns() // don't propagate externs classes
}
}

View File

@@ -119,10 +119,4 @@ module UnderlyingTypes {
// The caller is responsible for handling the class hierarchy.
)
}
pragma[nomagic]
private predicate classHasGlobalName(DataFlow::ClassNode cls, string name) {
cls.flowsTo(AccessPath::getAnAssignmentTo(name)) and
not cls.getTopLevel().isExterns() // don't propagate externs classes
}
}