diff --git a/javascript/ql/lib/semmle/javascript/AMD.qll b/javascript/ql/lib/semmle/javascript/AMD.qll index 3239dba9026d..065b8125f636 100644 --- a/javascript/ql/lib/semmle/javascript/AMD.qll +++ b/javascript/ql/lib/semmle/javascript/AMD.qll @@ -91,7 +91,7 @@ class AmdModuleDefinition extends CallExpr instanceof AmdModuleDefinition::Range Function getFactoryFunction() { TValueNode(result) = this.getFactoryNodeInternal() } private EarlyStageNode getFactoryNodeInternal() { - result = TValueNode(this.getLastArgument()) + result = TValueNode(this.getArgument(_)) or DataFlow::localFlowStep(result, this.getFactoryNodeInternal()) }