Bug 1436310 - Port bug 1432992 to chat: Remove definitions of Ci, Cr, Cc, and Cu. r=florian
authorRichard Marti <richard.marti@gmail.com>
Wed, 07 Feb 2018 12:19:12 +0100
changeset 31061 f40eacb79d82103c057e7be7801464c472b96f9d
parent 31060 0ef2fab5b6fbc29ac4d36515591dedc279ca8d80
child 31062 c32109102bb911d33544ff3bd89352e9849c38db
push id383
push userclokep@gmail.com
push dateMon, 07 May 2018 21:52:48 +0000
reviewersflorian
bugs1436310, 1432992
Bug 1436310 - Port bug 1432992 to chat: Remove definitions of Ci, Cr, Cc, and Cu. r=florian
chat/components/src/imAccounts.js
chat/components/src/imCommands.js
chat/components/src/imContacts.js
chat/components/src/imConversations.js
chat/components/src/imCore.js
chat/components/src/logger.js
chat/components/src/smileProtocolHandler.js
chat/components/src/test/test_accounts.js
chat/components/src/test/test_commands.js
chat/components/src/test/test_conversations.js
chat/components/src/test/test_logger.js
chat/content/imAccountOptionsHelper.js
chat/modules/imStatusUtils.jsm
chat/modules/imTextboxUtils.jsm
chat/modules/imThemes.jsm
chat/modules/imXPCOMUtils.jsm
chat/modules/jsProtoHelper.jsm
chat/modules/socket.jsm
chat/protocols/facebook/facebook.js
chat/protocols/gtalk/gtalk.js
chat/protocols/irc/irc.js
chat/protocols/irc/ircBase.jsm
chat/protocols/irc/ircCAP.jsm
chat/protocols/irc/ircCTCP.jsm
chat/protocols/irc/ircCommands.jsm
chat/protocols/irc/ircDCC.jsm
chat/protocols/irc/ircHandlers.jsm
chat/protocols/irc/ircISUPPORT.jsm
chat/protocols/irc/ircNonStandard.jsm
chat/protocols/irc/ircSASL.jsm
chat/protocols/irc/ircServerTime.jsm
chat/protocols/irc/ircServices.jsm
chat/protocols/irc/ircUtils.jsm
chat/protocols/irc/ircWatchMonitor.jsm
chat/protocols/matrix/matrix-sdk.jsm
chat/protocols/matrix/matrix.js
chat/protocols/odnoklassniki/odnoklassniki.js
chat/protocols/skype/skype.js
chat/protocols/twitter/twitter.js
chat/protocols/xmpp/test/test_xmppParser.js
chat/protocols/xmpp/xmpp-authmechs.jsm
chat/protocols/xmpp/xmpp-commands.jsm
chat/protocols/xmpp/xmpp-session.jsm
chat/protocols/xmpp/xmpp-xml.jsm
chat/protocols/xmpp/xmpp.js
chat/protocols/xmpp/xmpp.jsm
chat/protocols/yahoo/yahoo.js
--- a/chat/components/src/imAccounts.js
+++ b/chat/components/src/imAccounts.js
@@ -1,13 +1,12 @@
 /* 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/. */
 
-var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/imServices.jsm");
 ChromeUtils.import("resource:///modules/jsProtoHelper.jsm");
 
 var kPrefAutologinPending = "messenger.accounts.autoLoginPending";
 var kPrefMessengerAccounts = "messenger.accounts";
 var kPrefAccountPrefix = "messenger.account.";
 var kAccountKeyPrefix = "account";
--- a/chat/components/src/imCommands.js
+++ b/chat/components/src/imCommands.js
@@ -1,14 +1,12 @@
 /* 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/. */
 
-var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
-
 ChromeUtils.import("resource:///modules/imServices.jsm");
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "_", () =>
   l10nHelper("chrome://chat/locale/commands.properties")
 );
 
 function CommandsService() { }
--- a/chat/components/src/imContacts.js
+++ b/chat/components/src/imContacts.js
@@ -1,13 +1,12 @@
 /* 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/. */
 
