Permalink
Browse files

Make sure PrefLoader doesn't leak into the global scope (related to i…

…ssue 5768)
  • Loading branch information...
1 parent 0bad6a4 commit b357b7a1548a1d6c7670323e076f8c782e3330cf @janodvarko janodvarko committed Oct 9, 2012
@@ -9,7 +9,11 @@ var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://firebug/fbtrace.js");
Cu.import("resource://firebug/loader.js");
-Cu.import("resource://firebug/prefLoader.js");
+
+// Make sure PrefLoader variable doesn't leak into the global scope.
+var prefLoaderScope = {};
+Cu.import("resource://firebug/prefLoader.js", prefLoaderScope);
+var PrefLoader = prefLoaderScope.PrefLoader;
const firstRunPage = "https://getfirebug.com/firstrun#Firebug ";
@@ -22,7 +22,10 @@ var cmdLineHandler = Cc["@mozilla.org/commandlinehandler/general-startup;1?type=
var wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
-Cu.import("resource://firebug/prefLoader.js");
+// Make sure PrefLoader variable doesn't leak into the global scope.
+var prefLoaderScope = {};
+Cu.import("resource://firebug/prefLoader.js", prefLoaderScope);
+var PrefLoader = prefLoaderScope.PrefLoader;
var getPref = PrefLoader.getPref;
Cu.import("resource://firebug/fbtrace.js");
@@ -9,7 +9,11 @@ var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://firebug/fbtrace.js");
Cu.import("resource://firebug/loader.js");
-Cu.import("resource://firebug/prefLoader.js");
+
+// Make sure PrefLoader variable doesn't leak into the global scope.
+var prefLoaderScope = {};
+Cu.import("resource://firebug/prefLoader.js", prefLoaderScope);
+var PrefLoader = prefLoaderScope.PrefLoader;
const firstRunPage = "https://getfirebug.com/firstrun#Firebug ";

0 comments on commit b357b7a

Please sign in to comment.