Skip to content

Commit e6d9cd1

Browse files
committed
JS: Add clause to getReturn/getInstance
1 parent 432a591 commit e6d9cd1

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

javascript/ql/src/semmle/javascript/ApiGraphs.qll

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,10 +840,16 @@ module API {
840840
Node getLastParameter() { result = getParameter(getNumArgument() - 1) }
841841

842842
/** Gets the API node for the return value of this call. */
843-
Node getReturn() { result.getAnImmediateUse() = this }
843+
Node getReturn() {
844+
result = callee.getReturn() and
845+
result.getAnImmediateUse() = this
846+
}
844847

845848
/** Gets the API node for the object constructed by this invocation. */
846-
Node getInstance() { result.getAnImmediateUse() = this }
849+
Node getInstance() {
850+
result = callee.getInstance() and
851+
result.getAnImmediateUse() = this
852+
}
847853
}
848854

849855
/** A call connected to the API graph. */

0 commit comments

Comments
 (0)