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
203203 override string getValue ( ) { result = getStringValue ( ) }
204204}
205205
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+
206215/**
207216 * Holds if `def` is an AMD module definition in `tl` which is not
208217 * nested inside another module definition.
209218 */
210219private predicate amdModuleTopLevel ( AmdModuleDefinition def , TopLevel tl ) {
211220 def .getTopLevel ( ) = tl and
212- not def . getParent + ( ) instanceof AmdModuleDefinition
221+ not inAmdModuleDefinition ( def )
213222}
214223
215224/**
You can’t perform that action at this time.
0 commit comments