Bug 1142734: Allow unloading the loader sandbox module. r?jsantell draft
authorDave Townsend <dtownsend@oxymoronical.com>
Mon, 08 Feb 2016 10:55:56 -0800
changeset 329599 6f669e396b901b3a58b9b35ac20390d62d78befa
parent 328713 653df21ca86195f23cadc2fc180bff0c6831da25
child 329600 e51de234076ffabbf07f17dc1693db9a0a2014fb
push id10561
push userdtownsend@mozilla.com
push dateMon, 08 Feb 2016 19:03:34 +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;