From bf58ba6faaa2b0600858e81a03f60a23e4a9aaec Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Wed, 20 Jan 2016 01:26:05 -0500 Subject: [PATCH] Fix remaining old-style array comprehensions --- chrome/content/zotero/xpcom/data/item.js | 4 ++-- chrome/content/zotero/xpcom/db.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index a4dba41713..2af86d48bc 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -1861,7 +1861,7 @@ Zotero.Item.prototype.getNotes = function(includeTrashed) { return collation.compareString(1, aTitle, bTitle); }); } - var ids = [row.itemID for (row of rows)]; + var ids = rows.map(row => row.itemID); this._notes[cacheKey] = ids; return ids; } @@ -2907,7 +2907,7 @@ Zotero.Item.prototype.getAttachments = function(includeTrashed) { var collation = Zotero.getLocaleCollation(); rows.sort(function (a, b) collation.compareString(1, a.title, b.title)); } - var ids = [row.itemID for (row of rows)]; + var ids = rows.map(row => row.itemID); this._attachments[cacheKey] = ids; return ids; } diff --git a/chrome/content/zotero/xpcom/db.js b/chrome/content/zotero/xpcom/db.js index 70bddd1b82..44a2218e5b 100644 --- a/chrome/content/zotero/xpcom/db.js +++ b/chrome/content/zotero/xpcom/db.js @@ -345,7 +345,7 @@ Zotero.DBConnection.prototype.rollbackAllTransactions = function () { Zotero.DBConnection.prototype.getColumns = function (table) { return Zotero.DB.queryAsync("PRAGMA table_info(" + table + ")") .then(function (rows) { - return [row.name for each (row in rows)]; + return rows.map(row => row.name); }) .catch(function (e) { this._debug(e, 1);