Bug 1142734: Allow unloading the loader sandbox module. r=jsantell
authorDave Townsend <dtownsend@oxymoronical.com>
Mon, 08 Feb 2016 10:55:56 -0800
changeset 329854 9c63922674ac52435aabbfa62f65a48657d4942c
parent 329853 6e1c21facba82b35fd5a31d5375ee471402fb979
child 329855 5afb767f35912c1931481d24b31571fd8d14ac4c
push id10617
push userdtownsend@mozilla.com
push dateTue, 09 Feb 2016 16:30:19 +0000
reviewersjsantell
bugs1142734
milestone47.0a1
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.
addon-sdk/source/lib/sdk/loader/cuddlefish.js
--- 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;