1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-17 16:55:46 +01:00

imported patch groups

--HG--
branch : groups
This commit is contained in:
Kris Maglione
2011-02-05 03:02:36 -05:00
parent e9fd99dafa
commit 9b3ad1c7c6
16 changed files with 468 additions and 344 deletions

View File

@@ -32,8 +32,8 @@ memoize(this, "Commands", function () {
var FailedAssertion = Class("FailedAssertion", ErrorBase);
var Point = Struct("x", "y");
var wrapCallback = function wrapCallback(fn)
fn.wrapper = (function wrappedCallback () {
var wrapCallback = function wrapCallback(fn) {
fn.wrapper = function wrappedCallback () {
try {
return fn.apply(this, arguments);
}
@@ -41,7 +41,10 @@ var wrapCallback = function wrapCallback(fn)
util.reportError(e);
return undefined;
}
})
};
fn.wrapper.wrapped = fn;
return fn.wrapper;
}
var getAttr = function getAttr(elem, ns, name)
elem.hasAttributeNS(ns, name) ? elem.getAttributeNS(ns, name) : null;
@@ -1585,6 +1588,8 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
})();
},
wrapCallback: wrapCallback,
/**
* Traps errors in the called function, possibly reporting them.
*