We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
this
1 parent 8de8696 commit 6897ddaCopy full SHA for 6897dda
javascript/ql/src/semmle/javascript/DOM.qll
@@ -305,6 +305,14 @@ module DOM {
305
call.getNumArgument() = 1 and
306
forex(InferredType t | t = call.getArgument(0).analyze().getAType() | t = TTNumber())
307
)
308
+ or
309
+ // A `this` node from a callback given to a `$().each(callback)` call.
310
+ exists(DataFlow::MethodCallNode eachCall |
311
+ eachCall.getMethodName() = "each" and
312
+ eachCall.getReceiver().getALocalSource() = JQuery::objectRef() // purposely not using JQuery::MethodCall to avoid `jquery.each()`.
313
+ |
314
+ this = DataFlow::thisNode(eachCall.getCallback(0).getFunction())
315
+ )
316
}
317
318
0 commit comments