ensure an indexOf call is equivalent with itself. (getAUse() is used later to find matching indexOf calls)

This commit is contained in:
erik-krogh
2025-01-21 09:42:30 +01:00
parent 905d904543
commit d5529e3a7e
3 changed files with 3 additions and 2 deletions

View File

@@ -44,6 +44,8 @@ class IndexOfCall extends DataFlow::MethodCallNode {
* Gets an `indexOf` call with the same receiver, argument, and method name, including this call itself.
*/
IndexOfCall getAnEquivalentIndexOfCall() {
result = this
or
exists(DataFlow::Node recv, string m |
this.receiverAndMethodName(recv, m) and result.receiverAndMethodName(recv, m)
|