fixes build bustage with --enable-xpctools

patch=dmose r/sr=darin
This commit is contained in:
darin%netscape.com 2002-05-03 19:04:14 +00:00
parent 3285301d39
commit 9508d71adc
2 changed files with 7 additions and 9 deletions

View File

@ -78,13 +78,13 @@ nsXPConnect::nsXPConnect()
#ifdef XPC_TOOLS_SUPPORT
{
const char* filename = PR_GetEnv("MOZILLA_JS_PROFILER_OUTPUT");
if(filename)
nsDependentCString filename(PR_GetEnv("MOZILLA_JS_PROFILER_OUTPUT"));
if(!filename.IsEmpty())
{
mProfilerOutputFile = do_CreateInstance(NS_LOCAL_FILE_CONTRACTID);
if(mProfilerOutputFile &&
NS_SUCCEEDED(mProfilerOutputFile->InitWithPath(filename)))
NS_SUCCEEDED(mProfilerOutputFile->InitWithNativePath(filename)))
{
mProfiler = do_GetService(XPCTOOLS_PROFILER_CONTRACTID);
if(mProfiler)
@ -93,7 +93,7 @@ nsXPConnect::nsXPConnect()
{
#ifdef DEBUG
printf("***** profiling JavaScript. Output to: %s\n",
filename);
filename.get());
#endif
}
}

View File

@ -116,8 +116,8 @@ NS_IMETHODIMP nsXPCToolsCompiler::CompileFile(nsILocalFile *aFile, PRBool strict
if (!JS_InitStandardClasses(cx, glob))
return NS_ERROR_FAILURE;
char * path = nsnull;
if(NS_FAILED(aFile->GetPath(&path)))
nsCAutoString path;
if(NS_FAILED(aFile->GetNativePath(path)))
return NS_ERROR_FAILURE;
uint32 oldoptions = JS_GetOptions(cx);
@ -125,7 +125,7 @@ NS_IMETHODIMP nsXPCToolsCompiler::CompileFile(nsILocalFile *aFile, PRBool strict
JSErrorReporter older = JS_SetErrorReporter(cx, ErrorReporter);
JSExceptionState *es =JS_SaveExceptionState(cx);
if(!JS_CompileFileHandle(cx, glob, path, handle))
if(!JS_CompileFileHandle(cx, glob, path.get(), handle))
{
jsval v;
JSErrorReport* report;
@ -152,7 +152,5 @@ NS_IMETHODIMP nsXPCToolsCompiler::CompileFile(nsILocalFile *aFile, PRBool strict
JS_SetErrorReporter(cx, older);
JS_SetOptions(cx, oldoptions);
if(path)
nsMemory::Free(path);
return NS_OK;
}