1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 08:07:59 +01:00

Minor cleanup/we like symlinks.

This commit is contained in:
Kris Maglione
2009-05-28 15:03:47 -04:00
parent 8d5fc6faea
commit 474ce30ada
4 changed files with 316 additions and 186 deletions

View File

@@ -688,21 +688,23 @@ const util = { //{{{
/**
* Array utility methods.
* @singleton
*/
util.Array = function Array(ary) {
var obj = {
__proto__: ary,
__iterator__: function () this.iteritems(),
__noSuchMethod__: function (meth, args) {
let res = util.Array(util.Array[meth].apply(null, [this.__proto__].concat(args)))
if (res instanceof Array)
let res = util.Array[meth].apply(null, [this.__proto__].concat(args));
if (util.Array.isinstance(res))
return util.Array(res);
return res;
}
};
return obj;
}
util.Array.isinstance = function isinstance(obj) {
return Object.prototype.toString.call(obj) == "[object Array]";
};
/**
* Converts an array to an object. As in lisp, an assoc is an
* array of key-value pairs, which maps directly to an object,