1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 01:37:58 +01:00

Move iteration utility functions to the iter namespace.

This commit is contained in:
Kris Maglione
2011-01-02 16:56:18 -05:00
parent 91f02c9763
commit fbd7556a76
14 changed files with 261 additions and 183 deletions

View File

@@ -34,13 +34,13 @@ var JavaScript = Module("javascript", {
return undefined;
},
iter: function iter(obj, toplevel) {
iter: function iter_(obj, toplevel) {
if (obj == null)
return;
let seen = isinstance(obj, ["Sandbox"]) ? set(JavaScript.magicalNames) : {};
let globals = values(toplevel && window === obj ? JavaScript.globalNames : []);
for (let key in iterAll(globals, properties(obj, !toplevel, true)))
for (let key in iter(globals, properties(obj, !toplevel, true)))
if (!set.add(seen, key))
yield key;