JS: Add clause to getReturn/getInstance

This commit is contained in:
Asger Feldthaus
2021-01-26 10:14:12 +00:00
parent 432a59185f
commit e6d9cd1905

View File

@@ -840,10 +840,16 @@ module API {
Node getLastParameter() { result = getParameter(getNumArgument() - 1) }
/** Gets the API node for the return value of this call. */
Node getReturn() { result.getAnImmediateUse() = this }
Node getReturn() {
result = callee.getReturn() and
result.getAnImmediateUse() = this
}
/** Gets the API node for the object constructed by this invocation. */
Node getInstance() { result.getAnImmediateUse() = this }
Node getInstance() {
result = callee.getInstance() and
result.getAnImmediateUse() = this
}
}
/** A call connected to the API graph. */