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 | fdda41dd095f9dd906031007ab6376736d1b7d26 (patch) | |
tree | 42e078505708d2825c6d606a85178c6251c93c15 /toolkit | |
parent | 5c70a1e2084392094e8bb2d073b09e90cf929714 (diff) | |
download | uxp-fdda41dd095f9dd906031007ab6376736d1b7d26.tar.gz |
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 dc0221167a..adcecbee7f 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); }); |