From 191ece33e032483c2445594c21c1cbc4b1da75fb Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sun, 27 Feb 2011 05:48:34 -0500 Subject: [PATCH] Ammend revision 9f791638b3ef: Don't throw, but report error. --- common/content/dactyl.js | 7 ++++--- common/modules/contexts.jsm | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 9005519e..abcc65af 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -346,7 +346,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { dactyl.reportError(str); if (isObject(str) && "echoerr" in str) str = str.echoerr; - else if (isinstance(str, ["Error"]) && str.fileName) + else if (isinstance(str, ["Error", FailedAssertion]) && str.fileName) str = <>{str.fileName.replace(/^.* -> /, "")}: {str.lineNumber}: {str}; if (options["errorbells"]) @@ -1405,7 +1405,7 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { * @param {Object} error The error object. */ reportError: function reportError(error, echo) { - if (error instanceof FailedAssertion || error.message === "Interrupted") { + if (error instanceof FailedAssertion && error.noTrace || error.message === "Interrupted") { let context = contexts.context; let prefix = context ? context.file + ":" + context.line + ": " : ""; if (error.message && error.message.indexOf(prefix) !== 0) @@ -1424,7 +1424,8 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), { return; if (echo) dactyl.echoerr(error, commandline.FORCE_SINGLELINE); - util.reportError(error); + else + util.reportError(error); }, /** diff --git a/common/modules/contexts.jsm b/common/modules/contexts.jsm index 77f20b5d..0c74bc54 100644 --- a/common/modules/contexts.jsm +++ b/common/modules/contexts.jsm @@ -215,7 +215,7 @@ var Contexts = Module("contexts", { enumerable: true, get: function () self, set: function (val) { - throw TypeError("Not replacing plugin context for " + self.NAME); + util.dactyl(val).reportError(FailedAssertion("Not replacing plugin context for " + self.NAME, 3, false), true); } }); }