const char* msg = mMessage ? mMessage : defaultMsg; const char* location = mLocation ? mLocation : defaultLocation; const char* resultName = mName ? mName : defaultName;
nsCAutoString location;  if (mInner) { nsXPIDLCString filename;  mInner->GetFilename(getter_Copies(filename));  if (!filename.IsEmpty()) { PRUint32 line_nr = 0;  mInner->GetLineNumber(&line_nr);  char *temp = PR_smprintf("%s Line: %d", filename.get(), line_nr); if (temp) { location.Assign(temp); PR_smprintf_free(temp); } } }  if (location.IsEmpty()) { location = defaultLocation; }  const char* msg = rs ? rs->mMessage : defaultMsg; const char* resultName = rs ? rs->mName : defaultName;
nsDOMException::ToString(nsAWritableString& aReturn){  static const char defaultMsg[] = "<no message>";  static const char defaultLocation[] = "<unknown>";  static const char defaultName[] = "<unknown>";  static const char format[] =    "[Exception... \"%s\"  code: \"%d\" nsresult: \"0x%x (%s)\"  location: \"%s\"]";    const char* msg = mMessage ? mMessage : defaultMsg;  const char* location = mLocation ? mLocation : defaultLocation;  const char* resultName = mName ? mName : defaultName;  PRUint32 code;  GetCode(&code);  char* temp = PR_smprintf(format, msg, code, mResult, resultName, location);  if (temp) {    CopyASCIItoUCS2(nsDependentCString(temp), aReturn);    PR_smprintf_free(temp);  }  return NS_OK;}