if (!nativeThis) return JS_FALSE;
InstallSetPackageFolder(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval){  nsInstall *nativeThis =    (nsInstall*)JS_GetInstancePrivate(cx, obj, &InstallClass, argv);  if (!nativeThis)    return JS_FALSE;  nsAutoString b0;  JSObject *jsObj;  nsInstallFolder *folder;  *rval = INT_TO_JSVAL(nsInstall::UNEXPECTED_ERROR);  // If there's no private data, this must be the prototype, so ignore  if (nsnull == nativeThis) {    return JS_TRUE;  }  if(argc >= 1)  {    //  public int SetPackageFolder (Object folder);    if ((argv[0] == JSVAL_NULL)  || !JSVAL_IS_OBJECT(argv[0])) //argv[0] MUST be a jsval    {      *rval = INT_TO_JSVAL(nsInstall::INVALID_ARGUMENTS);      nativeThis->SaveError(nsInstall::INVALID_ARGUMENTS);      return JS_TRUE;    }    jsObj = JSVAL_TO_OBJECT(argv[0]);    if (!JS_InstanceOf(cx, jsObj, &FileSpecObjectClass, nsnull))    {      *rval = INT_TO_JSVAL(nsInstall::INVALID_ARGUMENTS);      nativeThis->SaveError(nsInstall::INVALID_ARGUMENTS);      return JS_TRUE;    }    folder = (nsInstallFolder*)JS_GetPrivate(cx, jsObj);    if (!folder)    {      JS_ReportError(cx, "setPackageFolder:Invalid Parameter");      return JS_FALSE;    }    else      if(NS_OK != nativeThis->SetPackageFolder(*folder))        return JS_FALSE;    *rval = JSVAL_ZERO;  }  else  {    JS_ReportError(cx, "Function SetPackageFolder requires 1 parameters");    return JS_FALSE;  }  return JS_TRUE;}