Bug 1276341 - don't use Cu.import for event-emitter.js; r=jryans

MozReview-Commit-ID: BDvrMP8fRim

--HG--
extra : rebase_source : a40ac300ff98f302bfbf5ce978172904426fa152
This commit is contained in:
Tom Tromey 2016-07-18 13:58:20 -06:00
parent c9840ff9af
commit ee883aab7f
4 changed files with 4 additions and 8 deletions

View File

@ -18,9 +18,7 @@ thisTestLeaksUncaughtRejectionsAndShouldBeFixed("TypeError: this.doc is undefine
const toolId1 = "test-tool-1";
const toolId2 = "test-tool-2";
var tempScope = {};
Cu.import("resource://devtools/shared/event-emitter.js", tempScope);
var EventEmitter = tempScope.EventEmitter;
var EventEmitter = require("devtools/shared/event-emitter");
function test() {
addTab("about:blank").then(runTests1);
@ -209,7 +207,6 @@ function destroyToolbox(toolbox) {
}
function finishUp() {
tempScope = null;
gBrowser.removeCurrentTab();
finish();
}

View File

@ -16,7 +16,6 @@ const NS_XHTML = "http://www.w3.org/1999/xhtml";
const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
loader.lazyImporter(this, "PluralForm", "resource://gre/modules/PluralForm.jsm");
loader.lazyImporter(this, "EventEmitter", "resource://devtools/shared/event-emitter.js");
loader.lazyGetter(this, "prefBranch", function () {
return Services.prefs.getBranch(null)
@ -32,6 +31,7 @@ loader.lazyRequireGetter(this, "ConsoleServiceListener", "devtools/shared/webcon
loader.lazyRequireGetter(this, "gDevTools", "devtools/client/framework/devtools", true);
loader.lazyRequireGetter(this, "gDevToolsBrowser", "devtools/client/framework/devtools-browser", true);
loader.lazyRequireGetter(this, "nodeConstants", "devtools/shared/dom-node-constants", true);
loader.lazyRequireGetter(this, "EventEmitter", "devtools/shared/event-emitter");
/**
* A collection of utilities to help working with commands

View File

@ -5,7 +5,7 @@
const {Cc, Ci, Cu, Cr} = require("chrome");
const promise = require("promise");
const {EventEmitter} = Cu.import("resource://devtools/shared/event-emitter.js", {});
const EventEmitter = require("devtools/shared/event-emitter");
const {generateUUID} = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator);
const {FileUtils} = Cu.import("resource://gre/modules/FileUtils.jsm", {});
const {indexedDB} = require("sdk/indexed-db");

View File

@ -24,8 +24,7 @@
const { utils: Cu } = Components;
const { require } = Cu.import("resource://devtools/shared/Loader.jsm", {});
const promise = require("promise");
const { EventEmitter } =
Cu.import("resource://devtools/shared/event-emitter.js", {});
const EventEmitter = require("devtools/shared/event-emitter");
const { Task } = require("devtools/shared/task");
SimpleTest.waitForExplicitFinish();