Skip to content

Commit 841dac1

Browse files
committed
address review feedback
1 parent ad3185c commit 841dac1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

javascript/ql/src/Statements/UseOfReturnlessFunction.ql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@ DataFlow::SourceNode array() { result = array(DataFlow::TypeTracker::end()) }
127127
*/
128128
predicate voidArrayCallback(DataFlow::CallNode call, Function func) {
129129
hasNonVoidCallbackMethod(call.getCalleeName()) and
130-
func = call.getAnArgument().getALocalSource().asExpr() and
131-
1 = count(DataFlow::Node arg | arg = call.getAnArgument() and arg.getALocalSource().asExpr() instanceof Function) and
130+
exists(int index |
131+
index = min(int i | exists(call.getCallback(i))) and
132+
func = call.getCallback(index).getFunction()
133+
) and
132134
returnsVoid(func) and
133135
not isStub(func) and
134136
not alwaysThrows(func) and

0 commit comments

Comments
 (0)