code: static ObjectType getCanonicalInstance(ObjectType obj) {
      FunctionType ctor = obj.getConstructor();
      return ctor == null ? obj : ctor.getInstanceType();
    }
docs: Return an object with the same nominal type as obj,
  but without any possible extra properties that exist on obj.