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 {
56
56
*/
57
57
pragma [ nomagic]
58
58
DataFlow:: SourceNode getFactoryNode ( ) {
59
- result . flowsToExpr ( getLastArgument ( ) ) and
59
+ result = getFactoryNodeInternal ( ) and
60
60
result instanceof DataFlow:: ValueNode
61
61
}
62
62
63
+ private
64
+ DataFlow:: Node getFactoryNodeInternal ( ) {
65
+ result = DataFlow:: valueNode ( getLastArgument ( ) ) or
66
+ result = getFactoryNodeInternal ( ) .getAPredecessor ( )
67
+ }
68
+
63
69
/** Gets the expression defining this module. */
64
70
Expr getModuleExpr ( ) {
65
71
exists ( DataFlow:: Node f | f = getFactoryNode ( ) |
@@ -108,7 +114,7 @@ class AmdModuleDefinition extends CallExpr {
108
114
* Gets the `i`th parameter of the factory function of this module.
109
115
*/
110
116
private SimpleParameter getFactoryParameter ( int i ) {
111
- getFactoryNode ( ) .( DataFlow :: FunctionNode ) . getParameter ( i ) = DataFlow :: parameterNode ( result )
117
+ getFactoryNodeInternal ( ) .asExpr ( ) . ( Function ) . getParameter ( i ) = result
112
118
}
113
119
114
120
/**
You can’t perform that action at this time.
0 commit comments