Fix more for-each-in (#1029)

This commit is contained in:
Philipp Zumstein 2016-06-12 07:23:45 +02:00 committed by Dan Stillman
parent 7dda5a2f69
commit a200f6cfc5
4 changed files with 8 additions and 6 deletions

View file

@ -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++;

View file

@ -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);

View file

@ -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);
}

View file

@ -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);