diff options
author | Matt A. Tobin <email@mattatobin.com> | 2018-02-10 16:11:32 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2018-02-10 16:11:32 -0500 |
commit | 5c70a1e2084392094e8bb2d073b09e90cf929714 (patch) | |
tree | e19a50e02f06e266894af46ec9174e0ecc694a22 /toolkit/mozapps/extensions/internal/XPIProvider.jsm | |
parent | 933dac481863201b83eedf8b482f62052c3e2244 (diff) | |
download | uxp-5c70a1e2084392094e8bb2d073b09e90cf929714.tar.gz |
Fix for loops in XPIProvider.jsm (SyntaxError: missing ] after element list)
Diffstat (limited to 'toolkit/mozapps/extensions/internal/XPIProvider.jsm')
-rw-r--r-- | toolkit/mozapps/extensions/internal/XPIProvider.jsm | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.jsm b/toolkit/mozapps/extensions/internal/XPIProvider.jsm index 76b4e653b6..975448fcc8 100644 --- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm +++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm @@ -3855,7 +3855,12 @@ this.XPIProvider = { */ getAddonsByTypes: function XPI_getAddonsByTypes(aTypes, aCallback) { XPIDatabase.getVisibleAddons(aTypes, function getAddonsByTypes_getVisibleAddons(aAddons) { - aCallback([createWrapper(a) for each (a in aAddons)]); + // Tycho: aCallback([createWrapper(a) for each (a in aAddons)]); + let result = []; + for each(let a in aAddons) { + result.push(createWrapper(a)); + } + aCallback(result); }); }, @@ -3885,7 +3890,12 @@ this.XPIProvider = { function XPI_getAddonsWithOperationsByTypes(aTypes, aCallback) { XPIDatabase.getVisibleAddonsWithPendingOperations(aTypes, function getAddonsWithOpsByTypes_getVisibleAddonsWithPendingOps(aAddons) { - let results = [createWrapper(a) for each (a in aAddons)]; + // Tycho: let results = [createWrapper(a) for each (a in aAddons)]; + let results = []; + for each(let a in aAddons) { + results.push(createWrapper(a)); + } + XPIProvider.installs.forEach(function(aInstall) { if (aInstall.state == AddonManager.STATE_INSTALLED && !(aInstall.addon.inDatabase)) @@ -4809,12 +4819,12 @@ this.XPIProvider = { function getHashStringForCrypto(aCrypto) { // return the two-digit hexadecimal code for a byte - function toHexString(charCode) - ("0" + charCode.toString(16)).slice(-2); + let toHexString = charCode => ("0" + charCode.toString(16)).slice(-2); // convert the binary hash data to a hex string. let binary = aCrypto.finish(false); - return [toHexString(binary.charCodeAt(i)) for (i in binary)].join("").toLowerCase() + let hash = Array.from(binary, c => toHexString(c.charCodeAt(0))) + return hash.join("").toLowerCase(); } /** @@ -6111,7 +6121,13 @@ function AddonInstallWrapper(aInstall) { this.__defineGetter__("linkedInstalls", function AIW_linkedInstallsGetter() { if (!aInstall.linkedInstalls) return null; - return [i.wrapper for each (i in aInstall.linkedInstalls)]; + // Tycho: return [i.wrapper for each (i in aInstall.linkedInstalls)]; + let result = []; + for each (let i in aInstall.linkedInstalls) { + result.push(i.wrapper); + } + + return result; }); this.install = function AIW_install() { |