1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-20 15:15:47 +01:00

Fix reported file/line in failed assertions.

This commit is contained in:
Kris Maglione
2010-12-25 06:53:51 -05:00
parent b24781c685
commit 273796d321
3 changed files with 24 additions and 13 deletions

View File

@@ -28,12 +28,7 @@ memoize(this, "Commands", function () {
return obj.Commands;
});
const FailedAssertion = Class("FailedAssertion", Error, {
init: function (message) {
update(this, Error(message))
this.message = message;
}
});
const FailedAssertion = Class("FailedAssertion", ErrorBase);
function wrapCallback(fn)
fn.wrapper = function wrappedCallback () {
@@ -125,7 +120,7 @@ const Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference])
*/
assert: function (condition, message) {
if (!condition)
throw FailedAssertion(message);
throw FailedAssertion(message, 1);
},
get chromePackages() {