Bug 765200 - Shorten errors of type: "an unexpected uncaught JS exception reported through window.onerror - ..."; r=jmaher

This commit is contained in:
Ed Morley 2012-12-04 17:45:32 +00:00
parent dcbe789e3a
commit ee20ee7c54

View File

@ -1058,9 +1058,8 @@ window.onerror = function simpletestOnerror(errorMsg, url, lineNumber) {
// For now, for tests that self identify as having unintentional uncaught
// exceptions, just dump it so that the error is visible but doesn't cause
// a test failure. See bug 652494.
var href = SpecialPowers.getPrivilegedProps(window, 'location.href');
var isExpected = !!SimpleTest._expectingUncaughtException;
var message = "an " + (isExpected ? "" : "un") + "expected uncaught JS exception reported through window.onerror";
var message = (isExpected ? "expected " : "") + "uncaught exception";
var error = errorMsg + " at " + url + ":" + lineNumber;
if (!SimpleTest._ignoringAllUncaughtExceptions) {
SimpleTest.ok(isExpected, message, error);