code: private void ensureTyped(Node n, JSType type) {
      // Make sure FUNCTION nodes always get function type.
      checkState(!n.isFunction() || type.isFunctionType() || type.isUnknownType());
      if (n.getJSType() == null) {
        n.setJSType(type);
      }
    }
docs: Ensures the node is typed.
  
  @param n The node getting a type assigned to it.
  @param type The type to be assigned.