Bug 1384527 - Stop importing event-emitter as a JSM. r=jdescottes draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Tue, 25 Jul 2017 18:30:59 +0200
changeset 615844 58c18b66d03e7aa0154f738775c7d89a9eef9043
parent 615843 fcde17aa05c21b42fbb7fabe1927f8ce7f863b83
child 615845 48e1c571c98904f3b3d9e28ceb91e14f56a03418
push id70493
push userbmo:poirot.alex@gmail.com
push dateWed, 26 Jul 2017 11:45:46 +0000
reviewersjdescottes
bugs1384527
milestone56.0a1
Bug 1384527 - Stop importing event-emitter as a JSM. r=jdescottes MozReview-Commit-ID: FnIRJbILIxj
devtools/client/shared/widgets/AbstractTreeItem.jsm
devtools/shared/apps/Devices.jsm
devtools/shared/apps/Simulator.jsm
--- a/devtools/client/shared/widgets/AbstractTreeItem.jsm
+++ b/devtools/client/shared/widgets/AbstractTreeItem.jsm
@@ -7,18 +7,17 @@
 
 const { interfaces: Ci, utils: Cu } = Components;
 
 const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
 const { XPCOMUtils } = require("resource://gre/modules/XPCOMUtils.jsm");
 const { ViewHelpers } = require("devtools/client/shared/widgets/view-helpers");
 const { KeyCodes } = require("devtools/client/shared/keycodes");
 
-XPCOMUtils.defineLazyModuleGetter(this, "EventEmitter",
-  "resource://devtools/shared/event-emitter.js");
+const EventEmitter = require("devtools/shared/event-emitter");
 
 XPCOMUtils.defineLazyModuleGetter(this, "console",
   "resource://gre/modules/Console.jsm");
 
 this.EXPORTED_SYMBOLS = ["AbstractTreeItem"];
 
 /**
  * A very generic and low-level tree view implementation. It is not intended
--- a/devtools/shared/apps/Devices.jsm
+++ b/devtools/shared/apps/Devices.jsm
@@ -1,15 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-Components.utils.import("resource://devtools/shared/event-emitter.js");
+const { require } = Components.utils.import("resource://devtools/shared/Loader.jsm", {});
+const EventEmitter = require("devtools/shared/event-emitter");
 
 /* exported EXPORTED_SYMBOLS */
 
 const EXPORTED_SYMBOLS = ["Devices"];
 
 var addonInstalled = false;
 
 const Devices = {
--- a/devtools/shared/apps/Simulator.jsm
+++ b/devtools/shared/apps/Simulator.jsm
@@ -1,15 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-Components.utils.import("resource://devtools/shared/event-emitter.js");
+const { require } = Components.utils.import("resource://devtools/shared/Loader.jsm", {});
+const EventEmitter = require("devtools/shared/event-emitter");
 
 /**
  * TODO (Bug 1132453) The `Simulator` module is deprecated, and should be
  * removed once all simulator addons stop using it (see bug 1132452).
  *
  * If you want to register, unregister, or otherwise deal with installed
  * simulators, please use the `Simulators` module defined in:
  *