Skip to content

Commit 2a0c7c8

Browse files
committed
JS: Add classHasGlobalName into NameResolution
1 parent de9dab9 commit 2a0c7c8

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
@@ -513,4 +513,10 @@ module NameResolution {
513513
qualifiedName = append(prefix, step)
514514
)
515515
}
516+
517+
pragma[nomagic]
518+
predicate classHasGlobalName(DataFlow::ClassNode cls, string name) {
519+
cls.flowsTo(AccessPath::getAnAssignmentTo(name)) and
520+
not cls.getTopLevel().isExterns() // don't propagate externs classes
521+
}
516522
}

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)