File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
javascript/ql/src/semmle/javascript Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,14 @@ module Closure {
6868 * A module using the Closure module system, declared using `goog.module()` or `goog.declareModuleId()`.
6969 */
7070 class ClosureModule extends Module {
71- ClosureModule ( ) { any ( ClosureModuleDeclaration decl ) .getTopLevel ( ) = this }
71+ ClosureModule ( ) {
72+ // Use AST-based predicate to cut recursive dependencies.
73+ exists ( MethodCallExpr call |
74+ getAStmt ( ) .( ExprStmt ) .getExpr ( ) = call and
75+ call .getReceiver ( ) .( GlobalVarAccess ) .getName ( ) = "goog" and
76+ ( call .getMethodName ( ) = "module" or call .getMethodName ( ) = "declareModuleId" )
77+ )
78+ }
7279
7380 /**
7481 * Gets the call to `goog.module` or `goog.declareModuleId` in this module.
You can’t perform that action at this time.
0 commit comments