Merge pull request #508 from esben-semmle/js/indirect-global-call-with-default-arguments

Approved by xiemaisi
This commit is contained in:
semmle-qlci
2018-11-21 16:06:46 +00:00
committed by GitHub
4 changed files with 20 additions and 0 deletions

View File

@@ -50,5 +50,14 @@ where maybeMissingThis(call, intendedTarget, gv)
decl.isNamespaceExport() and
call.getContainer().getEnclosingContainer*() instanceof NamespaceDeclaration
)
or
// call to global function with additional arguments
exists (Function self |
intendedTarget.getBody() = self and
call.getEnclosingFunction() = self and
call.flow().(DataFlow::CallNode).getNumArgument() > self.getNumParameter() and
not self.hasRestParameter() and
not self.usesArgumentsObject()
)
)
select call, "This call refers to a global function, and not the local method $@.", intendedTarget, intendedTarget.getName()