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:
@@ -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
|
||||
|
||||
@@ -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++;
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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) ]);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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...
|
||||
|
||||
|
||||
@@ -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([]);
|
||||
|
||||
Reference in New Issue
Block a user