-var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/imServices.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "_", () =>
   l10nHelper("chrome://chat/locale/contacts.properties")
 );
 
 var gDBConnection = null;
--- a/chat/components/src/imConversations.js
+++ b/chat/components/src/imConversations.js
@@ -1,13 +1,12 @@
 /* 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/. */
 
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 ChromeUtils.import("resource:///modules/imServices.jsm");
 ChromeUtils.import("resource:///modules/imStatusUtils.jsm");
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/jsProtoHelper.jsm");
 
 var gLastUIConvId = 0;
 var gLastPrplConvId = 0;
 
--- a/chat/components/src/imCore.js
+++ b/chat/components/src/imCore.js
@@ -1,13 +1,12 @@
 /* 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/. */
 
-var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
 ChromeUtils.import("resource:///modules/imServices.jsm");
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "categoryManager",
                                    "@mozilla.org/categorymanager;1",
                                    "nsICategoryManager");
 
 var kQuitApplicationGranted = "quit-application-granted";
--- a/chat/components/src/logger.js
+++ b/chat/components/src/logger.js
@@ -1,13 +1,13 @@
 /* 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/. */
 
-var {classes: Cc, interfaces: Ci, utils: Cu, Constructor: CC} = Components;
+var CC = Components.Constructor;
 
 ChromeUtils.import("resource:///modules/hiddenWindow.jsm");
 ChromeUtils.import("resource:///modules/imServices.jsm");
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/jsProtoHelper.jsm");
 ChromeUtils.import("resource:///modules/ToLocaleFormat.jsm");
 
 ChromeUtils.import("resource://gre/modules/Task.jsm")
--- a/chat/components/src/smileProtocolHandler.js
+++ b/chat/components/src/smileProtocolHandler.js
@@ -1,14 +1,12 @@
 /* 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/. */
 
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/imSmileys.jsm");
 
 var kSmileRegexp = /^smile:\/\//;
 
 function smileProtocolHandler() { }
 
--- a/chat/components/src/test/test_accounts.js
+++ b/chat/components/src/test/test_accounts.js
@@ -1,14 +1,12 @@
 /* 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/. */
 
