1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-09 01:34:10 +01:00

Clean up some old-style iterator gunk.

This commit is contained in:
Kris Maglione
2015-02-25 10:48:10 -08:00
parent d1937f708c
commit a8b1b278e2
12 changed files with 31 additions and 27 deletions

View File

@@ -256,7 +256,7 @@ var Buffer = Module("Buffer", {
/**
* @property {nsIURI} The current top-level document's URI.
*/
get uri() util.newURI(this.win.location.href),
get uri() util.newURI(this.win.location.href),
/**
* @property {nsIURI} The current top-level document's URI, sans

View File

@@ -267,7 +267,7 @@ var Cache = Module("Cache", XPCOM(Ci.nsIRequestObserver), {
if (this.queue.length && !this.inQueue) {
// removeEntry does not work properly with queues.
let removed = 0;
for (let [, entry] of this.queue)
for (let entry of this.queue)
if (this.getCacheWriter().hasEntry(entry)) {
this.getCacheWriter().removeEntry(entry, false);
removed++;

View File

@@ -588,7 +588,7 @@ var RangeFind = Class("RangeFind", {
let anonNodes = doc.getAnonymousNodes(doc.documentElement);
if (anonNodes) {
for (let [, elem] of iter(anonNodes)) {
for (let elem of anonNodes) {
let range = RangeFind.nodeContents(elem);
pushRange(RangeFind.endpoint(range, true), RangeFind.endpoint(range, false));
}

View File

@@ -449,9 +449,9 @@ var Highlights = Module("Highlight", {
},
javascript: function initJavascript(dactyl, modules, window) {
modules.JavaScript.setCompleter(["get", "set"].map(m => highlight[m]),
[ (context, obj, args) => Iterator(highlight.highlight) ]);
[ (context, obj, args) => iter(highlight.highlight) ]);
modules.JavaScript.setCompleter(["highlightNode"].map(m => highlight[m]),
[ null, (context, obj, args) => Iterator(highlight.highlight) ]);
[ null, (context, obj, args) => iter(highlight.highlight) ]);
}
});

View File

@@ -98,7 +98,7 @@ var IO = Module("io", {
outer:
for (let dir of values(dirs)) {
for (let [, path] of iter(paths)) {
for (let path of paths) {
let file = dir.child(path);
dactyl.echomsg(_("io.searchingFor", JSON.stringify(file.path)), 3);

View File

@@ -167,20 +167,23 @@ var Sanitizer = Module("sanitizer", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakRef
if (!item.builtin && (!persistent || item.persistent) && item.name !== "all")
];
function prefOverlay(branch, persistent, local) update(Object.create(local), {
before: [
["preferences", { id: branch.substr(Item.PREFIX.length) + "history",
xmlns: "xul" },
template.map(ourItems(persistent), item =>
["preference", { type: "bool", id: branch + item.name, name: branch + item.name }])]
],
init: function init(win) {
let pane = win.document.getElementById("SanitizeDialogPane");
for (let [, pref] of iter(pane.preferences))
pref.updateElements();
init.superapply(this, arguments);
}
});
function prefOverlay(branch, persistent, local) {
return update(Object.create(local),
{
before: [
["preferences", { id: branch.substr(Item.PREFIX.length) + "history",
xmlns: "xul" },
template.map(ourItems(persistent), item =>
["preference", { type: "bool", id: branch + item.name, name: branch + item.name }])]
],
init: function init(win) {
let pane = win.document.getElementById("SanitizeDialogPane");
for (let pref of pane.preferences)
pref.updateElements();
init.superapply(this, arguments);
}
});
}
util.timeout(function () { // Load order issue...

View File

@@ -510,7 +510,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
if (acc.length == patterns.length)
res.push(array(substrings).zip(acc).flatten().join(""));
else
for (let [, pattern] of Iterator(patterns[acc.length]))
for (let pattern of patterns[acc.length])
rec(acc.concat(pattern));
};
rec([]);