Use 'const' consistently (instead of a mix of const/let/var) for the EXPORTED_SYMBOLS symbol of JS modules.
Use 'const' consistently (instead of a mix of const/let/var) for the EXPORTED_SYMBOLS symbol of JS modules.
--- a/chat/modules/hiddenWindow.jsm
+++ b/chat/modules/hiddenWindow.jsm
@@ -30,17 +30,17 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
-let EXPORTED_SYMBOLS = ["getHiddenHTMLWindow"];
+const EXPORTED_SYMBOLS = ["getHiddenHTMLWindow"];
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyGetter(this, "hiddenWindow", function()
Components.classes["@mozilla.org/appshell/appShellService;1"]
.getService(Components.interfaces.nsIAppShellService)
.hiddenDOMWindow
);
--- a/chat/modules/http.jsm
+++ b/chat/modules/http.jsm
@@ -30,17 +30,17 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
-var EXPORTED_SYMBOLS = ["doXHRequest"];
+const EXPORTED_SYMBOLS = ["doXHRequest"];
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource:///modules/imXPCOMUtils.jsm");
initLogModule("xhr", this);
function doXHRequest(aUrl, aHeaders, aPOSTData, aOnLoad, aOnError, aThis) {
--- a/chat/modules/imContentSink.jsm
+++ b/chat/modules/imContentSink.jsm
@@ -32,17 +32,17 @@
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
Components.utils.import("resource:///modules/imServices.jsm");
-var EXPORTED_SYMBOLS = [
+const EXPORTED_SYMBOLS = [
"cleanupImMarkup", // used to clean up incoming IMs.
// This will use the global ruleset of acceptable stuff
// except if another (custom one) is provided
"createDerivedRuleset", // used to create a ruleset that inherits from the
// default one
// useful if you want to allow or forbid
// an additionnal thing in a specific
// conversation but take into account all
--- a/chat/modules/imServices.jsm
+++ b/chat/modules/imServices.jsm
@@ -30,17 +30,17 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
-let EXPORTED_SYMBOLS = ["Services"];
+const EXPORTED_SYMBOLS = ["Services"];
Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyServiceGetter(Services, "accounts",
"@mozilla.org/chat/accounts-service;1",
"imIAccountsService");
XPCOMUtils.defineLazyServiceGetter(Services, "core",
--- a/chat/modules/imSmileys.jsm
+++ b/chat/modules/imSmileys.jsm
@@ -32,17 +32,17 @@
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
Components.utils.import("resource:///modules/imServices.jsm");
-var EXPORTED_SYMBOLS = [
+const EXPORTED_SYMBOLS = [
"smileImMarkup", // used to add smile:// img tags into IM markup.
"smileTextNode", // used to add smile:// img tags to the content of a textnode
"smileString", // used to add smile:// img tags into a string without parsing it as HTML. Be sure the string doesn't contain HTML tags.
"getSmileRealURI", // used to retrive the chrome URI for a smile:// URI
"getSmileyList" // used to display a list of smileys in the UI
];
const kEmoticonsThemePref = "messenger.options.emoticonsTheme";
--- a/chat/modules/imStatusUtils.jsm
+++ b/chat/modules/imStatusUtils.jsm
@@ -29,17 +29,17 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
-var EXPORTED_SYMBOLS = ["Status"];
+const EXPORTED_SYMBOLS = ["Status"];
Components.utils.import("resource:///modules/imServices.jsm");
const imIStatusInfo = Components.interfaces.imIStatusInfo;
let statusNames = {};
statusNames[imIStatusInfo.STATUS_UNKNOWN] = "unknown";
statusNames[imIStatusInfo.STATUS_OFFLINE] = "offline";
statusNames[imIStatusInfo.STATUS_INVISIBLE] = "invisible";
--- a/chat/modules/imTextboxUtils.jsm
+++ b/chat/modules/imTextboxUtils.jsm
@@ -30,17 +30,21 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
-var EXPORTED_SYMBOLS = ["MessageFormat", "TextboxSize", "TextboxSpellChecker"];
+const EXPORTED_SYMBOLS = [
+ "MessageFormat",
+ "TextboxSize",
+ "TextboxSpellChecker"
+];
Components.utils.import("resource:///modules/imServices.jsm");
const Ci = Components.interfaces;
let MessageFormat = {
_observedPrefs: [],
getValues: function mf_getValues() {
--- a/chat/modules/imThemes.jsm
+++ b/chat/modules/imThemes.jsm
@@ -30,17 +30,17 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
-var EXPORTED_SYMBOLS = [
+const EXPORTED_SYMBOLS = [
"getCurrentTheme",
"getThemeByName",
"getHTMLForMessage",
"getThemeVariants",
"isNextMessage",
"insertHTMLForMessage",
"initHTMLDocument",
"getMessagesForRange",
--- a/chat/modules/imXPCOMUtils.jsm
+++ b/chat/modules/imXPCOMUtils.jsm
@@ -31,17 +31,17 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
-var EXPORTED_SYMBOLS = [
+const EXPORTED_SYMBOLS = [
"XPCOMUtils",
"setTimeout",
"clearTimeout",
"executeSoon",
"hasOwnProperty",
"nsSimpleEnumerator",
"EmptyEnumerator",
"ClassInfo",
--- a/chat/modules/jsProtoHelper.jsm
+++ b/chat/modules/jsProtoHelper.jsm
@@ -31,17 +31,17 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
-var EXPORTED_SYMBOLS = [
+const EXPORTED_SYMBOLS = [
"GenericAccountPrototype",
"GenericAccountBuddyPrototype",
"GenericConvIMPrototype",
"GenericConvChatPrototype",
"GenericConvChatBuddyPrototype",
"GenericMessagePrototype",
"GenericProtocolPrototype",
"ForwardProtocolPrototype",
--- a/chat/modules/socket.jsm
+++ b/chat/modules/socket.jsm
@@ -79,17 +79,17 @@
/*
* 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?).
*/
-var EXPORTED_SYMBOLS = ["Socket"];
+const EXPORTED_SYMBOLS = ["Socket"];
const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
Cu.import("resource://gre/modules/Services.jsm");
// Network errors see: netwerk/base/public/nsNetError.h
const NS_ERROR_MODULE_NETWORK = 2152398848;
const NS_ERROR_CONNECTION_REFUSED = NS_ERROR_MODULE_NETWORK + 13;
const NS_ERROR_NET_TIMEOUT = NS_ERROR_MODULE_NETWORK + 14;
--- a/chat/protocols/xmpp/xmpp-authmechs.jsm
+++ b/chat/protocols/xmpp/xmpp-authmechs.jsm
@@ -38,17 +38,17 @@
// This module exports XMPPAuthMechanisms, an object containing all
// the supported SASL authentication mechanisms.
// 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.
-var EXPORTED_SYMBOLS = ["XMPPAuthMechanisms"];
+const EXPORTED_SYMBOLS = ["XMPPAuthMechanisms"];
const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource:///modules/xmpp-xml.jsm");
/* Handle PLAIN authorization mechanism */
function PlainAuth(username, password, domain) {
this._username = username;
--- a/chat/protocols/xmpp/xmpp-session.jsm
+++ b/chat/protocols/xmpp/xmpp-session.jsm
@@ -30,17 +30,17 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
-var EXPORTED_SYMBOLS = ["XMPPSession", "XMPPDefaultResource"];
+const EXPORTED_SYMBOLS = ["XMPPSession", "XMPPDefaultResource"];
const {interfaces: Ci, utils: Cu} = Components;
Cu.import("resource:///modules/imXPCOMUtils.jsm");
Cu.import("resource:///modules/socket.jsm");
Cu.import("resource:///modules/xmpp-xml.jsm");
Cu.import("resource:///modules/xmpp-authmechs.jsm");
--- a/chat/protocols/xmpp/xmpp-xml.jsm
+++ b/chat/protocols/xmpp/xmpp-xml.jsm
@@ -30,17 +30,17 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
-var EXPORTED_SYMBOLS = ["Stanza", "XMPPParser"];
+const EXPORTED_SYMBOLS = ["Stanza", "XMPPParser"];
const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
const NS = {
xml : "http://www.w3.org/XML/1998/namespace",
xhtml : "http://www.w3.org/1999/xhtml",
xhtml_im : "http://jabber.org/protocol/xhtml-im",
--- a/chat/protocols/xmpp/xmpp.jsm
+++ b/chat/protocols/xmpp/xmpp.jsm
@@ -30,20 +30,22 @@
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
-var EXPORTED_SYMBOLS = ["XMPPConversationPrototype",
- "XMPPMUCConversationPrototype",
- "XMPPAccountBuddyPrototype",
- "XMPPAccountPrototype"];
+const EXPORTED_SYMBOLS = [
+ "XMPPConversationPrototype",
+ "XMPPMUCConversationPrototype",
+ "XMPPAccountBuddyPrototype",
+ "XMPPAccountPrototype"
+];
const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
Cu.import("resource:///modules/imServices.jsm");
Cu.import("resource:///modules/imStatusUtils.jsm");
Cu.import("resource:///modules/imXPCOMUtils.jsm");
Cu.import("resource:///modules/jsProtoHelper.jsm");
Cu.import("resource:///modules/socket.jsm");
--- a/im/modules/imWindows.jsm
+++ b/im/modules/imWindows.jsm
@@ -31,17 +31,17 @@
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
const CONVERSATION_WINDOW_URI = "chrome://instantbird/content/instantbird.xul";
-var EXPORTED_SYMBOLS = ["Conversations"];
+const EXPORTED_SYMBOLS = ["Conversations"];
Components.utils.import("resource:///modules/imServices.jsm");
Components.utils.import("resource:///modules/ibInterruptions.jsm");
var Conversations = {
_unreadCount: 0,
get unreadCount() this._unreadCount,
set unreadCount(val) {