Skip to content

Commit 57b040f

Browse files
committed
JS: Move some predicates into NameResolution
1 parent 496e545 commit 57b040f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

javascript/ql/lib/semmle/javascript/frameworks/Nest.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ module NestJS {
475475

476476
/** Gets the class being referenced at `node` without relying on the call graph. */
477477
private DataFlow::ClassNode getClassFromNode(DataFlow::Node node) {
478-
TypeResolution::trackClassValue(result.getAstNode()) = node.asExpr()
478+
NameResolution::trackClassValue(result.getAstNode()) = node.asExpr()
479479
}
480480

481481
private predicate providerClassPair(

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,10 @@ module NameResolution {
380380
*/
381381
predicate trackModule = ValueFlow::TrackNode<ModuleLike>::track/1;
382382

383+
predicate trackClassValue = ValueFlow::TrackNode<ClassDefinition>::track/1;
384+
385+
predicate trackFunctionValue = ValueFlow::TrackNode<Function>::track/1;
386+
383387
/**
384388
* Holds if `moduleName` appears to start with a package name, as opposed to a relative file import.
385389
*/

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ private import semmle.javascript.internal.UnderlyingTypes
44
private import semmle.javascript.dataflow.internal.sharedlib.SummaryTypeTracker as SummaryTypeTracker
55

66
module TypeResolution {
7-
predicate trackClassValue = ValueFlow::TrackNode<ClassDefinition>::track/1;
8-
97
predicate trackType = TypeFlow::TrackNode<TypeDefinition>::track/1;
108

119
Node trackFunctionType(Function fun) {
@@ -18,8 +16,6 @@ module TypeResolution {
1816
)
1917
}
2018

21-
predicate trackFunctionValue = ValueFlow::TrackNode<Function>::track/1;
22-
2319
/**
2420
* Gets the representative for the type containing the given member.
2521
*

0 commit comments

Comments
 (0)