nsAutoString error; error.SetString("JavaScript Error: "); error.Append(aErrorString); error += "\n";  if (aFileName) { error += "URL: "; error += aFileName; error += "\n"; }  if(aLineNo) { error += "LineNo: "; error.Append(aLineNo, 10); error += "\n"; }  if(aLineBuf) { error += "Line text: '"; error += aLineBuf; error += "'\n"; }   char* errorStr = error.ToNewCString(); if (errorStr) { printf("%s\n", errorStr); Recycle(errorStr); }     return NS_OK;
return nsDocShell::ReportScriptError(aErrorString, aFileName, aLineNo, aLineBuf);
nsWebShell::ReportScriptError(const char* aErrorString,                              const char* aFileName,                              PRInt32     aLineNo,                              const char* aLineBuf){  // XXX To be implemented by scc. The following implementation  // is temporary.  nsAutoString error;  error.SetString("JavaScript Error: ");  error.Append(aErrorString);  error += "\n";  if (aFileName) {    error += "URL: ";    error += aFileName;    error += "\n";  }  if(aLineNo) {    error += "LineNo: ";    error.Append(aLineNo, 10);    error += "\n";  }  if(aLineBuf) {    error += "Line text: '";    error += aLineBuf;    error += "'\n";  }  // XXX Ughhh...allocation  char* errorStr = error.ToNewCString();  if (errorStr) {    printf("%s\n", errorStr);    Recycle(errorStr);  }    // XXX Turn it off for now...there should be an Error method too  //Alert(error.GetUnicode());  return NS_OK;}