mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 05:07:59 +01:00
Camel-case array#{iteritems,itervalues}.
This commit is contained in:
@@ -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. <b>cmd</b> will be executed when one of the
|
||||
|
||||
@@ -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 = "%"
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
},
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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 });
|
||||
|
||||
@@ -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(),
|
||||
|
||||
|
||||
@@ -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]];
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -548,7 +548,7 @@ const Util = Module("Util", {
|
||||
if (color)
|
||||
return <span highlight="HelpXMLBlock"><span highlight="HelpXMLTagStart"><{
|
||||
namespaced(elem)} {
|
||||
template.map(array.itervalues(elem.attributes),
|
||||
template.map(array.iterValues(elem.attributes),
|
||||
function (attr)
|
||||
<span highlight="HelpXMLAttribute">{namespaced(attr)}</span> +
|
||||
<span highlight="HelpXMLString">{attr.value}</span>,
|
||||
@@ -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 ? "/>" : ">...</" + namespaced(elem) + ">");
|
||||
}
|
||||
catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user