ConvertJSValToStr(text, cx, argv[0]);           if (argc > 1) ConvertJSValToStr(title, cx, argv[1]);  if(argc > 2) { if(!JSVAL_IS_INT(argv[2])) { JS_ReportError(cx, "Parameter 'aButtonFlags' must be a number"); return JS_FALSE; } buttonFlags = JSVAL_TO_INT(argv[2]); }  if (argc > 3) ConvertJSValToStr(button0Title, cx, argv[3]); if (argc > 4) ConvertJSValToStr(button1Title, cx, argv[4]); if (argc > 5) ConvertJSValToStr(button2Title, cx, argv[5]); if (argc > 6) ConvertJSValToStr(checkMsg, cx, argv[6]);  if (argc > 7 && !JSVAL_IS_PRIMITIVE(argv[7])) { checkObj = JSVAL_TO_OBJECT(argv[7]); if (!JS_GetProperty(cx, checkObj, "value", &jsCheckState) || !JSVAL_IS_BOOLEAN(jsCheckState)) { JS_ReportError(cx, "Parameter 'aCheckState' must have a boolean 'value' property"); return JS_FALSE; } JS_ValueToBoolean(cx, jsCheckState, &checkState); }  jsrefcount saveDepth = JS_SuspendRequest(cx);  nativeThis->ConfirmEx(title, text, buttonFlags, button0Title, button1Title, button2Title, checkMsg, &checkState, &nativeRet);  JS_ResumeRequest(cx, saveDepth);   if (checkObj) { jsCheckState = BOOLEAN_TO_JSVAL(checkState); JS_SetProperty(cx, checkObj, "value", &jsCheckState); }     if (nativeRet == 0) nativeRet = 1; else if (nativeRet == 1) nativeRet = 0;  *rval = INT_TO_JSVAL(nativeRet);
InstallConfirm(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval){  nsInstall *nativeThis = (nsInstall*)JS_GetPrivate(cx, obj);  nsAutoString b0;  PRInt32 nativeRet;  *rval = JSVAL_NULL;  // If there's no private data, this must be the prototype, so ignore  if(nsnull == nativeThis)  {    return JS_TRUE;  }  if(argc == 1)  {    //  public int InstallConfirm (String aComment);    ConvertJSValToStr(b0, cx, argv[0]);    jsrefcount saveDepth = JS_SuspendRequest(cx);//Need to suspend use of thread or deadlock occurs    nativeThis->Confirm(b0, &nativeRet);    JS_ResumeRequest(cx, saveDepth);    *rval = INT_TO_JSVAL(nativeRet);  }  else  {    JS_ReportError(cx, "Function LogComment requires 1 parameter");    return JS_FALSE;  }  return JS_TRUE;}