@@ -15,22 +15,22 @@ module ImportStar {
1515 s = n .getScope ( ) .getEnclosingScope * ( ) and
1616 exists ( potentialImportStarBase ( s ) ) and
1717 // Not already defined in an enclosing scope.
18- not isDefinedLocally ( n , name )
18+ not isDefinedLocally ( n )
1919 }
2020
2121 /** Holds if `n` refers to a variable that is defined in the module in which it occurs. */
22- private predicate isDefinedLocally ( NameNode n , string name ) {
22+ private predicate isDefinedLocally ( NameNode n ) {
2323 // Defined in an enclosing scope
24- exists ( LocalVariable v | v .getId ( ) = name and v .getScope ( ) = n .getScope ( ) .getEnclosingScope * ( ) )
24+ exists ( LocalVariable v | v .getId ( ) = n . getId ( ) and v .getScope ( ) = n .getScope ( ) .getEnclosingScope * ( ) )
2525 or
2626 // Defined as a built-in
27- name = Builtins:: getBuiltinName ( )
27+ n . getId ( ) = Builtins:: getBuiltinName ( )
2828 or
2929 // Defined as a global in this module
30- globalNameDefinedInModule ( name , n .getEnclosingModule ( ) )
30+ globalNameDefinedInModule ( n . getId ( ) , n .getEnclosingModule ( ) )
3131 or
3232 // A non-built-in that still has file-specific meaning
33- name in [ "__name__" , "__package__" ]
33+ n . getId ( ) in [ "__name__" , "__package__" ]
3434 }
3535
3636 /** Holds if a global variable called `name` is assigned a value in the module `m`. */
@@ -50,7 +50,7 @@ module ImportStar {
5050 predicate importStarResolvesTo ( NameNode n , Module m ) {
5151 m = getStarImported + ( n .getEnclosingModule ( ) ) and
5252 globalNameDefinedInModule ( n .getId ( ) , m ) and
53- not isDefinedLocally ( n , n . getId ( ) )
53+ not isDefinedLocally ( n )
5454 }
5555
5656 /**
0 commit comments