code: 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;
    }
docs: 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.