summaryrefslogtreecommitdiffstats
path: root/js/xpconnect/src/xpcpublic.h
diff options
context:
space:
mode:
Diffstat (limited to 'js/xpconnect/src/xpcpublic.h')
-rw-r--r--js/xpconnect/src/xpcpublic.h58
1 files changed, 43 insertions, 15 deletions
diff --git a/js/xpconnect/src/xpcpublic.h b/js/xpconnect/src/xpcpublic.h
index fc8670d46..399cd2181 100644
--- a/js/xpconnect/src/xpcpublic.h
+++ b/js/xpconnect/src/xpcpublic.h
@@ -515,13 +515,50 @@ AllowCPOWsInAddon(const nsACString& addonId, bool allow);
bool
ExtraWarningsForSystemJS();
-class ErrorReport {
+class ErrorBase {
+ public:
+ nsString mErrorMsg;
+ nsString mFileName;
+ uint32_t mLineNumber;
+ uint32_t mColumn;
+
+ ErrorBase() : mLineNumber(0)
+ , mColumn(0)
+ {}
+
+ void Init(JSErrorBase* aReport);
+
+ void AppendErrorDetailsTo(nsCString& error);
+};
+
+class ErrorNote : public ErrorBase {
+ public:
+ void Init(JSErrorNotes::Note* aNote);
+
+ // Produce an error event message string from the given JSErrorNotes::Note.
+ // This may produce an empty string if aNote doesn't have a message
+ // attached.
+ static void ErrorNoteToMessageString(JSErrorNotes::Note* aNote,
+ nsAString& aString);
+
+ // Log the error note to the stderr.
+ void LogToStderr();
+};
+
+class ErrorReport : public ErrorBase {
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(ErrorReport);
+ nsTArray<ErrorNote> mNotes;
+
+ nsCString mCategory;
+ nsString mSourceLine;
+ nsString mErrorMsgName;
+ uint64_t mWindowID;
+ uint32_t mFlags;
+ bool mIsMuted;
+
ErrorReport() : mWindowID(0)
- , mLineNumber(0)
- , mColumn(0)
, mFlags(0)
, mIsMuted(false)
{}
@@ -530,6 +567,7 @@ class ErrorReport {
bool aIsChrome, uint64_t aWindowID);
void Init(JSContext* aCx, mozilla::dom::Exception* aException,
bool aIsChrome, uint64_t aWindowID);
+
// Log the error report to the console. Which console will depend on the
// window id it was initialized with.
void LogToConsole();
@@ -544,18 +582,8 @@ class ErrorReport {
static void ErrorReportToMessageString(JSErrorReport* aReport,
nsAString& aString);
- public:
-
- nsCString mCategory;
- nsString mErrorMsgName;
- nsString mErrorMsg;
- nsString mFileName;
- nsString mSourceLine;
- uint64_t mWindowID;
- uint32_t mLineNumber;
- uint32_t mColumn;
- uint32_t mFlags;
- bool mIsMuted;
+ // Log the error report to the stderr.
+ void LogToStderr();
private:
~ErrorReport() {}