refactor $.each model

This commit is contained in:
Erik Krogh Kristensen
2020-04-23 14:24:56 +02:00
parent ce106981b3
commit 09b6727e6d

View File

@@ -307,12 +307,8 @@ module DOM {
)
or
// A `this` node from a callback given to a `$().each(callback)` call.
exists(DataFlow::MethodCallNode eachCall |
eachCall.getMethodName() = "each" and
eachCall.getReceiver().getALocalSource() = JQuery::objectRef() // purposely not using JQuery::MethodCall to avoid `jquery.each()`.
|
this = DataFlow::thisNode(eachCall.getCallback(0).getFunction())
)
// purposely not using JQuery::MethodCall to avoid `jquery.each()`.
this = DataFlow::thisNode(JQuery::objectRef().getAMethodCall("each").getCallback(0).getFunction())
}
}
}