-var {interfaces: Ci, utils: Cu} = Components;
-
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/imServices.jsm");
 ChromeUtils.import("resource://testing-common/AppInfo.jsm");
 
 function run_test() {
   do_get_profile();
 
   // Test the handling of accounts for unknown protocols.
--- a/chat/components/src/test/test_commands.js
+++ b/chat/components/src/test/test_commands.js
@@ -1,14 +1,12 @@
 /* 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/. */
 
-var {interfaces: Ci, utils: Cu} = Components;
-
 ChromeUtils.import("resource:///modules/imServices.jsm");
 // We don't load the command service via Services as we want to access
 // _findCommands in order to avoid having to intercept command execution.
 var imCommands = {};
 Services.scriptloader.loadSubScript("resource:///components/imCommands.js", imCommands);
 
 var kPrplId = "green";
 var kPrplId2 = "red";
--- a/chat/components/src/test/test_conversations.js
+++ b/chat/components/src/test/test_conversations.js
@@ -1,12 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-var {interfaces: Ci, utils: Cu} = Components;
 ChromeUtils.import("resource:///modules/imServices.jsm");
 ChromeUtils.import("resource:///modules/jsProtoHelper.jsm");
 
 var imConversations = {};
 Services.scriptloader.loadSubScript(
   "resource:///components/imConversations.js", imConversations
 );
 
--- a/chat/components/src/test/test_logger.js
+++ b/chat/components/src/test/test_logger.js
@@ -1,14 +1,12 @@
 /* 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/. */
 
-var {interfaces: Ci, utils: Cu} = Components;
-
 do_get_profile();
 
 ChromeUtils.import("resource:///modules/imServices.jsm");
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource://gre/modules/osfile.jsm");
 ChromeUtils.import("resource://gre/modules/Task.jsm");
 
 var gLogger = {};
--- a/chat/content/imAccountOptionsHelper.js
+++ b/chat/content/imAccountOptionsHelper.js
@@ -1,14 +1,12 @@
 /* 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/. */
 
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
 var accountOptionsHelper = {
   createTextbox: function(aType, aValue, aLabel, aName, aContainerType) {
     let container = document.createElement(aContainerType);
     if (aContainerType == "row")
       container.setAttribute("align", "center");
 
     let label = document.createElement("label");
     label.textContent = aLabel;
--- a/chat/modules/imStatusUtils.jsm
+++ b/chat/modules/imStatusUtils.jsm
@@ -1,16 +1,14 @@
 /* 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/. */
 
 this.EXPORTED_SYMBOLS = ["Status"];
 
-var {interfaces: Ci, utils: Cu} = Components;
-
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/imServices.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "_", () =>
   l10nHelper("chrome://chat/locale/status.properties")
 );
 
 var imIStatusInfo = Ci.imIStatusInfo;
--- a/chat/modules/imTextboxUtils.jsm
+++ b/chat/modules/imTextboxUtils.jsm
@@ -4,17 +4,16 @@
 
 this.EXPORTED_SYMBOLS = [
   "MessageFormat",
   "TextboxSize",
   "TextboxSpellChecker"
 ];
 
 ChromeUtils.import("resource:///modules/imServices.jsm");
-var Ci = Components.interfaces;
 
 var MessageFormat = {
   _observedPrefs: [],
 
   getValues: function mf_getValues() {
     this.unregisterObservers();
     let langGroup =
       Services.prefs.getComplexValue("font.language.group",
--- a/chat/modules/imThemes.jsm
+++ b/chat/modules/imThemes.jsm
@@ -9,18 +9,16 @@ this.EXPORTED_SYMBOLS = [
   "getThemeVariants",
   "isNextMessage",
   "insertHTMLForMessage",
   "initHTMLDocument",
   "getMessagesForRange",
   "serializeSelection"
 ];
 
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
 ChromeUtils.import("resource:///modules/imServices.jsm");
 ChromeUtils.import("resource://gre/modules/DownloadUtils.jsm");
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 
 var kMessagesStylePrefBranch = "messenger.options.messagesStyle.";
 var kThemePref = "theme";
 var kVariantPref = "variant";
 var kShowHeaderPref = "showHeader";
--- a/chat/modules/imXPCOMUtils.jsm
+++ b/chat/modules/imXPCOMUtils.jsm
@@ -9,18 +9,16 @@ this.EXPORTED_SYMBOLS = [
   "executeSoon",
   "nsSimpleEnumerator",
   "EmptyEnumerator",
   "ClassInfo",
   "l10nHelper",
   "initLogModule"
 ];
 
-var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
 ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/imServices.jsm");
 
 var kLogLevelPref = "purple.debug.loglevel";
 
 /**
  * Creates an nsIScriptError instance and logs it.
  *
--- a/chat/modules/jsProtoHelper.jsm
+++ b/chat/modules/jsProtoHelper.jsm
@@ -10,18 +10,16 @@ this.EXPORTED_SYMBOLS = [
   "GenericConvChatBuddyPrototype",
   "GenericConversationPrototype",
   "GenericMessagePrototype",
   "GenericProtocolPrototype",
   "Message",
   "TooltipInfo"
 ];
 
-var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
-
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/imServices.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "_", () =>
   l10nHelper("chrome://chat/locale/conversations.properties")
 );
 
 var GenericAccountPrototype = {
--- a/chat/modules/socket.jsm
+++ b/chat/modules/socket.jsm
@@ -73,17 +73,16 @@
  * To Do:
  *   Add a message queue to keep from flooding a server (just an array, just
  *     keep shifting the first element off and calling as setTimeout for the
  *     desired flood time?).
  */
 
 this.EXPORTED_SYMBOLS = ["Socket"];
 
-var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource:///modules/ArrayBufferUtils.jsm");
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/hiddenWindow.jsm");
 
 // Network errors see: xpcom/base/nsError.h
 var NS_ERROR_MODULE_NETWORK = 2152398848;
 var NS_ERROR_CONNECTION_REFUSED = NS_ERROR_MODULE_NETWORK + 13;
--- a/chat/protocols/facebook/facebook.js
+++ b/chat/protocols/facebook/facebook.js
@@ -1,14 +1,12 @@
 /* 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/. */
 
-var {interfaces: Ci, utils: Cu} = Components;
-
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/jsProtoHelper.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "_", () =>
   l10nHelper("chrome://chat/locale/facebook.properties")
 );
 
 function FacebookAccount(aProtoInstance, aImAccount) {
--- a/chat/protocols/gtalk/gtalk.js
+++ b/chat/protocols/gtalk/gtalk.js
@@ -1,14 +1,12 @@
 /* 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/. */
 
-var Cu = Components.utils;
-
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/jsProtoHelper.jsm");
 ChromeUtils.import("resource:///modules/xmpp.jsm");
 ChromeUtils.import("resource:///modules/xmpp-session.jsm");
 ChromeUtils.import("resource:///modules/xmpp-xml.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "_", () =>
   l10nHelper("chrome://chat/locale/xmpp.properties")
--- a/chat/protocols/irc/irc.js
+++ b/chat/protocols/irc/irc.js
@@ -1,14 +1,12 @@
 /* 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/. */
 
-var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
-
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/imServices.jsm");
 ChromeUtils.import("resource:///modules/ircUtils.jsm");
 ChromeUtils.import("resource:///modules/ircHandlers.jsm");
 ChromeUtils.import("resource:///modules/jsProtoHelper.jsm");
 ChromeUtils.import("resource:///modules/NormalizedMap.jsm");
 ChromeUtils.import("resource:///modules/socket.jsm");
 
--- a/chat/protocols/irc/ircBase.jsm
+++ b/chat/protocols/irc/ircBase.jsm
@@ -14,18 +14,16 @@
  *     http://tools.ietf.org/html/rfc2812
  *   RFC 2813: Internet Relay Chat: Server Protocol
  *     http://tools.ietf.org/html/rfc2813
  *   RFC 1459: Internet Relay Chat Protocol
  *     http://tools.ietf.org/html/rfc1459
  */
 this.EXPORTED_SYMBOLS = ["ircBase"];
 
-var {interfaces: Ci, utils: Cu} = Components;
-
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/imServices.jsm");
 ChromeUtils.import("resource:///modules/ircHandlers.jsm");
 ChromeUtils.import("resource:///modules/ircUtils.jsm");
 ChromeUtils.import("resource:///modules/jsProtoHelper.jsm");
 
 function privmsg(aAccount, aMessage, aIsNotification) {
   let params = {incoming: true, tags: aMessage.tags};
--- a/chat/protocols/irc/ircCAP.jsm
+++ b/chat/protocols/irc/ircCAP.jsm
@@ -14,18 +14,16 @@
  *     http://ircv3.net/specs/core/capability-negotiation-3.2.html
  *
  * Note that this doesn't include any implementation as these RFCs do not even
  * include example parameters.
  */
 
 this.EXPORTED_SYMBOLS = ["ircCAP"];
 
-var Cu = Components.utils;
-
 ChromeUtils.import("resource:///modules/ircHandlers.jsm");
 ChromeUtils.import("resource:///modules/ircUtils.jsm");
 
 /*
  * Parses a CAP message of the form:
  *   CAP <subcommand> [<parameters>]
  * The cap field is added to the message and it has the following fields:
  *   subcommand
--- a/chat/protocols/irc/ircCTCP.jsm
+++ b/chat/protocols/irc/ircCTCP.jsm
@@ -5,18 +5,16 @@
 /*
  * This implements the Client-to-Client Protocol (CTCP), a subprotocol of IRC.
  *   REVISED AND UPDATED CTCP SPECIFICATION
  *     http://www.alien.net.au/irc/ctcp.txt
  */
 
 this.EXPORTED_SYMBOLS = ["ircCTCP", "ctcpBase"];
 
-var Cu = Components.utils;
-
 ChromeUtils.import("resource:///modules/imServices.jsm");
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/ircHandlers.jsm");
 ChromeUtils.import("resource:///modules/ircUtils.jsm");
 
 // Split into a CTCP message which is a single command and a single parameter:
 //   <command> " " <parameter>
 // The high level dequote is to unescape \001 in the message content.
--- a/chat/protocols/irc/ircCommands.jsm
+++ b/chat/protocols/irc/ircCommands.jsm
@@ -1,18 +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/. */
 
 // This is to be exported directly onto the IRC prplIProtocol object, directly
 // implementing the commands field before we register them.
 this.EXPORTED_SYMBOLS = ["commands"];
 
-var {interfaces: Ci, utils: Cu} = Components;
-
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/ircUtils.jsm");
 ChromeUtils.defineModuleGetter(this, "Task", "resource://gre/modules/Task.jsm");
 
 // Shortcut to get the JavaScript conversation object.
 function getConv(aConv) { return aConv.wrappedJSObject; }
 
 // Shortcut to get the JavaScript account object.
--- a/chat/protocols/irc/ircDCC.jsm
+++ b/chat/protocols/irc/ircDCC.jsm
@@ -6,18 +6,16 @@
  * This contains an implementation of the Direct Client-to-Client (DCC)
  * protocol.
  *   A description of the DCC protocol
  *     http://www.irchelp.org/irchelp/rfc/dccspec.html
  */
 
 this.EXPORTED_SYMBOLS = ["ctcpDCC"/*, "dccBase"*/];
 
-var Cu = Components.utils;
-
 ChromeUtils.import("resource:///modules/ircHandlers.jsm");
 ChromeUtils.import("resource:///modules/ircUtils.jsm");
 ChromeUtils.import("resource:///modules/jsProtoHelper.jsm");
 
 // Parse a CTCP message into a DCC message. A DCC message is a CTCP message of
 // the form:
 //   DCC <type> <argument> <address> <port> [<size>]
 function DCCMessage(aMessage, aAccount) {
--- a/chat/protocols/irc/ircHandlers.jsm
+++ b/chat/protocols/irc/ircHandlers.jsm
@@ -1,16 +1,14 @@
 /* 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/. */
 
 this.EXPORTED_SYMBOLS = ["ircHandlers"];
 
-var Cu = Components.utils;
-
 ChromeUtils.import("resource:///modules/ircUtils.jsm");
 
 var ircHandlers = {
   /*
    * Object to hold the IRC handlers, each handler is an object that implements:
    *   name        The display name of the handler.
    *   priority    The priority of the handler (0 is default, positive is
    *               higher priority)
--- a/chat/protocols/irc/ircISUPPORT.jsm
+++ b/chat/protocols/irc/ircISUPPORT.jsm
@@ -9,18 +9,16 @@
  *     http://www.irc.org/tech_docs/005.html
  *   RFC Drafts: IRC RPL_ISUPPORT Numeric Definition
  *     http://tools.ietf.org/html/draft-brocklesby-irc-isupport-03
  *     http://tools.ietf.org/html/draft-hardy-irc-isupport-00
  */
 
 this.EXPORTED_SYMBOLS = ["ircISUPPORT", "isupportBase"];
 
-var Cu = Components.utils;
-
 ChromeUtils.import("resource:///modules/ircHandlers.jsm");
 ChromeUtils.import("resource:///modules/ircUtils.jsm");
 
 /*
  * Parses an ircMessage into an ISUPPORT message for each token of the form:
  *   <parameter>=<value> or -<value>
  * The isupport field is added to the message and it has the following fields:
  *   parameter  What is being configured by this ISUPPORT token.
--- a/chat/protocols/irc/ircNonStandard.jsm
+++ b/chat/protocols/irc/ircNonStandard.jsm
@@ -9,18 +9,16 @@
  * listing the known servers that support this extension.
  *
  * Resources for these commands include:
  *  https://github.com/atheme/charybdis/blob/master/include/numeric.h
  *  http://hg.unrealircd.com/hg/unreal/raw-file/tip/include/numeric.h
  */
 this.EXPORTED_SYMBOLS = ["ircNonStandard"];
 
-var {interfaces: Ci, utils: Cu} = Components;
-
 ChromeUtils.import("resource:///modules/ircHandlers.jsm");
 ChromeUtils.import("resource:///modules/ircUtils.jsm");
 
 var ircNonStandard = {
   name: "Non-Standard IRC Extensions",
   priority: ircHandlers.DEFAULT_PRIORITY + 1,
   isEnabled: () => true,
 
--- a/chat/protocols/irc/ircSASL.jsm
+++ b/chat/protocols/irc/ircSASL.jsm
@@ -5,18 +5,16 @@
 /*
  * This implements SASL for IRC.
  *   https://raw.github.com/atheme/atheme/master/doc/SASL
  *   https://github.com/ircv3/ircv3-specifications/blob/master/extensions/sasl-3.1
  */
 
 this.EXPORTED_SYMBOLS = ["ircSASL", "capSASL"];
 
-var Cu = Components.utils;
-
 ChromeUtils.import("resource:///modules/ircHandlers.jsm");
 ChromeUtils.import("resource:///modules/ircUtils.jsm");
 
 var ircSASL = {
   name: "SASL AUTHENTICATE",
   priority: ircHandlers.DEFAULT_PRIORITY,
   isEnabled: () => true,
 
--- a/chat/protocols/irc/ircServerTime.jsm
+++ b/chat/protocols/irc/ircServerTime.jsm
@@ -4,18 +4,16 @@
 
 /*
  * This implements server-time for IRC.
  *   http://ircv3.net/specs/extensions/server-time-3.2.html
  */
 
 this.EXPORTED_SYMBOLS = ["capServerTime", "tagServerTime"];
 
-const Cu = Components.utils;
-
 ChromeUtils.import("resource:///modules/ircHandlers.jsm");
 
 function handleServerTimeTag(aMsg) {
   if (aMsg.tagValue) {
     // Normalize leap seconds to the next second before it.
     const time = aMsg.tagValue.replace(/60.\d{3}(?=Z$)/, "59.999");
     aMsg.message.time = Math.floor(Date.parse(time) / 1000);
     aMsg.message.delayed = true;
--- a/chat/protocols/irc/ircServices.jsm
+++ b/chat/protocols/irc/ircServices.jsm
@@ -13,18 +13,16 @@
  * showing the message to the user if we're unsure what to do.
  *
  * Anope
  *  http://www.anope.org/docgen/1.8/
  */
 
 this.EXPORTED_SYMBOLS = ["ircServices", "servicesBase"];
 
-var Cu = Components.utils;
-
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/ircHandlers.jsm");
 ChromeUtils.import("resource:///modules/ircUtils.jsm");
 
 /*
  * If a service is found, an extra field (serviceName) is added with the
  * "generic" service name (e.g. a bot which performs NickServ like functionality
  * will be mapped to NickServ).
--- a/chat/protocols/irc/ircUtils.jsm
+++ b/chat/protocols/irc/ircUtils.jsm
@@ -1,17 +1,15 @@
 /* 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/. */
 
 this.EXPORTED_SYMBOLS = ["_", "_conv", "ctcpFormatToText", "ctcpFormatToHTML",
                           "conversationErrorMessage", "kListRefreshInterval"];
 
-var {classes: Cc, interfaces: Ci} = Components;
-
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "_", () =>
   l10nHelper("chrome://chat/locale/irc.properties")
 );
 
 XPCOMUtils.defineLazyGetter(this, "_conv", () =>
   l10nHelper("chrome://chat/locale/conversations.properties")
--- a/chat/protocols/irc/ircWatchMonitor.jsm
+++ b/chat/protocols/irc/ircWatchMonitor.jsm
@@ -10,18 +10,16 @@
  *     https://github.com/atheme/charybdis/blob/master/doc/monitor.txt
  *   WATCH (supported by Bahamut and UnrealIRCd)
  *     http://www.stack.nl/~jilles/cgi-bin/hgwebdir.cgi/irc-documentation-jilles/raw-file/tip/reference/draft-meglio-irc-watch-00.txt
  */
 
 this.EXPORTED_SYMBOLS = ["ircWATCH", "isupportWATCH", "ircMONITOR",
                           "isupportMONITOR"];
 
-var {interfaces: Ci, utils: Cu} = Components;
-
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/ircHandlers.jsm");
 ChromeUtils.import("resource:///modules/ircUtils.jsm");
 
 function setStatus(aAccount, aNick, aStatus) {
   if (!aAccount.watchEnabled && !aAccount.monitorEnabled)
     return false;
 
--- a/chat/protocols/matrix/matrix-sdk.jsm
+++ b/chat/protocols/matrix/matrix-sdk.jsm
@@ -1,14 +1,12 @@
 /* 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/. */
 
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
 ChromeUtils.import("resource://gre/modules/Console.jsm");
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 ChromeUtils.import("resource://gre/modules/Timer.jsm");
 Cu.importGlobalProperties(["XMLHttpRequest"]);
 
 const { Loader, Require, Module } = ChromeUtils.import("resource://devtools/shared/base-loader.js", {});
 
 this.EXPORTED_SYMBOLS = ["MatrixSDK"];
--- a/chat/protocols/matrix/matrix.js
+++ b/chat/protocols/matrix/matrix.js
@@ -1,14 +1,12 @@
 /* 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/. */
 
-var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
-
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/jsProtoHelper.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "_", () =>
   l10nHelper("chrome://chat/locale/matrix.properties")
 );
 
 ChromeUtils.defineModuleGetter(this, "MatrixSDK", "resource:///modules/matrix-sdk.jsm");
--- a/chat/protocols/odnoklassniki/odnoklassniki.js
+++ b/chat/protocols/odnoklassniki/odnoklassniki.js
@@ -1,14 +1,12 @@
 /* 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/. */
 
-var {interfaces: Ci, utils: Cu} = Components;
-
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/jsProtoHelper.jsm");
 ChromeUtils.import("resource:///modules/xmpp.jsm");
 ChromeUtils.import("resource:///modules/xmpp-session.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "_", () =>
   l10nHelper("chrome://chat/locale/xmpp.properties")
 );
--- a/chat/protocols/skype/skype.js
+++ b/chat/protocols/skype/skype.js
@@ -1,14 +1,12 @@
 /* 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/. */
 
-var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
-
 ChromeUtils.import("resource://gre/modules/Http.jsm");
 ChromeUtils.import("resource:///modules/ArrayBufferUtils.jsm");
 ChromeUtils.import("resource:///modules/BigInteger.jsm");
 ChromeUtils.import("resource:///modules/imServices.jsm");
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/jsProtoHelper.jsm");
 
 // Constants used by the login process. This emulates a captured session using
--- a/chat/protocols/twitter/twitter.js
+++ b/chat/protocols/twitter/twitter.js
@@ -1,14 +1,12 @@
 /* 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/. */
 
-var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
-
 ChromeUtils.import("resource://gre/modules/Http.jsm");
 ChromeUtils.import("resource:///modules/imServices.jsm");
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/jsProtoHelper.jsm");
 ChromeUtils.import("resource:///modules/twitter-text.jsm");
 
 var NS_PREFBRANCH_PREFCHANGE_TOPIC_ID = "nsPref:changed";
 var kMaxMessageLength = 140;
--- a/chat/protocols/xmpp/test/test_xmppParser.js
+++ b/chat/protocols/xmpp/test/test_xmppParser.js
@@ -1,12 +1,11 @@
 /* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
 ChromeUtils.import("resource://gre/modules/Services.jsm");
 
 var xmppXml = {};
 Services.scriptloader.loadSubScript("resource:///modules/xmpp-xml.jsm", xmppXml);
 
 var TEST_DATA = [
   {
     input: '<message xmlns="jabber:client" from="juliet@capulet.example/balcony" \
--- a/chat/protocols/xmpp/xmpp-authmechs.jsm
+++ b/chat/protocols/xmpp/xmpp-authmechs.jsm
@@ -7,18 +7,16 @@
 // By default we currently support the PLAIN and the DIGEST-MD5 mechanisms.
 // As this is only used by XMPPSession, it may seem like an internal
 // detail of the XMPP implementation, but exporting it is valuable so that
 // add-ons can add support for more auth mechanisms easily by adding them
 // in XMPPAuthMechanisms without having to modify XMPPSession.
 
 this.EXPORTED_SYMBOLS = ["XMPPAuthMechanisms"];
 
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
 ChromeUtils.import("resource://services-crypto/utils.js");
 ChromeUtils.import("resource:///modules/xmpp-xml.jsm");
 
 // Handle PLAIN authorization mechanism.
 function* PlainAuth(aUsername, aPassword, aDomain) {
   let data = "\0"+ aUsername + "\0" + aPassword;
 
   // btoa for Unicode, see https://developer.mozilla.org/en-US/docs/DOM/window.btoa
--- a/chat/protocols/xmpp/xmpp-commands.jsm
+++ b/chat/protocols/xmpp/xmpp-commands.jsm
@@ -1,16 +1,14 @@
 /* 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/. */
 
 this.EXPORTED_SYMBOLS = ["commands"];
 
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "_", () =>
   l10nHelper("chrome://chat/locale/xmpp.properties")
 );
 
 // Get conversation object.
 function getConv(aConv) {
--- a/chat/protocols/xmpp/xmpp-session.jsm
+++ b/chat/protocols/xmpp/xmpp-session.jsm
@@ -1,16 +1,14 @@
 /* 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/. */
 
 this.EXPORTED_SYMBOLS = ["XMPPSession", "XMPPDefaultResource"];
 
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
 ChromeUtils.import("resource:///modules/DNS.jsm");
 ChromeUtils.import("resource:///modules/imServices.jsm");
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/socket.jsm");
 ChromeUtils.import("resource:///modules/xmpp-xml.jsm");
 ChromeUtils.import("resource:///modules/xmpp-authmechs.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "_", () =>
--- a/chat/protocols/xmpp/xmpp-xml.jsm
+++ b/chat/protocols/xmpp/xmpp-xml.jsm
@@ -1,16 +1,14 @@
 /* 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/. */
 
 this.EXPORTED_SYMBOLS = ["Stanza", "XMPPParser", "SupportedFeatures"];
 
-var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
-
 var NS = {
   xml                       : "http://www.w3.org/XML/1998/namespace",
   xhtml                     : "http://www.w3.org/1999/xhtml",
   xhtml_im                  : "http://jabber.org/protocol/xhtml-im",
 
   //auth
   client                    : "jabber:client",
   streams                   : "http://etherx.jabber.org/streams",
--- a/chat/protocols/xmpp/xmpp.js
+++ b/chat/protocols/xmpp/xmpp.js
@@ -1,14 +1,12 @@
 /* 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/. */
 
-var Cu = Components.utils;
-
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/jsProtoHelper.jsm");
 ChromeUtils.import("resource:///modules/xmpp.jsm");
 ChromeUtils.import("resource:///modules/xmpp-session.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "_", () =>
   l10nHelper("chrome://chat/locale/xmpp.properties")
 );
--- a/chat/protocols/xmpp/xmpp.jsm
+++ b/chat/protocols/xmpp/xmpp.jsm
@@ -4,18 +4,16 @@
 
 this.EXPORTED_SYMBOLS = [
   "XMPPConversationPrototype",
   "XMPPMUCConversationPrototype",
   "XMPPAccountBuddyPrototype",
   "XMPPAccountPrototype"
 ];
 
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
 ChromeUtils.import("resource:///modules/imServices.jsm");
 ChromeUtils.import("resource:///modules/imStatusUtils.jsm");
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/jsProtoHelper.jsm");
 ChromeUtils.import("resource:///modules/NormalizedMap.jsm");
 ChromeUtils.import("resource:///modules/socket.jsm");
 ChromeUtils.import("resource:///modules/xmpp-xml.jsm");
 ChromeUtils.import("resource:///modules/xmpp-session.jsm");
--- a/chat/protocols/yahoo/yahoo.js
+++ b/chat/protocols/yahoo/yahoo.js
@@ -1,14 +1,12 @@
 /* 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/. */
 
-var {interfaces: Ci, utils: Cu} = Components;
-
 ChromeUtils.import("resource:///modules/imXPCOMUtils.jsm");
 ChromeUtils.import("resource:///modules/jsProtoHelper.jsm");
 
 XPCOMUtils.defineLazyGetter(this, "_", () =>
   l10nHelper("chrome://chat/locale/yahoo.properties")
 );
 
 function YahooAccount(aProtoInstance, aImAccount)