mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-19 23:07:33 +09:00
1283712 - Part 7: Add nsIScriptErrorNote and nsIScriptError.notes.
This commit is contained in:
parent
19854690b7
commit
fffabb3de4
4 changed files with 184 additions and 45 deletions
|
|
@ -326,8 +326,9 @@ xpc::ErrorReport::LogToConsoleWithStack(JS::HandleObject aStack)
|
|||
// mechanisms.
|
||||
nsCOMPtr<nsIConsoleService> consoleService =
|
||||
do_GetService(NS_CONSOLESERVICE_CONTRACTID);
|
||||
NS_ENSURE_TRUE_VOID(consoleService);
|
||||
|
||||
nsCOMPtr<nsIScriptError> errorObject;
|
||||
RefPtr<nsScriptErrorBase> errorObject;
|
||||
if (mWindowID && aStack) {
|
||||
// Only set stack on messages related to a document
|
||||
// As we cache messages in the console service,
|
||||
|
|
@ -338,12 +339,21 @@ xpc::ErrorReport::LogToConsoleWithStack(JS::HandleObject aStack)
|
|||
errorObject = new nsScriptError();
|
||||
}
|
||||
errorObject->SetErrorMessageName(mErrorMsgName);
|
||||
NS_ENSURE_TRUE_VOID(consoleService);
|
||||
|
||||
nsresult rv = errorObject->InitWithWindowID(mErrorMsg, mFileName, mSourceLine,
|
||||
mLineNumber, mColumn, mFlags,
|
||||
mCategory, mWindowID);
|
||||
NS_ENSURE_SUCCESS_VOID(rv);
|
||||
|
||||
for (size_t i = 0, len = mNotes.Length(); i < len; i++) {
|
||||
ErrorNote& note = mNotes[i];
|
||||
|
||||
nsScriptErrorNote* noteObject = new nsScriptErrorNote();
|
||||
noteObject->Init(note.mErrorMsg, note.mFileName,
|
||||
note.mLineNumber, note.mColumn);
|
||||
errorObject->AddNote(noteObject);
|
||||
}
|
||||
|
||||
consoleService->LogMessage(errorObject);
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue