mirror of
https://github.com/github/codeql.git
synced 2026-04-28 10:15:14 +02:00
Ruby: Add missing getCallable() for nested destructured parameters
This commit is contained in:
@@ -7,7 +7,14 @@ private import internal.TreeSitter
|
||||
/** A parameter. */
|
||||
class Parameter extends AstNode, TParameter {
|
||||
/** Gets the callable that this parameter belongs to. */
|
||||
final Callable getCallable() { result.getAParameter() = this }
|
||||
final Callable getCallable() {
|
||||
result.getAParameter() = this
|
||||
or
|
||||
exists(DestructuredParameter parent |
|
||||
this = parent.getAnElement() and
|
||||
result = parent.getCallable()
|
||||
)
|
||||
}
|
||||
|
||||
/** Gets the zero-based position of this parameter. */
|
||||
final int getPosition() { this = any(Callable c).getParameter(result) }
|
||||
|
||||
Reference in New Issue
Block a user