www

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

commit 39bc5398c900c3529784be067c85d280d219447e
parent 03b1b75bfbb36937dcd3618e75cb5f2715df6fed
Author: Tom Najdek <tom@doppnet.com>
Date:   Sun, 16 Oct 2016 15:24:04 +0100

Remove use of non-standard list comprehension syntax

Diffstat:
Mchrome/content/zotero/locateMenu.js | 4++--
Mchrome/content/zotero/tagColorChooser.js | 5++++-
Mchrome/content/zotero/xpcom/quickCopy.js | 7++++++-
Mcomponents/zotero-autocomplete.js | 6+++---
4 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/chrome/content/zotero/locateMenu.js b/chrome/content/zotero/locateMenu.js @@ -384,8 +384,8 @@ var Zotero_LocateMenu = new function() { return _getURL(item).then((val) => val !== false); } this.handleItems = Zotero.Promise.coroutine(function* (items, event) { - var urls = yield Zotero.Promise.all([for (item of items) _getURL(item)]); - ZoteroPane_Local.loadURI([for (url of urls) if (url) url], event); + var urls = yield Zotero.Promise.all(items.map(item => _getURL(item))); + ZoteroPane_Local.loadURI(urls.filter(url => !!url), event); }); var _getURL = Zotero.Promise.coroutine(function* (item) { diff --git a/chrome/content/zotero/tagColorChooser.js b/chrome/content/zotero/tagColorChooser.js @@ -70,7 +70,10 @@ var Zotero_Tag_Color_Chooser = new function() { } else { // Get unused color at random - var usedColors = [for (x of tagColors.values()) x.color]; + var usedColors = []; + for (let x of tagColors.values()) { + usedColors.push(x.color); + } var unusedColors = Zotero.Utilities.arrayDiff( colorPicker.colors, usedColors ); diff --git a/chrome/content/zotero/xpcom/quickCopy.js b/chrome/content/zotero/xpcom/quickCopy.js @@ -71,7 +71,12 @@ Zotero.QuickCopy = new function() { + "WHERE setting='quickCopySite'"; var rows = yield Zotero.DB.queryAsync(sql); // Unproxify storage row - _siteSettings = [for (row of rows) { domainPath: row.domainPath, format: row.format }]; + _siteSettings = rows.map(row => { + return { + domainPath: row.domainPath, + format: row.format + }; + }); }); diff --git a/components/zotero-autocomplete.js b/components/zotero-autocomplete.js @@ -231,10 +231,10 @@ ZoteroAutoComplete.prototype.startSearch = Zotero.Promise.coroutine(function* (s if (resultsCallback) { resultsCallback(results); this.updateResults( - [for (x of results) x.val], - [for (x of results) x.comment], + Object.values(results).map(x => x.val), + Object.values(results).map(x => x.comment), false - ) + ); } resultCode = null; Zotero.debug("Autocomplete query completed");