Bug 1320793 - Fix lazy loading of pseudo modules in devtools. r=jryans
authorAlexandre Poirot <poirot.alex@gmail.com>
Mon, 28 Nov 2016 07:43:14 -0800
changeset 324781 b5bb7341ad8a75892822ddf527f45fbeddfdf1e4
parent 324780 46a0a73fde9ae76906ac32fe13155457bb457f94
child 324782 5c3271cb35c218a5976aa87873099b45719178ea
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersjryans
bugs1320793
milestone53.0a1
Bug 1320793 - Fix lazy loading of pseudo modules in devtools. r=jryans MozReview-Commit-ID: 51rH3WBH3dh
devtools/shared/Loader.jsm
--- a/devtools/shared/Loader.jsm
+++ b/devtools/shared/Loader.jsm
@@ -177,19 +177,22 @@ DevToolsLoader.prototype = {
     // can't be flagged as invisible to debugger.
     if (this.invisibleToDebugger) {
       delete modules.promise;
     }
 
     // Register custom pseudo modules to the current loader instance
     let loader = this._provider.loader;
     for (let id in modules) {
-      let exports = modules[id];
       let uri = resolveURI(id, loader.mapping);
-      loader.modules[uri] = { exports };
+      loader.modules[uri] = {
+        get exports() {
+          return modules[id];
+        }
+      };
     }
 
     // Register custom globals to the current loader instance
     globals.loader.id = this.id;
     Object.defineProperties(loader.globals, descriptor(globals));
 
     // Expose lazy helpers on loader
     this.lazyGetter = globals.loader.lazyGetter;