File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
javascript/ql/lib/semmle/javascript Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -203,13 +203,22 @@ private class ConstantAmdDependencyPathElement extends PathExpr, ConstantString
203
203
override string getValue ( ) { result = getStringValue ( ) }
204
204
}
205
205
206
+ /**
207
+ * Holds if `nd` is nested inside an AMD module definition.
208
+ */
209
+ private predicate inAmdModuleDefinition ( AstNode nd ) {
210
+ nd .getParent ( ) instanceof AmdModuleDefinition
211
+ or
212
+ inAmdModuleDefinition ( nd .getParent ( ) )
213
+ }
214
+
206
215
/**
207
216
* Holds if `def` is an AMD module definition in `tl` which is not
208
217
* nested inside another module definition.
209
218
*/
210
219
private predicate amdModuleTopLevel ( AmdModuleDefinition def , TopLevel tl ) {
211
220
def .getTopLevel ( ) = tl and
212
- not def . getParent + ( ) instanceof AmdModuleDefinition
221
+ not inAmdModuleDefinition ( def )
213
222
}
214
223
215
224
/**
You can’t perform that action at this time.
0 commit comments