private void maybeAddGoogScopeUsage ( NodeTraversal t , Node n , Node parent ) { checkState ( NodeUtil . isNameDeclaration ( n ) ) ; if ( n . hasOneChild ( ) && parent == googScopeBlock ) { Node rhs = n . getFirstFirstChild ( ) ; if ( rhs != null && rhs . isQualifiedName ( ) ) { Node root = NodeUtil . getRootOfQualifiedName ( rhs ) ; if ( root . isName ( ) ) { Var var = t . getScope ( ) . getVar ( root . getString ( ) ) ; if ( var == null || ( var . isGlobal ( ) && ! var . isExtern ( ) ) ) { usages . put ( rhs . getQualifiedName ( ) , rhs ) ; } } } } }
var Dog = some . cute . Dog ; counts as a usage of some . cute . Dog if it s immediately inside a goog . scope function .