Skip to content

Commit 06e3a01

Browse files
committed
Change definition of getFactoryNodeInternal
Some variants of AMD module such as [sap.ui.define])(https://sdk.openui5.org/api/sap.ui#methods/sap.ui.define) can accept a boolean as its last parameter. Therefore, explicitly state the index of the factory method parameter as `1`.
1 parent 37bcedc commit 06e3a01

File tree

1 file changed

+1
-1
lines changed
  • javascript/ql/lib/semmle/javascript

1 file changed

+1
-1
lines changed

javascript/ql/lib/semmle/javascript/AMD.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class AmdModuleDefinition extends CallExpr instanceof AmdModuleDefinition::Range
9191
Function getFactoryFunction() { TValueNode(result) = this.getFactoryNodeInternal() }
9292

9393
private EarlyStageNode getFactoryNodeInternal() {
94-
result = TValueNode(this.getLastArgument())
94+
result = TValueNode(this.getArgument(1))
9595
or
9696
DataFlow::localFlowStep(result, this.getFactoryNodeInternal())
9797
}

0 commit comments

Comments
 (0)