if(!ConvertJSValToBool(&b5, cx, argv[5]))
if(JSVAL_IS_BOOLEAN(argv[5]))
InstallAddDirectory(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval){  nsInstall *nativeThis = (nsInstall*)JS_GetPrivate(cx, obj);  PRInt32 nativeRet;  nsAutoString b0;  nsAutoString b1;  nsAutoString b2;  nsAutoString b3;  nsAutoString b4;  JSObject *jsObj;  nsInstallFolder *folder;  PRBool b5;  *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 AddDirectory (String jarSourcePath)    ConvertJSValToStr(b0, cx, argv[0]);           if(NS_OK != nativeThis->AddDirectory(b0, &nativeRet))    {      return JS_FALSE;    }    *rval = INT_TO_JSVAL(nativeRet);  }  else if (argc == 4)                               {    //  public int AddDirectory ( String registryName,    //                            String jarSourcePath,    //                            String localDirSpec,    //                            String relativeLocalPath);     ConvertJSValToStr(b0, cx, argv[0]);    ConvertJSValToStr(b1, cx, argv[1]);    ConvertJSValToStr(b3, cx, argv[3]);    if (argv[2] == JSVAL_NULL || !JSVAL_IS_OBJECT(argv[2])) //argv[2] MUST be a jsval    {      *rval = INT_TO_JSVAL(nsInstall::INVALID_ARGUMENTS);      nativeThis->SaveError(nsInstall::INVALID_ARGUMENTS);      return JS_TRUE;    }    jsObj = JSVAL_TO_OBJECT(argv[2]);    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(NS_OK != nativeThis->AddDirectory(b0, b1, folder, b3, &nativeRet))    {      return JS_FALSE;    }    *rval = INT_TO_JSVAL(nativeRet);  }  else if (argc == 5)                               {    //  public int AddDirectory ( String registryName,    //                            String version,  --OR-- VersionInfo version    //                            String jarSourcePath,    //                            Object localDirSpec,    //                            String relativeLocalPath);     ConvertJSValToStr(b0, cx, argv[0]);    ConvertJSvalToVersionString(b1, cx, argv[1]);    ConvertJSValToStr(b2, cx, argv[2]);    ConvertJSValToStr(b4, cx, argv[4]);    if ((argv[3] == JSVAL_NULL) || !JSVAL_IS_OBJECT(argv[3])) //argv[3] MUST be a jsval    {      *rval = INT_TO_JSVAL(nsInstall::INVALID_ARGUMENTS);      nativeThis->SaveError(nsInstall::INVALID_ARGUMENTS);      return JS_TRUE;    }        jsObj = JSVAL_TO_OBJECT(argv[3]);    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(NS_OK != nativeThis->AddDirectory(b0, b1, b2, folder, b4, &nativeRet))    {        return JS_FALSE;    }        *rval = INT_TO_JSVAL(nativeRet);  }  else if (argc == 6)  {     //   public int AddDirectory (  String registryName,     //                              String version,        --OR--     VersionInfo version,      //                              String jarSourcePath,     //                              Object localDirSpec,     //                              String relativeLocalPath,     //                              Boolean forceUpdate);      ConvertJSValToStr(b0, cx, argv[0]);    ConvertJSvalToVersionString(b1, cx, argv[1]);    ConvertJSValToStr(b2, cx, argv[2]);    ConvertJSValToStr(b4, cx, argv[4]);    if ((argv[3] == JSVAL_NULL) || !JSVAL_IS_OBJECT(argv[3])) //argv[3] MUST be a jsval    {      *rval = INT_TO_JSVAL(nsInstall::INVALID_ARGUMENTS);      nativeThis->SaveError(nsInstall::INVALID_ARGUMENTS);      return JS_TRUE;    }    jsObj = JSVAL_TO_OBJECT(argv[3]);    if (!JS_InstanceOf(cx, jsObj, &FileSpecObjectClass, nsnull))    {      *rval = INT_TO_JSVAL(nsInstall::INVALID_ARGUMENTS);      nativeThis->SaveError(nsInstall::INVALID_ARGUMENTS);      return JS_TRUE;     }    if(!ConvertJSValToBool(&b5, cx, argv[5]))    {      return JS_FALSE;    }    folder = (nsInstallFolder*)JS_GetPrivate(cx, jsObj);    if(NS_OK != nativeThis->AddDirectory(b0, b1, b2, folder, b4, b5, &nativeRet))    {        return JS_FALSE;    }        *rval = INT_TO_JSVAL(nativeRet);  }  else  {    JS_ReportError(cx, "Install.AddDirectory() parameters error");    return JS_FALSE;  }  return JS_TRUE;}