Skip to content

Commit 09b6727

Browse files
committed
refactor $.each model
1 parent ce10698 commit 09b6727

File tree

1 file changed

+2
-6
lines changed
  • javascript/ql/src/semmle/javascript

1 file changed

+2
-6
lines changed

javascript/ql/src/semmle/javascript/DOM.qll

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,12 +307,8 @@ module DOM {
307307
)
308308
or
309309
// 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-
)
310+
// purposely not using JQuery::MethodCall to avoid `jquery.each()`.
311+
this = DataFlow::thisNode(JQuery::objectRef().getAMethodCall("each").getCallback(0).getFunction())
316312
}
317313
}
318314
}

0 commit comments

Comments
 (0)