Added support for Array.prototype.toSorted function

This commit is contained in:
Napalys
2024-11-08 14:10:55 +01:00
parent def8d75cb8
commit 3f0a54c2e8
3 changed files with 28 additions and 0 deletions

View File

@@ -458,4 +458,18 @@ private module ArrayLibraries {
)
}
}
/**
* A taint propagating data flow edge arising from array transformation operations
* that return a new array instead of modifying the original array in place.
*/
private class ImmutableArrayTransformStep extends TaintTracking::SharedTaintStep {
override predicate heapStep(DataFlow::Node pred, DataFlow::Node succ) {
exists(DataFlow::MethodCallNode call |
call.getMethodName() = "toSorted" and
pred = call.getReceiver() and
succ = call
)
}
}
}