mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
JS: add SourceNode support for chained method calls
This commit is contained in:
@@ -131,6 +131,26 @@ abstract class SourceNode extends DataFlow::Node {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a method call that invokes a method on this node.
|
||||
*
|
||||
* This includes only calls that have the syntactic shape of a method call,
|
||||
* that is, `o.m(...)` or `o[p](...)`.
|
||||
*/
|
||||
DataFlow::CallNode getAMethodCall() {
|
||||
result = getAMethodCall(_)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a chained method call that invokes `methodName` last.
|
||||
*
|
||||
* The chain steps include only calls that have the syntactic shape of a method call,
|
||||
* that is, `o.m(...)` or `o[p](...)`.
|
||||
*/
|
||||
DataFlow::CallNode getAChainedMethodCall(string methodName) {
|
||||
result = getAMethodCall*().getAMethodCall(methodName)
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a `new` call that invokes constructor `constructorName` on this node.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user