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

Death to for each.

This commit is contained in:
Kris Maglione
2014-02-24 19:03:49 -08:00
parent 78a6de9c3a
commit 5b38465a1c
20 changed files with 48 additions and 46 deletions

View File

@@ -37,7 +37,7 @@ function require(module_, target) {
}
function lazyRequire(module, names, target) {
for each (let name in names)
for (let name of names)
memoize(target || this, name, name => require(module)[name]);
}
@@ -284,9 +284,7 @@ function properties(obj, prototypes) {
}
for (; obj; obj = prototypes && prototype(obj)) {
var iter = (v for each (v in props(obj)));
for (let key in iter)
for (let key of props(obj))
if (!prototypes || !seen.add(key) && obj != orig)
yield key;
}
@@ -670,7 +668,7 @@ function call(fn, self, ...args) {
function memoize(obj, key, getter) {
if (arguments.length == 1) {
let res = update(Object.create(obj), obj);
for each (let prop in Object.getOwnPropertyNames(obj)) {
for (let prop of Object.getOwnPropertyNames(obj)) {
let get = __lookupGetter__.call(obj, prop);
if (get)
memoize(res, prop, get);