diff --git a/common/content/autocommands.js b/common/content/autocommands.js index 8e16deb0..47df10ae 100644 --- a/common/content/autocommands.js +++ b/common/content/autocommands.js @@ -18,7 +18,7 @@ const AutoCommands = Module("autocommands", { this._store = []; }, - __iterator__: function () array.itervalues(this._store), + __iterator__: function () array.iterValues(this._store), /** * Adds a new autocommand. cmd will be executed when one of the diff --git a/common/content/buffer.js b/common/content/buffer.js index ca0013f4..ad9a10e7 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -84,7 +84,7 @@ const Buffer = Module("buffer", { const ACCESS_READ = Ci.nsICache.ACCESS_READ; let cacheKey = doc.location.toString().replace(/#.*$/, ""); - for (let proto in array.itervalues(["HTTP", "FTP"])) { + for (let proto in array.iterValues(["HTTP", "FTP"])) { try { var cacheEntryDescriptor = services.get("cache").createSession(proto, 0, true) .openCacheEntry(cacheKey, ACCESS_READ, false); @@ -1022,7 +1022,7 @@ const Buffer = Module("buffer", { if (win.scrollMaxX > 0 || win.scrollMaxY > 0) return win; - for (let frame in array.itervalues(win.frames)) + for (let frame in array.iterValues(win.frames)) if (frame.scrollMaxX > 0 || frame.scrollMaxY > 0) return frame; @@ -1335,7 +1335,7 @@ const Buffer = Module("buffer", { context.fork(id, 0, this, function (context, [name, browsers]) { context.title = [name || "Buffers"]; context.generate = function () - util.map(array.itervalues(browsers), function ([i, browser]) { + util.map(array.iterValues(browsers), function ([i, browser]) { let indicator = " "; if (i == tabs.index()) indicator = "%" diff --git a/common/content/commandline.js b/common/content/commandline.js index 078e274f..722afd74 100644 --- a/common/content/commandline.js +++ b/common/content/commandline.js @@ -1732,7 +1732,7 @@ const ItemList = Class("ItemList", { for (let [i, row] in Iterator(context.getRows(start, end, this._doc))) nodes[i] = row; - for (let [i, row] in array.iteritems(nodes)) { + for (let [i, row] in array.iterItems(nodes)) { if (!row) continue; let display = (i >= start && i < end); diff --git a/common/content/commands.js b/common/content/commands.js index ede51c1f..1efa14b6 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -323,7 +323,7 @@ const Commands = Module("commands", { /** @property {Iterator(Command)} @private */ __iterator__: function () { let sorted = this._exCommands.sort(function (a, b) a.name > b.name); - return array.itervalues(sorted); + return array.iterValues(sorted); }, /** @property {string} The last executed Ex command line. */ @@ -548,7 +548,7 @@ const Commands = Module("commands", { argCount = "*"; var args = []; // parsed options - args.__iterator__ = function () array.iteritems(this); + args.__iterator__ = function () array.iterItems(this); args.string = str; // for access to the unparsed string args.literalArg = ""; @@ -855,7 +855,7 @@ const Commands = Module("commands", { removeUserCommand: function (name) { let cmd = this.get(name); dactyl.assert(cmd.user, "E184: No such user-defined command: " + name); - for (let name in array.itervalues(cmd.names)) + for (let name in array.iterValues(cmd.names)) delete this._exMap[name]; this._exCommands = this._exCommands.filter(function (c) c != cmd); }, diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 380eefe5..10a6287a 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -509,7 +509,7 @@ const Dactyl = Module("dactyl", { // Find the tags in the document. function addTags(file, doc) { for (let elem in util.evaluateXPath("//@tag|//dactyl:tags/text()|//dactyl:tag/text()", doc)) - for (let tag in array((elem.value || elem.textContent).split(/\s+/)).compact().itervalues()) + for (let tag in array((elem.value || elem.textContent).split(/\s+/)).compact().iterValues()) tagMap[tag] = file; } @@ -592,7 +592,7 @@ const Dactyl = Module("dactyl", { if (node instanceof HTMLHtmlElement) data.push(" xmlns=" + XHTML.uri.quote()); - for (let { name, value } in array.itervalues(node.attributes)) { + for (let { name, value } in array.iterValues(node.attributes)) { if (name == "dactyl:highlight") { name = "class"; value = "hl-" + value; diff --git a/common/content/finder.js b/common/content/finder.js index fdff006f..ef6a94bd 100644 --- a/common/content/finder.js +++ b/common/content/finder.js @@ -455,7 +455,7 @@ const RangeFind = Class("RangeFind", { let pageStart = RangeFind.endpoint(pageRange, true); let pageEnd = RangeFind.endpoint(pageRange, false); - for (let frame in array.itervalues(win.frames)) { + for (let frame in array.iterValues(win.frames)) { let range = doc.createRange(); if (util.computedStyle(frame.frameElement).visibility == "visible") { range.selectNode(frame.frameElement); @@ -577,11 +577,11 @@ const RangeFind = Class("RangeFind", { }, addListeners: function () { - for (let range in array.itervalues(this.ranges)) + for (let range in array.iterValues(this.ranges)) range.window.addEventListener("unload", this.closure.onUnload, true); }, purgeListeners: function () { - for (let range in array.itervalues(this.ranges)) + for (let range in array.iterValues(this.ranges)) range.window.removeEventListener("unload", this.closure.onUnload, true); }, onUnload: function (event) { diff --git a/common/content/history.js b/common/content/history.js index a8c28ff6..14e6a6b6 100644 --- a/common/content/history.js +++ b/common/content/history.js @@ -45,7 +45,7 @@ const History = Module("history", { let sh = window.getWebNavigation().sessionHistory; let obj = []; obj.index = sh.index; - obj.__iterator__ = function () array.iteritems(this); + obj.__iterator__ = function () array.iterItems(this); for (let i in util.range(0, sh.count)) { obj[i] = update(Object.create(sh.getEntryAtIndex(i, false)), { index: i }); diff --git a/common/content/modes.js b/common/content/modes.js index d502ef02..7da4f364 100644 --- a/common/content/modes.js +++ b/common/content/modes.js @@ -121,7 +121,7 @@ const Modes = Module("modes", { NONE: 0, - __iterator__: function () array.itervalues(this.all), + __iterator__: function () array.iterValues(this.all), get all() this._mainModes.slice(), diff --git a/common/modules/base.jsm b/common/modules/base.jsm index 68d10ded..5373869c 100644 --- a/common/modules/base.jsm +++ b/common/modules/base.jsm @@ -342,7 +342,7 @@ set.remove = function (set, key) { */ function iter(obj) { if (isinstance(obj, [Ci.nsIDOMHTMLCollection, Ci.nsIDOMNodeList])) - return array.iteritems(obj); + return array.iterItems(obj); if (obj instanceof Ci.nsIDOMNamedNodeMap) return (function () { for (let i = 0; i < obj.length; i++) @@ -899,7 +899,7 @@ const array = Class("array", Array, { return { __proto__: ary, - __iterator__: function () this.iteritems(), + __iterator__: function () this.iterItems(), __noSuchMethod__: function (meth, args) { var res = array[meth].apply(null, [this.array].concat(args)); if (isArray(res)) @@ -966,7 +966,7 @@ const array = Class("array", Array, { * @param {Array} ary * @returns {Iterator(Object)} */ - itervalues: function itervalues(ary) { + iterValues: function iterValues(ary) { let length = ary.length; for (let i = 0; i < length; i++) yield ary[i]; @@ -978,7 +978,7 @@ const array = Class("array", Array, { * @param {Array} ary * @returns {Iterator([{number}, {Object}])} */ - iteritems: function iteritems(ary) { + iterItems: function iterItems(ary) { let length = ary.length; for (let i = 0; i < length; i++) yield [i, ary[i]]; diff --git a/common/modules/template.jsm b/common/modules/template.jsm index f1f9e619..2eab7d9b 100644 --- a/common/modules/template.jsm +++ b/common/modules/template.jsm @@ -20,7 +20,7 @@ const Template = Module("Template", { map: function map(iter, func, sep, interruptable) { if (iter.length) // FIXME: Kludge? - iter = array.itervalues(iter); + iter = array.iterValues(iter); let ret = <>; let n = 0; for each (let i in Iterator(iter)) { diff --git a/common/modules/util.jsm b/common/modules/util.jsm index e9fe59b2..af4f30de 100644 --- a/common/modules/util.jsm +++ b/common/modules/util.jsm @@ -548,7 +548,7 @@ const Util = Module("Util", { if (color) return <{ namespaced(elem)} { - template.map(array.itervalues(elem.attributes), + template.map(array.iterValues(elem.attributes), function (attr) {namespaced(attr)} + {attr.value}, @@ -560,7 +560,7 @@ const Util = Module("Util", { let tag = "<" + [namespaced(elem)].concat( [namespaced(a) + "=" + template.highlight(a.value, true) - for ([i, a] in array.iteritems(elem.attributes))]).join(" "); + for ([i, a] in array.iterItems(elem.attributes))]).join(" "); return tag + (hasChildren ? "/>" : ">..."); } catch (e) {