private JSType getVarNameType ( Scope scope , String name ) { Var var = scope . getVar ( name ) ; JSType type = null ; if ( var != null ) { Node nameDefinitionNode = var . getNode ( ) ; if ( nameDefinitionNode != null ) { type = nameDefinitionNode . getJSType ( ) ; } } if ( type == null ) { // TODO(bradfordcsmith): Consider throwing an error if the type cannot be found. type = unknownType ; } return type ; }
Look up the correct type for the given name in the given scope .