JS: Add clarifying comment

This commit is contained in:
Asger F
2025-04-01 16:26:07 +02:00
parent e1784bb10c
commit 4746cfddf2

View File

@@ -866,6 +866,14 @@ module API {
.getAReturn()
)
or
// Handle rest parameters escaping into external code. For example:
//
// function foo(...rest) {
// externalFunc(rest);
// }
//
// Here, 'rest' reaches a def-node at the call to externalFunc, so we need to ensure
// the arguments passed to 'foo' are stored in the 'rest' array.
exists(Function fun, DataFlow::InvokeNode invoke, int argIndex, Parameter rest |
fun.getRestParameter() = rest and
rest.flow() = pred and