summaryrefslogtreecommitdiff
path: root/js/xpconnect
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-06-16 10:21:27 -0400
committerGaming4JC <g4jc@hyperbola.info>2019-07-18 22:38:33 -0400
commit332c1c28ac6fdb66b6dc4ea6732d98be8d87749b (patch)
tree247953c3abb7a4034646f1858e6657a3be144554 /js/xpconnect
parent4a82fdad87107d369df20da0a4a0987b1bd821fd (diff)
downloaduxp-332c1c28ac6fdb66b6dc4ea6732d98be8d87749b.tar.gz
1283712 - Part 7: Add nsIScriptErrorNote and nsIScriptError.notes.
Diffstat (limited to 'js/xpconnect')
-rw-r--r--js/xpconnect/src/nsXPConnect.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/js/xpconnect/src/nsXPConnect.cpp b/js/xpconnect/src/nsXPConnect.cpp
index 8102d4a4a9..0d1a6be0a7 100644
--- a/js/xpconnect/src/nsXPConnect.cpp
+++ b/js/xpconnect/src/nsXPConnect.cpp
@@ -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);
}