Skip to content

Commit 6d82258

Browse files
committed
JS: Only introduce receiver edges for explicit receiver-passing
This is technically orthogonal to incremental API graphs, but factoring it out causes too many conflicts.
1 parent 59df6c5 commit 6d82258

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

javascript/ql/lib/semmle/javascript/ApiGraphs.qll

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,11 @@ module API {
974974
)
975975
}
976976

977+
private DataFlow::Node getReceiverIfExplicit(DataFlow::CallNode call) {
978+
result = call.getReceiver() and
979+
not call instanceof DataFlow::MethodCallNode
980+
}
981+
977982
/**
978983
* Holds if `arg` is passed as the `i`th argument to a use of `base`, either by means of a
979984
* full invocation, or in a partial function application.
@@ -986,7 +991,7 @@ module API {
986991
|
987992
arg = pred.getAnInvocation().getArgument(i - bound)
988993
or
989-
arg = pred.getACall().getReceiver() and
994+
arg = getReceiverIfExplicit(pred.getACall()) and
990995
bound = 0 and
991996
i = -1
992997
or

0 commit comments

Comments
 (0)