Skip to content

Commit 229e004

Browse files
committed
JS: Add classHasGlobalName into NameResolution
1 parent 57b040f commit 229e004

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

javascript/ql/lib/semmle/javascript/internal/NameResolution.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,4 +485,10 @@ module NameResolution {
485485
qualifiedName = append(prefix, step)
486486
)
487487
}
488+
489+
pragma[nomagic]
490+
predicate classHasGlobalName(DataFlow::ClassNode cls, string name) {
491+
cls.flowsTo(AccessPath::getAnAssignmentTo(name)) and
492+
not cls.getTopLevel().isExterns() // don't propagate externs classes
493+
}
488494
}

javascript/ql/lib/semmle/javascript/internal/UnderlyingTypes.qll

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,4 @@ module UnderlyingTypes {
119119
// The caller is responsible for handling the class hierarchy.
120120
)
121121
}
122-
123-
pragma[nomagic]
124-
private predicate classHasGlobalName(DataFlow::ClassNode cls, string name) {
125-
cls.flowsTo(AccessPath::getAnAssignmentTo(name)) and
126-
not cls.getTopLevel().isExterns() // don't propagate externs classes
127-
}
128122
}

0 commit comments

Comments
 (0)