@@ -38,9 +38,7 @@ module Closure {
3838 Expr getAnArgument ( ) { result = getArgument ( _) }
3939 }
4040
41- abstract private class GoogNamespaceRef extends ExprOrStmt {
42- abstract string getNamespaceId ( ) ;
43- }
41+ abstract private class GoogNamespaceRef extends ExprOrStmt { abstract string getClosureNamespace ( ) ; }
4442
4543 /**
4644 * A call to `goog.provide`.
@@ -49,7 +47,7 @@ module Closure {
4947 GoogProvide ( ) { getFunctionName ( ) = "provide" }
5048
5149 /** Gets the identifier of the namespace created by this call. */
52- override string getNamespaceId ( ) { result = getArgument ( 0 ) .getStringValue ( ) }
50+ override string getClosureNamespace ( ) { result = getArgument ( 0 ) .getStringValue ( ) }
5351 }
5452
5553 /**
@@ -59,7 +57,7 @@ module Closure {
5957 GoogRequire ( ) { getFunctionName ( ) = "require" }
6058
6159 /** Gets the identifier of the namespace imported by this call. */
62- override string getNamespaceId ( ) { result = getArgument ( 0 ) .getStringValue ( ) }
60+ override string getClosureNamespace ( ) { result = getArgument ( 0 ) .getStringValue ( ) }
6361 }
6462
6563 private class GoogRequireImport extends GoogRequire , Import {
@@ -80,7 +78,7 @@ module Closure {
8078 }
8179
8280 /** Gets the identifier of the namespace imported by this call. */
83- override string getNamespaceId ( ) { result = getArgument ( 0 ) .getStringValue ( ) }
81+ override string getClosureNamespace ( ) { result = getArgument ( 0 ) .getStringValue ( ) }
8482 }
8583
8684 /**
@@ -97,12 +95,12 @@ module Closure {
9795 /**
9896 * Gets the namespace of this module.
9997 */
100- string getNamespaceId ( ) { result = getModuleDeclaration ( ) .getNamespaceId ( ) }
98+ string getClosureNamespace ( ) { result = getModuleDeclaration ( ) .getClosureNamespace ( ) }
10199
102100 override Module getAnImportedModule ( ) {
103101 exists ( GoogRequireImport imprt |
104102 imprt .getEnclosingModule ( ) = this and
105- result .( ClosureModule ) .getNamespaceId ( ) = imprt .getNamespaceId ( )
103+ result .( ClosureModule ) .getClosureNamespace ( ) = imprt .getClosureNamespace ( )
106104 )
107105 }
108106
@@ -146,19 +144,19 @@ module Closure {
146144
147145 /** Gets the identifier of a namespace required by this module. */
148146 string getARequiredNamespace ( ) {
149- result = getAChildStmt ( ) .( ExprStmt ) .getExpr ( ) .( GoogRequire ) .getNamespaceId ( )
147+ result = getAChildStmt ( ) .( ExprStmt ) .getExpr ( ) .( GoogRequire ) .getClosureNamespace ( )
150148 }
151149
152150 /** Gets the identifer of a namespace provided by this module. */
153- string getAProvidedNamespace ( ) { result = getAChildStmt ( ) .( GoogProvide ) .getNamespaceId ( ) }
151+ string getAProvidedNamespace ( ) { result = getAChildStmt ( ) .( GoogProvide ) .getClosureNamespace ( ) }
154152 }
155153
156154 /**
157155 * Holds if `name` is a closure namespace, including proper namespace prefixes.
158156 */
159157 pragma [ noinline]
160158 predicate isLibraryNamespacePath ( string name ) {
161- exists ( string namespace | namespace = any ( GoogNamespaceRef provide ) .getNamespaceId ( ) |
159+ exists ( string namespace | namespace = any ( GoogNamespaceRef provide ) .getClosureNamespace ( ) |
162160 name = namespace .substring ( 0 , namespace .indexOf ( "." ) )
163161 or
164162 name = namespace
@@ -187,7 +185,7 @@ module Closure {
187185 result = getWrittenLibraryAccessPath ( write )
188186 )
189187 or
190- result = node .asExpr ( ) .( GoogRequire ) .getNamespaceId ( )
188+ result = node .asExpr ( ) .( GoogRequire ) .getClosureNamespace ( )
191189 }
192190
193191 /**
0 commit comments