Bug 503363 - include filename+linenumber for exceptions thrown during mochitest. r=sdwilsh

This commit is contained in:
Dan Witte 2009-07-10 12:34:04 -07:00
parent 62457ae242
commit 04ced9b45b

View File

@ -152,8 +152,13 @@ function testResult(aCondition, aName, aDiag, aIsTodo) {
else
this.result = "TEST-PASS";
} else {
if (aDiag)
if (aDiag) {
if (typeof aDiag == "object" && "fileName" in aDiag) {
// we have an exception - print filename and linenumber information
this.msg += " at " + aDiag.fileName + ":" + aDiag.lineNumber;
}
this.msg += " - " + aDiag;
}
if (aIsTodo)
this.result = "TEST-UNEXPECTED-PASS";
else