commit f09871a1ee7a3fee71ecc3261146798573f40bb1 parent 10ba5e31d648dcdf9b07a6bfe95a7cf810a610ac Author: Dan Stillman <dstillman@zotero.org> Date: Fri, 19 Sep 2014 20:39:23 -0400 Convert additional for..in loops to for loops in getDisplayTitle() Diffstat:
| M | chrome/content/zotero/xpcom/data/item.js | | | 15 | ++++++++------- |
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js @@ -877,11 +877,12 @@ Zotero.Item.prototype.getDisplayTitle = function (includeAuthorAndDate) { var itemTypeName = Zotero.ItemTypes.getName(itemTypeID); if (!title && (itemTypeID == 8 || itemTypeID == 10)) { // 'letter' and 'interview' itemTypeIDs - var creators = this.getCreators(); - var authors = []; - var participants = []; + let creators = this.getCreators(); + let authors = []; + let participants = []; if (creators) { - for each(var creator in creators) { + for (let i=0; i<creators.length; i++) { + let creator = creators[i]; if ((itemTypeID == 8 && creator.creatorTypeID == 16) || // 'letter'/'recipient' (itemTypeID == 10 && creator.creatorTypeID == 7)) { // 'interview'/'interviewer' participants.push(creator); @@ -896,9 +897,9 @@ Zotero.Item.prototype.getDisplayTitle = function (includeAuthorAndDate) { var strParts = []; if (includeAuthorAndDate) { - var names = []; - for each(author in authors) { - names.push(author.ref.lastName); + let names = []; + for (let i=0; i<authors.length; i++) { + names.push(authors[i].ref.lastName); } // TODO: Use same logic as getFirstCreatorSQL() (including "et al.")