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 @@ -208,13 +208,22 @@ private class ConstantAmdDependencyPathElement extends PathExpr, ConstantString
208
208
override string getValue ( ) { result = getStringValue ( ) }
209
209
}
210
210
211
+ /**
212
+ * Holds if `nd` is nested inside an AMD module definition.
213
+ */
214
+ private predicate inAmdModuleDefinition ( ASTNode nd ) {
215
+ nd .getParent ( ) instanceof AmdModuleDefinition
216
+ or
217
+ inAmdModuleDefinition ( nd .getParent ( ) )
218
+ }
219
+
211
220
/**
212
221
* Holds if `def` is an AMD module definition in `tl` which is not
213
222
* nested inside another module definition.
214
223
*/
215
224
private predicate amdModuleTopLevel ( AmdModuleDefinition def , TopLevel tl ) {
216
225
def .getTopLevel ( ) = tl and
217
- not def . getParent + ( ) instanceof AmdModuleDefinition
226
+ not inAmdModuleDefinition ( def )
218
227
}
219
228
220
229
/**
You can’t perform that action at this time.
0 commit comments