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

Fix some hinting bugs.

--HG--
branch : key-processing
This commit is contained in:
Kris Maglione
2011-01-24 02:37:14 -05:00
parent 0a422502ba
commit b3d91db6b4
5 changed files with 119 additions and 82 deletions

View File

@@ -803,10 +803,23 @@ Class.prototype = {
};
memoize(Class.prototype, "closure", function () {
const self = this;
function closure(fn) function () fn.apply(self, arguments);
for (let k in iter(properties(this), properties(this, true)))
function closure(fn) function () {
try {
return fn.apply(self, arguments);
}
catch (e) {
util.reportError(e);
}
}
iter(properties(this), properties(this, true)).forEach(function (k) {
if (!this.__lookupGetter__(k) && callable(this[k]))
closure[k] = closure(this[k]);
else if (!(k in closure || k in Object.prototype))
Object.defineProperty(closure, k, {
get: function get_proxy() self[k],
set: function set_proxy(val) self[k] = val,
});
}, this);
return closure;
});