diff options
author | Matt A. Tobin <email@mattatobin.com> | 2018-02-10 16:12:30 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2018-02-10 16:12:30 -0500 |
commit | 3313fd9c51070fadb1775a41eb5e8d731dfb53e8 (patch) | |
tree | 42e078505708d2825c6d606a85178c6251c93c15 /toolkit | |
parent | d836c9e48815f6fb024fd46582142bfc3aa45419 (diff) | |
download | UXP-3313fd9c51070fadb1775a41eb5e8d731dfb53e8.tar UXP-3313fd9c51070fadb1775a41eb5e8d731dfb53e8.tar.gz UXP-3313fd9c51070fadb1775a41eb5e8d731dfb53e8.tar.lz UXP-3313fd9c51070fadb1775a41eb5e8d731dfb53e8.tar.xz UXP-3313fd9c51070fadb1775a41eb5e8d731dfb53e8.zip |
Fix for loops in AddonRepository.jsm (SyntaxError: missing ] after element list)
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/mozapps/extensions/internal/AddonRepository.jsm | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/toolkit/mozapps/extensions/internal/AddonRepository.jsm b/toolkit/mozapps/extensions/internal/AddonRepository.jsm index dc0221167..adcecbee7 100644 --- a/toolkit/mozapps/extensions/internal/AddonRepository.jsm +++ b/toolkit/mozapps/extensions/internal/AddonRepository.jsm @@ -631,7 +631,12 @@ this.AddonRepository = { return this._clearCache(); } - let ids = [a.id for (a of allAddons)]; + // Tycho: let ids = [a.id for (a of allAddons)]; + let ids = []; + for (let a of allAddons) { + ids.push(a.id); + } + logger.debug("Repopulate add-on cache with " + ids.toSource()); let self = this; @@ -962,7 +967,12 @@ this.AddonRepository = { this._searching = false; this._request = null; // The callback may want to trigger a new search so clear references early - let addons = [result.addon for each(result in aResults)]; + // Tycho: let addons = [result.addon for each(result in aResults)]; + let addons = []; + for each(let result in aResults) { + addons.push(result.addon); + } + let callback = this._callback; this._callback = null; callback.searchSucceeded(addons, addons.length, aTotalResults); @@ -1508,7 +1518,13 @@ this.AddonRepository = { let localAddonIds = {ids: null, sourceURIs: null}; AddonManager.getAllAddons(function getLocalAddonIds_getAllAddons(aAddons) { - localAddonIds.ids = [a.id for each (a in aAddons)]; + // Tycho: localAddonIds.ids = [a.id for each (a in aAddons)]; + localAddonIds.ids = []; + + for each(let a in aAddons) { + localAddonIds.ids.push(a.id); + } + if (localAddonIds.sourceURIs) aCallback(localAddonIds); }); |