summaryrefslogtreecommitdiffstats
path: root/devtools/server/actors
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-06-09 14:52:19 -0400
committerGaming4JC <g4jc@hyperbola.info>2019-07-18 22:38:34 -0400
commit4dc8efd76cb2ff649cfcec5dfa88686ea79b4ee2 (patch)
treedfa6647b40b69c13eadf040e99000378db324ee7 /devtools/server/actors
parent8e932efef46c70fd0c165ee432893f9898267f08 (diff)
downloadUXP-4dc8efd76cb2ff649cfcec5dfa88686ea79b4ee2.tar
UXP-4dc8efd76cb2ff649cfcec5dfa88686ea79b4ee2.tar.gz
UXP-4dc8efd76cb2ff649cfcec5dfa88686ea79b4ee2.tar.lz
UXP-4dc8efd76cb2ff649cfcec5dfa88686ea79b4ee2.tar.xz
UXP-4dc8efd76cb2ff649cfcec5dfa88686ea79b4ee2.zip
1283712 - Part 11.1: Show notes in devtools console.
Diffstat (limited to 'devtools/server/actors')
-rw-r--r--devtools/server/actors/webconsole.js41
1 files changed, 39 insertions, 2 deletions
diff --git a/devtools/server/actors/webconsole.js b/devtools/server/actors/webconsole.js
index a1eba84ed..66715bd34 100644
--- a/devtools/server/actors/webconsole.js
+++ b/devtools/server/actors/webconsole.js
@@ -888,7 +888,8 @@ WebConsoleActor.prototype =
let evalResult = evalInfo.result;
let helperResult = evalInfo.helperResult;
- let result, errorDocURL, errorMessage, errorGrip = null, frame = null;
+ let result, errorDocURL, errorMessage, errorNotes = null, errorGrip = null,
+ frame = null;
if (evalResult) {
if ("return" in evalResult) {
result = evalResult.return;
@@ -943,6 +944,23 @@ WebConsoleActor.prototype =
};
}
} catch (ex) {}
+
+ try {
+ let notes = error.errorNotes;
+ if (notes && notes.length) {
+ errorNotes = [];
+ for (let note of notes) {
+ errorNotes.push({
+ messageBody: this._createStringGrip(note.message),
+ frame: {
+ source: note.fileName,
+ line: note.lineNumber,
+ column: note.columnNumber,
+ }
+ });
+ }
+ }
+ } catch (ex) {}
}
}
@@ -967,6 +985,7 @@ WebConsoleActor.prototype =
exceptionDocURL: errorDocURL,
frame,
helperResult: helperResult,
+ notes: errorNotes,
};
},
@@ -1500,6 +1519,23 @@ WebConsoleActor.prototype =
lineText = lineText.substr(0, DebuggerServer.LONG_STRING_INITIAL_LENGTH);
}
+ let notesArray = null;
+ let notes = aPageError.notes;
+ if (notes && notes.length) {
+ notesArray = [];
+ for (let i = 0, len = notes.length; i < len; i++) {
+ let note = notes.queryElementAt(i, Ci.nsIScriptErrorNote);
+ notesArray.push({
+ messageBody: this._createStringGrip(note.errorMessage),
+ frame: {
+ source: note.sourceName,
+ line: note.lineNumber,
+ column: note.columnNumber,
+ }
+ });
+ }
+ }
+
return {
errorMessage: this._createStringGrip(aPageError.errorMessage),
errorMessageName: aPageError.errorMessageName,
@@ -1516,7 +1552,8 @@ WebConsoleActor.prototype =
strict: !!(aPageError.flags & aPageError.strictFlag),
info: !!(aPageError.flags & aPageError.infoFlag),
private: aPageError.isFromPrivateWindow,
- stacktrace: stack
+ stacktrace: stack,
+ notes: notesArray,
};
},