Bug 721156 - aError.stack is undefined in the Error Console when exception is thrown in Scratchpad. r=robcee

This commit is contained in:
Heather Arthur 2012-03-28 13:24:44 +01:00
Родитель b9fbed5629
Коммит 76651fbb1f
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -487,7 +487,8 @@ var Scratchpad = {
*/
writeAsErrorComment: function SP_writeAsErrorComment(aError)
{
let newComment = "Exception: " + aError.message + "\n" + aError.stack.substring(0, aError.stack.length - 1);
let stack = aError.stack || aError.fileName + ":" + aError.lineNumber;
let newComment = "Exception: " + aError.message + "\n" + stack.replace(/\n$/, "");
this.writeAsComment(newComment);
},