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

Merge some recent fixes into 1.0b5 branch.

This commit is contained in:
Kris Maglione
2011-01-17 13:28:14 -05:00
parent b52e78b92e
commit 2c74786f1c
13 changed files with 212 additions and 138 deletions

View File

@@ -489,6 +489,7 @@ function call(fn) {
*/
function memoize(obj, key, getter) {
if (arguments.length == 1) {
obj = update({}, obj);
for (let prop in Object.getOwnPropertyNames(obj)) {
let get = objproto.__lookupGetter__.call(obj, prop);
if (get)
@@ -737,9 +738,9 @@ Class.memoize = function memoize(getter)
configurable: true,
enumerable: true,
init: function (key) {
this.get = function replace() (
Class.replaceProperty(this, key, null),
Class.replaceProperty(this, key, getter.call(this, key)))
this.get = function replace() let (obj = this.instance || this) (
Class.replaceProperty(obj, key, null),
Class.replaceProperty(obj, key, getter.call(this, key)))
}
});
@@ -1196,6 +1197,9 @@ update(iter, {
return undefined;
},
sort: function sort(iter, fn, self)
array(this.toArray(iter).sort(fn, self)),
uniq: function uniq(iter) {
let seen = {};
for (let item in iter)