code: 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;
    }
docs: Determines if a method definition site is eligible for rewrite as a global.
  
  <p>In order to be eligible for rewrite, the definition site must:
  
  <ul>
  <li>Not be exported
  <li>Be for a prototype method
  </ul>