code: @VisibleForTesting
    String getReadableJSTypeName(Node n, boolean dereference) {
      JSType type = getJSTypeOrUnknown(n);
      if (dereference) {
        JSType autoboxed = type.autobox();
        if (!autoboxed.isNoType()) {
          type = autoboxed;
        }
      }
  
      String name = getSimpleReadableJSTypeName(type);
      if (name != null) {
        return name;
      }
  
      // If we're analyzing a GETPROP, the property may be inherited by the
      // prototype chain. So climb the prototype chain and find out where
      // the property was originally defined.
      if (n.isGetProp()) {
        ObjectType objectType = getJSTypeOrUnknown(n.getFirstChild()).dereference();
        if (objectType != null) {
          String propName = n.getLastChild().getString();
          if (objectType.getConstructor() != null
              && objectType.getConstructor().isInterface()) {
            objectType = objectType.getTopDefiningInterface(propName);
          } else {
            // classes
            while (objectType != null && !objectType.hasOwnProperty(propName)) {
              objectType = objectType.getImplicitPrototype();
            }
          }
  
          // Don't show complex function names or anonymous types.
          // Instead, try to get a human-readable type name.
          if (objectType != null
              && (objectType.getConstructor() != null
                  || objectType.isFunctionPrototypeType())) {
            return objectType + "." + propName;
          }
        }
      }
  
      if (n.isQualifiedName()) {
        return n.getQualifiedName();
      } else if (type.isFunctionType()) {
        // Don't show complex function names.
        return "function";
      } else {
        return type.toString();
      }
    }
docs: Given a node, get a human-readable name for the type of that node so
  that will be easy for the programmer to find the original declaration.
  
  For example, if SubFoo's property "bar" might have the human-readable
  name "Foo.prototype.bar".
  
  @param n The node.
  @param dereference If true, the type of the node will be dereferenced
  to an Object type, if possible.