www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit a200f6cfc52521b1f04427ca33af03b72807654b
parent 7dda5a2f69e12def62bd457d352e3507f726ba3c
Author: Philipp Zumstein <zuphilip@users.noreply.github.com>
Date:   Sun, 12 Jun 2016 07:23:45 +0200

Fix more for-each-in (#1029)


Diffstat:
Mchrome/content/zotero/duplicatesMerge.js | 4++--
Mchrome/content/zotero/xpcom/data/collections.js | 2+-
Mchrome/content/zotero/xpcom/duplicates.js | 6++++--
Mchrome/content/zotero/xpcom/translation/translate_item.js | 2+-
4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/chrome/content/zotero/duplicatesMerge.js b/chrome/content/zotero/duplicatesMerge.js @@ -33,7 +33,7 @@ var Zotero_Duplicates_Pane = new function () { this.setItems = function (items, displayNumItemsOnTypeError) { var itemTypeID, oldestItem, otherItems = []; - for each(var item in items) { + for (let item of items) { // Find the oldest item if (!oldestItem) { oldestItem = item; @@ -95,7 +95,7 @@ var Zotero_Duplicates_Pane = new function () { } var numRows = 0; - for each(var item in _items) { + for (let item of items) { var date = Zotero.Date.sqlToDate(item.dateAdded, true); dateList.appendItem(date.toLocaleString()); numRows++; diff --git a/chrome/content/zotero/xpcom/data/collections.js b/chrome/content/zotero/xpcom/data/collections.js @@ -143,7 +143,7 @@ Zotero.Collections = function() { var sql = "SELECT collectionID FROM collections WHERE "; var sqlParams = []; - for each(var id in itemIDs) { + for (let id of itemIDs) { sql += "collectionID IN (SELECT collectionID FROM collectionItems " + "WHERE itemID=?) AND " sqlParams.push(id); diff --git a/chrome/content/zotero/xpcom/duplicates.js b/chrome/content/zotero/xpcom/duplicates.js @@ -473,7 +473,8 @@ Zotero.DisjointSetForest.prototype.sameSet = function (x, y) { Zotero.DisjointSetForest.prototype.findAll = function (asIDs) { var objects = []; - for each(var obj in this._objects) { + for (let i in this._objects) { + let obj = this._objects[i]; objects.push(asIDs ? obj.id : obj); } return objects; @@ -483,7 +484,8 @@ Zotero.DisjointSetForest.prototype.findAll = function (asIDs) { Zotero.DisjointSetForest.prototype.findAllInSet = function (x, asIDs) { var xRoot = this.find(x); var objects = []; - for each(var obj in this._objects) { + for (let i in this._objects) { + let obj = this._objects[i]; if (this.find(obj) == xRoot) { objects.push(asIDs ? obj.id : obj); } diff --git a/chrome/content/zotero/xpcom/translation/translate_item.js b/chrome/content/zotero/xpcom/translation/translate_item.js @@ -871,7 +871,7 @@ Zotero.Translate.ItemGetter.prototype = { // get attachments, although only urls will be passed if exportFileData is off returnItemArray.attachments = []; var attachments = returnItem.getAttachments(); - for each(var attachmentID in attachments) { + for (let attachmentID of attachments) { var attachment = Zotero.Items.get(attachmentID); var attachmentInfo = this._attachmentToArray(attachment);