зеркало из https://github.com/github/codeql.git
model that `this` in $().each(callback) is a DOM-node
This commit is contained in:
Родитель
8de86967aa
Коммит
6897dda614
|
@ -305,6 +305,14 @@ module DOM {
|
|||
call.getNumArgument() = 1 and
|
||||
forex(InferredType t | t = call.getArgument(0).analyze().getAType() | t = TTNumber())
|
||||
)
|
||||
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())
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче