File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
javascript/ql/src/semmle/javascript Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -56,10 +56,16 @@ class AmdModuleDefinition extends CallExpr {
5656 */
5757 pragma [ nomagic]
5858 DataFlow:: SourceNode getFactoryNode ( ) {
59- result . flowsToExpr ( getLastArgument ( ) ) and
59+ result = getFactoryNodeInternal ( ) and
6060 result instanceof DataFlow:: ValueNode
6161 }
6262
63+ private
64+ DataFlow:: Node getFactoryNodeInternal ( ) {
65+ result = DataFlow:: valueNode ( getLastArgument ( ) ) or
66+ result = getFactoryNodeInternal ( ) .getAPredecessor ( )
67+ }
68+
6369 /** Gets the expression defining this module. */
6470 Expr getModuleExpr ( ) {
6571 exists ( DataFlow:: Node f | f = getFactoryNode ( ) |
@@ -108,7 +114,7 @@ class AmdModuleDefinition extends CallExpr {
108114 * Gets the `i`th parameter of the factory function of this module.
109115 */
110116 private SimpleParameter getFactoryParameter ( int i ) {
111- getFactoryNode ( ) .( DataFlow :: FunctionNode ) . getParameter ( i ) = DataFlow :: parameterNode ( result )
117+ getFactoryNodeInternal ( ) .asExpr ( ) . ( Function ) . getParameter ( i ) = result
112118 }
113119
114120 /**
You can’t perform that action at this time.
0 commit comments