src/com/google/javascript/jscomp/TypeCheck.java
/**
   * Checks whether class has overridden toString() method. All objects has native toString()
   * method but we ignore it as it is not useful so we need user-provided toString() method.
   */
Checks whether class has overridden toString() method. All objects has native toString()
method but we ignore it as it is not useful so we need user-provided toString() method.
Checks whether class has overridden toString () method . All objects has native toString () method but we ignore it as it is not useful so we need user - provided toString () method .
private boolean classHasToString(ObjectType type) {
    Property toStringProperty = type.getOwnSlot("toString");
    if (toStringProperty != null) {
      return toStringProperty.getType().isFunctionType();
    }
    ObjectType parent = type.getImplicitPrototype();
    if (parent != null && !parent.isNativeObjectType()) {
      return classHasToString(parent);
    }
    return false;
  }
private boolean classHasToString ( ObjectType type ) { Property toStringProperty = type . getOwnSlot ( "toString" ) ; if ( toStringProperty != null ) { return toStringProperty . getType ( ) . isFunctionType ( ) ; } ObjectType parent = type . getImplicitPrototype ( ) ; if ( parent != null && ! parent . isNativeObjectType ( ) ) { return classHasToString ( parent ) ; } return false ; }
Checks whether class has overridden toString() method.
Checks whether class has overridden toString () method .