Bug 1142734: Allow unloading the loader sandbox module. r?jsantell
const declarations are no longer accessible from outside the script that makes
them so in order for bootstrap.js to be able to access the loaderSandbox
declaration we must use var.
--- a/addon-sdk/source/lib/sdk/loader/cuddlefish.js
+++ b/addon-sdk/source/lib/sdk/loader/cuddlefish.js
@@ -21,17 +21,17 @@ const { classes: Cc, Constructor: CC, in
// `loadSandbox` is exposed by bootstrap.js
const loaderURI = module.uri.replace("sdk/loader/cuddlefish.js",
"toolkit/loader.js");
const xulappURI = module.uri.replace("loader/cuddlefish.js",
"system/xul-app.jsm");
// We need to keep a reference to the sandbox in order to unload it in
// bootstrap.js
-const loaderSandbox = loadSandbox(loaderURI);
+var loaderSandbox = loadSandbox(loaderURI);
const loaderModule = loaderSandbox.exports;
const { incompatibility } = Cu.import(xulappURI, {}).XulApp;
const { override, load } = loaderModule;
function CuddlefishLoader(options) {
let { manifest } = options;