зеркало из https://github.com/mozilla/pjs.git
1 parameter format and also the function gets logged correctly in install.log.
This commit is contained in:
Родитель
47b4f27357
Коммит
1233fa6fe9
|
@ -272,6 +272,13 @@ char* nsInstallFileOpItem::toString()
|
|||
result.Append(mTarget->GetNativePathCString());
|
||||
resultCString = result.ToNewCString();
|
||||
break;
|
||||
case NS_FOP_FILE_EXECUTE:
|
||||
result = "Execute File: ";
|
||||
result.Append(mTarget->GetNativePathCString());
|
||||
result.Append(" ");
|
||||
result.Append(*mParams);
|
||||
resultCString = result.ToNewCString();
|
||||
break;
|
||||
case NS_FOP_FILE_MOVE:
|
||||
result = "Move File: ";
|
||||
result.Append(mSrc->GetNativePathCString());
|
||||
|
|
|
@ -1689,9 +1689,25 @@ InstallFileOpFileExecute(JSContext *cx, JSObject *obj, uintN argc, jsval *argv,
|
|||
|
||||
*rval = INT_TO_JSVAL(nativeRet);
|
||||
}
|
||||
else if(argc == 1)
|
||||
{
|
||||
// public int FileExecute (String aSourceFolder,
|
||||
// String aParameters);
|
||||
|
||||
ConvertJSValToStr(b0, cx, argv[0]);
|
||||
b1 = "";
|
||||
nsFileSpec fsB0(b0);
|
||||
|
||||
if(NS_OK != nativeThis->FileOpFileExecute(fsB0, b1, &nativeRet))
|
||||
{
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
*rval = INT_TO_JSVAL(nativeRet);
|
||||
}
|
||||
else
|
||||
{
|
||||
JS_ReportError(cx, "Function FileExecute requires 2 parameters");
|
||||
JS_ReportError(cx, "Function FileExecute requires 1 or 2 parameters");
|
||||
return JS_FALSE;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче