code: private Symbol getSymbolForTypeHelper(JSType type, boolean linkToCtor) {
      if (type == null) {
        return null;
      }
  
      if (type.isGlobalThisType()) {
        return globalScope.getSlot(GLOBAL_THIS);
      } else if (type.isNominalConstructor()) {
        return linkToCtor
            ? globalScope.getSlot("Function")
            : getSymbolDeclaredBy(type.toMaybeFunctionType());
      } else if (type.isFunctionPrototypeType()) {
        FunctionType ownerFn = ((ObjectType) type).getOwnerFunction();
        if (!ownerFn.isConstructor() && !ownerFn.isInterface()) {
          return null;
        }
        return linkToCtor ? getSymbolDeclaredBy(ownerFn) : getSymbolForInstancesOf(ownerFn);
      } else if (type.isInstanceType()) {
        FunctionType ownerFn = ((ObjectType) type).getConstructor();
        return linkToCtor ? getSymbolDeclaredBy(ownerFn) : getSymbolForInstancesOf(ownerFn);
      } else if (type.isFunctionType()) {
        return linkToCtor
            ? globalScope.getSlot("Function")
            : globalScope.getQualifiedSlot("Function.prototype");
      } else if (type.autoboxesTo() != null) {
        return getSymbolForTypeHelper(type.autoboxesTo(), linkToCtor);
      } else {
        return null;
      }
    }
docs: Gets all symbols associated with the given type. If there is more that one symbol associated
  with the given type, return null.
  
  @param type The type.
  @param linkToCtor If true, we should link instance types back to their constructor function. If
  false, we should link instance types back to their prototype. See the comments at the top
  of this file for more information on how our internal type system is more granular than
  Symbols.