Bug 956568 - Display more meaningful error information when Parser.jsm is sad, r=past

This commit is contained in:
Victor Porof 2014-01-06 08:41:19 +02:00
parent 9dd1bdde86
commit ce61dae208

View File

@ -2350,7 +2350,15 @@ let SyntaxTreeVisitor = {
* The thrown exception.
*/
function log(aStr, aEx) {
let msg = "Warning: " + aStr + ", " + aEx + "\n" + aEx.stack;
let msg = "Warning: " + aStr + ", " + aEx.message;
if ("lineNumber" in aEx && "columnNumber" in aEx) {
msg += ", line: " + aEx.lineNumber + ", column: " + aEx.columnNumber;
}
if ("stack" in aEx) {
msg += "\n" + aEx.stack;
}
Cu.reportError(msg);
dump(msg + "\n");
};