ConvertJSValToStr(b0, cx, argv[0]); ConvertJSValToStr(b1, cx, argv[1]); nsFileSpec fsB0(b0); nsFileSpec fsB1(b1);
if (argv[0] == JSVAL_NULL || !JSVAL_IS_OBJECT(argv[0])) { *rval = INT_TO_JSVAL(nsInstall::INVALID_ARGUMENTS); return JS_TRUE; }
InstallFileOpFileCopy(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval){  nsInstall *nativeThis = (nsInstall*)JS_GetPrivate(cx, obj);  PRInt32 nativeRet;  nsAutoString b0;  nsAutoString b1;  *rval = JSVAL_NULL;  // If there's no private data, this must be the prototype, so ignore  if(nsnull == nativeThis)  {    return JS_TRUE;  }  if(argc >= 2)  {    //  public int FileCopy (String aSourceFolder,    //                       String aTargetFolder);    ConvertJSValToStr(b0, cx, argv[0]);    ConvertJSValToStr(b1, cx, argv[1]);    nsFileSpec fsB0(b0);    nsFileSpec fsB1(b1);    if(NS_OK != nativeThis->FileOpFileCopy(fsB0, fsB1, &nativeRet))    {      return JS_FALSE;    }    *rval = INT_TO_JSVAL(nativeRet);  }  else  {    JS_ReportError(cx, "Function FileCopy requires 2 parameters");    return JS_FALSE;  }  return JS_TRUE;}