slightly expand the $().each model

This commit is contained in:
Erik Krogh Kristensen
2020-04-23 16:49:47 +02:00
parent 448ed150df
commit ee43db1b58
4 changed files with 16 additions and 2 deletions

View File

@@ -308,7 +308,10 @@ module DOM {
or
// A `this` node from a callback given to a `$().each(callback)` call.
// purposely not using JQuery::MethodCall to avoid `jquery.each()`.
this = DataFlow::thisNode(JQuery::objectRef().getAMethodCall("each").getCallback(0).getFunction())
exists(DataFlow::CallNode eachCall | eachCall = JQuery::objectRef().getAMethodCall("each") |
this = DataFlow::thisNode(eachCall.getCallback(0).getFunction()) or
this = eachCall.getABoundCallbackParameter(0, 1)
)
}
}
}