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

Resurrect my range finder, Part II: Make things works sensibly with frames.

This commit is contained in:
Kris Maglione
2009-11-11 02:35:51 -05:00
parent f03c6e134e
commit 0f4598fcd6
3 changed files with 130 additions and 48 deletions

View File

@@ -115,11 +115,11 @@ function isobject(obj) {
}
function isarray(obj) {
return Object.prototype.toString(obj) == "[object Array]";
return Object.prototype.toString.call(obj) == "[object Array]";
}
function isgenerator(val) {
return Object.prototype.toString(obj) == "[object Generator]";
return Object.prototype.toString.call(val) == "[object Generator]";
}
function isstring(val) {
@@ -212,9 +212,11 @@ function Class() {
constructor: Constructor,
get closure() {
delete this.closure;
const self = this;
return this.closure = dict([k for (k in this) if (!self.__lookupGetter__(k) && callable(self[k]))].map(
function (k) [k, function () self[k].apply(self, arguments)]));
function closure(fn) function () fn.apply(self, arguments);
for (let k in this)
if (!this.__lookupGetter__(k) && callable(this[k]))
closure[k] = closure(self[k]);
return this.closure = closure;
}
};
var res = self.init.apply(self, arguments);