Skip to content

Commit b1f9db9

Browse files
committed
JS: Make getAFunctionValue follow global access paths
1 parent 8d59df2 commit b1f9db9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

javascript/ql/src/semmle/javascript/dataflow/DataFlow.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,12 @@ module DataFlow {
121121
/** Gets a function value that may reach this node. */
122122
FunctionNode getAFunctionValue() {
123123
result.getAstNode() = analyze().getAValue().(AbstractCallable).getFunction()
124+
or
125+
exists(string name |
126+
GlobalAccessPath::isAssignedInUniqueFile(name) and
127+
GlobalAccessPath::fromRhs(result) = name and
128+
GlobalAccessPath::fromReference(this) = name
129+
)
124130
}
125131

126132
/**

0 commit comments

Comments
 (0)