JavaScript: address comments

This commit is contained in:
Asger F
2018-09-06 14:55:42 +01:00
parent 269bbc9a1a
commit 3ca7d6b4bf
4 changed files with 66 additions and 3 deletions

View File

@@ -337,7 +337,7 @@ private class LibraryPartialCall extends AdditionalPartialInvokeNode {
override predicate isPartialArgument(DataFlow::Node callback, DataFlow::Node argument, int index) {
callback = getArgument(0) and
exists (DataFlow::ArrayLiteralNode array |
array = getArgument(1) and
array.flowsTo(getArgument(1)) and
argument = array.getElement(index))
}
}

View File

@@ -32,9 +32,9 @@ predicate calls(DataFlow::InvokeNode invk, Function f) {
*
* This only holds for explicitly modeled partial calls.
*/
predicate partiallyCalls(DataFlow::AdditionalPartialInvokeNode invk, DataFlow::Node callback, Function f) {
private predicate partiallyCalls(DataFlow::AdditionalPartialInvokeNode invk, DataFlow::AnalyzedNode callback, Function f) {
invk.isPartialArgument(callback, _, _) and
exists (AbstractFunction callee | callee = callback.analyze().getAValue() |
exists (AbstractFunction callee | callee = callback.getAValue() |
if invk.isIndefinite("global") then
(f = callee.getFunction() and f.getFile() = invk.getFile())
else