mirror of
https://github.com/github/codeql.git
synced 2026-05-03 12:45:27 +02:00
JavaScript: Add utility predicate getBasePortal(i).
This iterates the existing `getBasePortal()` predicate `i` times.
This commit is contained in:
@@ -96,6 +96,20 @@ class Portal extends TPortal {
|
||||
cached
|
||||
ReturnPortal getReturn() { result.getBasePortal() = this }
|
||||
|
||||
/**
|
||||
* Gets the `i`th base portal of this portal.
|
||||
*
|
||||
* The `0`th base portal is the portal itself, the `n+1`st base portal is the `n`th base portal
|
||||
* of the portal `p` of which this is a member, instance, parameter, or return portal.
|
||||
*/
|
||||
cached
|
||||
Portal getBasePortal(int i) {
|
||||
i = 0 and
|
||||
result = this
|
||||
or
|
||||
result = this.(CompoundPortal).getBasePortal().getBasePortal(i - 1)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a textual representation of this portal.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user