зеркало из https://github.com/github/codeql.git
Ruby: add predicates to DataFlow::ModuleNode to get singleton methods
This commit is contained in:
Родитель
24e83165ee
Коммит
7a3b6f107b
|
@ -1010,6 +1010,23 @@ class ModuleNode instanceof Module {
|
|||
*/
|
||||
MethodNode getAnInstanceMethod() { result = this.getInstanceMethod(_) }
|
||||
|
||||
/**
|
||||
* Gets the singleton method named `name` available in this module, including methods inherited from ancestors.
|
||||
*
|
||||
* Overridden methods are not included.
|
||||
*/
|
||||
MethodNode getSingletonMethod(string name) {
|
||||
result.asCallableAstNode() = super.getAnOwnSingletonMethod() and
|
||||
result.getMethodName() = name
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a singleton method available in this module, including methods inherited from ancestors.
|
||||
*
|
||||
* Overridden methods are not included.
|
||||
*/
|
||||
MethodNode getASingletonMethod() { result = this.getSingletonMethod(_) }
|
||||
|
||||
/**
|
||||
* Gets the enclosing module, as it appears in the qualified name of this module.
|
||||
*
|
||||
|
|
Загрузка…
Ссылка в новой задаче