private boolean isEligibleDefinitionSite ( String name , Node definitionSite ) { switch ( definitionSite . getToken ( ) ) { case GETPROP : case MEMBER_FUNCTION_DEF : case STRING_KEY : break ; default : // No other node types are supported. throw new IllegalArgumentException ( definitionSite . toString ( ) ) ; } // Exporting a method prevents rewrite. CodingConvention codingConvention = compiler . getCodingConvention ( ) ; if ( codingConvention . isExported ( name ) ) { return false ; } if ( ! isPrototypeMethodDefinition ( definitionSite ) ) { return false ; } return true ; }
Determines if a method definition site is eligible for rewrite as a global .