diff --git a/accessible/src/jsat/AccessFu.jsm b/accessible/src/jsat/AccessFu.jsm index 1859c4b74f4..764e5258e1e 100644 --- a/accessible/src/jsat/AccessFu.jsm +++ b/accessible/src/jsat/AccessFu.jsm @@ -9,7 +9,7 @@ const Ci = Components.interfaces; const Cu = Components.utils; const Cr = Components.results; -this.EXPORTED_SYMBOLS = ['AccessFu']; +var EXPORTED_SYMBOLS = ['AccessFu']; Cu.import('resource://gre/modules/Services.jsm'); Cu.import('resource://gre/modules/Geometry.jsm'); @@ -21,7 +21,7 @@ const ACCESSFU_DISABLE = 0; const ACCESSFU_ENABLE = 1; const ACCESSFU_AUTO = 2; -this.AccessFu = { +var AccessFu = { /** * Initialize chrome-layer accessibility functionality. * If accessibility is enabled on the platform, then a special accessibility diff --git a/accessible/src/jsat/EventManager.jsm b/accessible/src/jsat/EventManager.jsm index ce6934c5aa3..113f5cfe9f2 100644 --- a/accessible/src/jsat/EventManager.jsm +++ b/accessible/src/jsat/EventManager.jsm @@ -13,9 +13,9 @@ Cu.import('resource://gre/modules/accessibility/TraversalRules.jsm'); Cu.import('resource://gre/modules/Services.jsm'); Cu.import('resource://gre/modules/XPCOMUtils.jsm'); -this.EXPORTED_SYMBOLS = ['EventManager']; +var EXPORTED_SYMBOLS = ['EventManager']; -this.EventManager = { +var EventManager = { editState: {}, start: function start(aSendMsgFunc) { diff --git a/accessible/src/jsat/Presenters.jsm b/accessible/src/jsat/Presenters.jsm index e577cfef217..4278cb5b2ad 100644 --- a/accessible/src/jsat/Presenters.jsm +++ b/accessible/src/jsat/Presenters.jsm @@ -13,11 +13,11 @@ Cu.import('resource://gre/modules/accessibility/Utils.jsm'); Cu.import('resource://gre/modules/accessibility/UtteranceGenerator.jsm'); Cu.import('resource://gre/modules/Geometry.jsm'); -this.EXPORTED_SYMBOLS = ['VisualPresenter', - 'AndroidPresenter', - 'DummyAndroidPresenter', - 'SpeechPresenter', - 'PresenterContext']; +var EXPORTED_SYMBOLS = ['VisualPresenter', + 'AndroidPresenter', + 'DummyAndroidPresenter', + 'SpeechPresenter', + 'PresenterContext']; /** * The interface for all presenter classes. A presenter could be, for example, @@ -111,7 +111,7 @@ Presenter.prototype = { * Visual presenter. Draws a box around the virtual cursor's position. */ -this.VisualPresenter = function VisualPresenter() {} +function VisualPresenter() {} VisualPresenter.prototype = { __proto__: Presenter.prototype, @@ -179,7 +179,7 @@ VisualPresenter.prototype = { * Android presenter. Fires Android a11y events. */ -this.AndroidPresenter = function AndroidPresenter() {} +function AndroidPresenter() {} AndroidPresenter.prototype = { __proto__: Presenter.prototype, @@ -332,7 +332,7 @@ AndroidPresenter.prototype = { * A speech presenter for direct TTS output */ -this.SpeechPresenter = function SpeechPresenter() {} +function SpeechPresenter() {} SpeechPresenter.prototype = { __proto__: Presenter.prototype, @@ -376,7 +376,7 @@ SpeechPresenter.prototype = { * PresenterContext: An object that generates and caches context information * for a given accessible and its relationship with another accessible. */ -this.PresenterContext = function PresenterContext(aAccessible, aOldAccessible) { +function PresenterContext(aAccessible, aOldAccessible) { this._accessible = aAccessible; this._oldAccessible = this._isDefunct(aOldAccessible) ? null : aOldAccessible; diff --git a/accessible/src/jsat/TouchAdapter.jsm b/accessible/src/jsat/TouchAdapter.jsm index e279bbecb99..035b4ec7185 100644 --- a/accessible/src/jsat/TouchAdapter.jsm +++ b/accessible/src/jsat/TouchAdapter.jsm @@ -9,7 +9,7 @@ const Ci = Components.interfaces; const Cu = Components.utils; const Cr = Components.results; -this.EXPORTED_SYMBOLS = ['TouchAdapter', 'AndroidTouchAdapter']; +var EXPORTED_SYMBOLS = ['TouchAdapter', 'AndroidTouchAdapter']; Cu.import('resource://gre/modules/accessibility/Utils.jsm'); @@ -17,7 +17,7 @@ Cu.import('resource://gre/modules/accessibility/Utils.jsm'); // It is granular enough to feel natural, and it does not hammer the CPU. const EXPLORE_THROTTLE = 100; -this.TouchAdapter = { +var TouchAdapter = { // minimal swipe distance in inches SWIPE_MIN_DISTANCE: 0.4, @@ -366,7 +366,7 @@ var Mouse2Touch = { } }; -this.AndroidTouchAdapter = { +var AndroidTouchAdapter = { attach: function AndroidTouchAdapter_attach(aWindow) { if (this.chromeWin) return; diff --git a/accessible/src/jsat/TraversalRules.jsm b/accessible/src/jsat/TraversalRules.jsm index ddec7376a9a..0d11c878547 100644 --- a/accessible/src/jsat/TraversalRules.jsm +++ b/accessible/src/jsat/TraversalRules.jsm @@ -9,7 +9,7 @@ const Ci = Components.interfaces; const Cu = Components.utils; const Cr = Components.results; -this.EXPORTED_SYMBOLS = ['TraversalRules']; +var EXPORTED_SYMBOLS = ['TraversalRules']; Cu.import('resource://gre/modules/accessibility/Utils.jsm'); Cu.import('resource://gre/modules/XPCOMUtils.jsm'); @@ -70,7 +70,7 @@ var gSimpleTraversalRoles = // Used for traversing in to child OOP frames. Ci.nsIAccessibleRole.ROLE_INTERNAL_FRAME]; -this.TraversalRules = { +var TraversalRules = { Simple: new BaseTraversalRule( gSimpleTraversalRoles, function Simple_match(aAccessible) { diff --git a/accessible/src/jsat/Utils.jsm b/accessible/src/jsat/Utils.jsm index 2aa2b9f11d6..03c4cbfc344 100644 --- a/accessible/src/jsat/Utils.jsm +++ b/accessible/src/jsat/Utils.jsm @@ -10,9 +10,9 @@ const Ci = Components.interfaces; Cu.import('resource://gre/modules/Services.jsm'); -this.EXPORTED_SYMBOLS = ['Utils', 'Logger']; +var EXPORTED_SYMBOLS = ['Utils', 'Logger']; -this.Utils = { +var Utils = { _buildAppMap: { '{3c2e2abc-06d4-11e1-ac3b-374f68613e61}': 'b2g', '{ec8030f7-c20a-464f-9b0e-13a3a9e97384}': 'browser', @@ -156,7 +156,7 @@ this.Utils = { } }; -this.Logger = { +var Logger = { DEBUG: 0, INFO: 1, WARNING: 2, diff --git a/accessible/src/jsat/UtteranceGenerator.jsm b/accessible/src/jsat/UtteranceGenerator.jsm index 9108f693257..7b5f7f887c1 100644 --- a/accessible/src/jsat/UtteranceGenerator.jsm +++ b/accessible/src/jsat/UtteranceGenerator.jsm @@ -18,7 +18,7 @@ var gStringBundle = Cc['@mozilla.org/intl/stringbundle;1']. createBundle('chrome://global/locale/AccessFu.properties'); -this.EXPORTED_SYMBOLS = ['UtteranceGenerator']; +var EXPORTED_SYMBOLS = ['UtteranceGenerator']; Cu.import('resource://gre/modules/accessibility/Utils.jsm'); @@ -38,7 +38,7 @@ Cu.import('resource://gre/modules/accessibility/Utils.jsm'); * clicked event. Speaking only 'clicked' makes sense. Speaking 'button' does * not. */ -this.UtteranceGenerator = { +var UtteranceGenerator = { gActionMap: { jump: 'jumpAction', press: 'pressAction', diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index 4c3b90b9b72..08e3a63cfc9 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -576,5 +576,3 @@ pref("network.activity.blipIntervalMilliseconds", 250); // Send some sites a custom user-agent. pref("general.useragent.override.facebook.com", "\(Mobile#(Android; Mobile"); pref("general.useragent.override.youtube.com", "\(Mobile#(Android; Mobile"); - -pref("jsloader.reuseGlobal", true); diff --git a/b2g/components/ActivitiesGlue.js b/b2g/components/ActivitiesGlue.js index c6854572afc..b3fe7808bac 100644 --- a/b2g/components/ActivitiesGlue.js +++ b/b2g/components/ActivitiesGlue.js @@ -67,5 +67,5 @@ ActivitiesDialog.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIActivityUIGlue, Ci.nsIRunnable]) } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivitiesDialog]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivitiesDialog]); diff --git a/b2g/components/AlertsService.js b/b2g/components/AlertsService.js index abe2838020c..181c5a4f95a 100644 --- a/b2g/components/AlertsService.js +++ b/b2g/components/AlertsService.js @@ -24,4 +24,4 @@ AlertsService.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AlertsService]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([AlertsService]); diff --git a/b2g/components/ContentHandler.js b/b2g/components/ContentHandler.js index ec37a51d1c9..5cebd232965 100644 --- a/b2g/components/ContentHandler.js +++ b/b2g/components/ContentHandler.js @@ -50,4 +50,4 @@ ContentHandler.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentHandler]) }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentHandler]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentHandler]); diff --git a/b2g/components/ContentPermissionPrompt.js b/b2g/components/ContentPermissionPrompt.js index 9612191f447..39579a9aaec 100644 --- a/b2g/components/ContentPermissionPrompt.js +++ b/b2g/components/ContentPermissionPrompt.js @@ -145,4 +145,4 @@ ContentPermissionPrompt.prototype = { //module initialization -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermissionPrompt]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermissionPrompt]); diff --git a/b2g/components/DirectoryProvider.js b/b2g/components/DirectoryProvider.js index fbc957ef862..1a657f33dee 100644 --- a/b2g/components/DirectoryProvider.js +++ b/b2g/components/DirectoryProvider.js @@ -77,4 +77,4 @@ DirectoryProvider.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]); diff --git a/b2g/components/MailtoProtocolHandler.js b/b2g/components/MailtoProtocolHandler.js index 60b1bbaaff6..48747b4bc67 100644 --- a/b2g/components/MailtoProtocolHandler.js +++ b/b2g/components/MailtoProtocolHandler.js @@ -43,4 +43,4 @@ MailtoProtocolHandler.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler]) }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([MailtoProtocolHandler]); +let NSGetFactory = XPCOMUtils.generateNSGetFactory([MailtoProtocolHandler]); diff --git a/b2g/components/MozKeyboard.js b/b2g/components/MozKeyboard.js index 87146ba628b..c95e1feae1a 100644 --- a/b2g/components/MozKeyboard.js +++ b/b2g/components/MozKeyboard.js @@ -136,5 +136,5 @@ MozKeyboard.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([MozKeyboard]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([MozKeyboard]); diff --git a/b2g/components/PaymentGlue.js b/b2g/components/PaymentGlue.js index 9be88e31c68..bc2b4f272f4 100644 --- a/b2g/components/PaymentGlue.js +++ b/b2g/components/PaymentGlue.js @@ -169,4 +169,4 @@ PaymentUI.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIPaymentUIGlue]) } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PaymentUI]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([PaymentUI]); diff --git a/b2g/components/ProcessGlobal.js b/b2g/components/ProcessGlobal.js index 6857b4a926e..1d5f0ae4f40 100644 --- a/b2g/components/ProcessGlobal.js +++ b/b2g/components/ProcessGlobal.js @@ -57,4 +57,4 @@ ProcessGlobal.prototype = { }, }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ProcessGlobal]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([ProcessGlobal]); diff --git a/b2g/components/RecoveryService.js b/b2g/components/RecoveryService.js index dda4215d3e3..249dd7f9fd3 100644 --- a/b2g/components/RecoveryService.js +++ b/b2g/components/RecoveryService.js @@ -90,4 +90,4 @@ RecoveryService.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RecoveryService]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([RecoveryService]); diff --git a/b2g/components/SmsProtocolHandler.js b/b2g/components/SmsProtocolHandler.js index dc12ab45022..37079f72bd1 100644 --- a/b2g/components/SmsProtocolHandler.js +++ b/b2g/components/SmsProtocolHandler.js @@ -56,4 +56,4 @@ SmsProtocolHandler.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler]) }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SmsProtocolHandler]); +let NSGetFactory = XPCOMUtils.generateNSGetFactory([SmsProtocolHandler]); diff --git a/b2g/components/TelProtocolHandler.js b/b2g/components/TelProtocolHandler.js index 38e0f2785cb..90b0aca1805 100644 --- a/b2g/components/TelProtocolHandler.js +++ b/b2g/components/TelProtocolHandler.js @@ -55,4 +55,4 @@ TelProtocolHandler.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler]) }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TelProtocolHandler]); +let NSGetFactory = XPCOMUtils.generateNSGetFactory([TelProtocolHandler]); diff --git a/b2g/components/TelURIParser.jsm b/b2g/components/TelURIParser.jsm index 18eafd8c00f..22f6a168673 100644 --- a/b2g/components/TelURIParser.jsm +++ b/b2g/components/TelURIParser.jsm @@ -4,12 +4,12 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["TelURIParser"]; +let EXPORTED_SYMBOLS = ["TelURIParser"]; /** * Singleton providing functionality for parsing tel: and sms: URIs */ -this.TelURIParser = { +let TelURIParser = { parseURI: function(scheme, uri) { // Ignore MWI and USSD codes. See 794034. if (uri.indexOf('*') != -1 || uri.indexOf('#') != -1) { diff --git a/b2g/components/UpdatePrompt.js b/b2g/components/UpdatePrompt.js index 7de65a1c6f6..80f4facacb9 100644 --- a/b2g/components/UpdatePrompt.js +++ b/b2g/components/UpdatePrompt.js @@ -411,4 +411,4 @@ UpdatePrompt.prototype = { onStatus: function UP_onStatus(aRequest, aUpdate, aStatus, aStatusArg) { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([UpdatePrompt]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([UpdatePrompt]); diff --git a/b2g/components/YoutubeProtocolHandler.js b/b2g/components/YoutubeProtocolHandler.js index 51678654aba..287d836acb7 100644 --- a/b2g/components/YoutubeProtocolHandler.js +++ b/b2g/components/YoutubeProtocolHandler.js @@ -129,4 +129,4 @@ YoutubeProtocolHandler.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([YoutubeProtocolHandler]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([YoutubeProtocolHandler]); diff --git a/browser/components/distribution.js b/browser/components/distribution.js index 03a36e7b8a6..6b20df6d2c1 100644 --- a/browser/components/distribution.js +++ b/browser/components/distribution.js @@ -2,7 +2,7 @@ * 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 = [ "DistributionCustomizer" ]; +EXPORTED_SYMBOLS = [ "DistributionCustomizer" ]; const Ci = Components.interfaces; const Cc = Components.classes; @@ -16,7 +16,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm"); -this.DistributionCustomizer = function DistributionCustomizer() { +function DistributionCustomizer() { let dirSvc = Cc["@mozilla.org/file/directory_service;1"]. getService(Ci.nsIProperties); let iniFile = dirSvc.get("XCurProcD", Ci.nsIFile); diff --git a/browser/components/downloads/src/DownloadsCommon.jsm b/browser/components/downloads/src/DownloadsCommon.jsm index b91372e901c..d1124b2b52c 100644 --- a/browser/components/downloads/src/DownloadsCommon.jsm +++ b/browser/components/downloads/src/DownloadsCommon.jsm @@ -6,7 +6,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = [ +var EXPORTED_SYMBOLS = [ "DownloadsCommon", ]; @@ -87,7 +87,7 @@ XPCOMUtils.defineLazyGetter(this, "DownloadsLocalFileCtor", function () { * This object is exposed directly to the consumers of this JavaScript module, * and provides shared methods for all the instances of the user interface. */ -this.DownloadsCommon = { +const DownloadsCommon = { /** * Returns an object whose keys are the string names from the downloads string * bundle, and whose values are either the translated strings or functions diff --git a/browser/components/downloads/src/DownloadsStartup.js b/browser/components/downloads/src/DownloadsStartup.js index dcd7c1800d3..ad61d47f323 100644 --- a/browser/components/downloads/src/DownloadsStartup.js +++ b/browser/components/downloads/src/DownloadsStartup.js @@ -273,4 +273,4 @@ DownloadsStartup.prototype = { //////////////////////////////////////////////////////////////////////////////// //// Module -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadsStartup]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadsStartup]); diff --git a/browser/components/downloads/src/DownloadsUI.js b/browser/components/downloads/src/DownloadsUI.js index 6726db795ba..5ca37170c8c 100644 --- a/browser/components/downloads/src/DownloadsUI.js +++ b/browser/components/downloads/src/DownloadsUI.js @@ -104,4 +104,4 @@ DownloadsUI.prototype = { //////////////////////////////////////////////////////////////////////////////// //// Module -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadsUI]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadsUI]); diff --git a/browser/components/feeds/src/FeedConverter.js b/browser/components/feeds/src/FeedConverter.js index e1659639ef7..d3e7a28dc75 100644 --- a/browser/components/feeds/src/FeedConverter.js +++ b/browser/components/feeds/src/FeedConverter.js @@ -579,4 +579,4 @@ var components = [FeedConverter, PodCastProtocolHandler]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/browser/components/feeds/src/FeedWriter.js b/browser/components/feeds/src/FeedWriter.js index a20ac2d91a3..ea26b2b9cbb 100644 --- a/browser/components/feeds/src/FeedWriter.js +++ b/browser/components/feeds/src/FeedWriter.js @@ -1378,4 +1378,4 @@ FeedWriter.prototype = { Ci.nsINavHistoryObserver]) }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([FeedWriter]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([FeedWriter]); diff --git a/browser/components/feeds/src/WebContentConverter.js b/browser/components/feeds/src/WebContentConverter.js index 3667ce829b2..0a9d19b86b1 100644 --- a/browser/components/feeds/src/WebContentConverter.js +++ b/browser/components/feeds/src/WebContentConverter.js @@ -899,4 +899,4 @@ WebContentConverterRegistrar.prototype = { }] }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WebContentConverterRegistrar]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([WebContentConverterRegistrar]); diff --git a/browser/components/migration/src/ChromeProfileMigrator.js b/browser/components/migration/src/ChromeProfileMigrator.js index d6d952ea0a8..b5908dfdd41 100644 --- a/browser/components/migration/src/ChromeProfileMigrator.js +++ b/browser/components/migration/src/ChromeProfileMigrator.js @@ -340,4 +340,4 @@ ChromeProfileMigrator.prototype.classDescription = "Chrome Profile Migrator"; ChromeProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=chrome"; ChromeProfileMigrator.prototype.classID = Components.ID("{4cec1de4-1671-4fc3-a53e-6c539dc77a26}"); -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ChromeProfileMigrator]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([ChromeProfileMigrator]); diff --git a/browser/components/migration/src/FirefoxProfileMigrator.js b/browser/components/migration/src/FirefoxProfileMigrator.js index 52722e93699..a6598fe9081 100644 --- a/browser/components/migration/src/FirefoxProfileMigrator.js +++ b/browser/components/migration/src/FirefoxProfileMigrator.js @@ -91,4 +91,4 @@ FirefoxProfileMigrator.prototype.classDescription = "Firefox Profile Migrator"; FirefoxProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=firefox"; FirefoxProfileMigrator.prototype.classID = Components.ID("{91185366-ba97-4438-acba-48deaca63386}"); -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([FirefoxProfileMigrator]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([FirefoxProfileMigrator]); diff --git a/browser/components/migration/src/IEProfileMigrator.js b/browser/components/migration/src/IEProfileMigrator.js index 549c7f2c4f3..21f73ddc664 100644 --- a/browser/components/migration/src/IEProfileMigrator.js +++ b/browser/components/migration/src/IEProfileMigrator.js @@ -675,4 +675,4 @@ IEProfileMigrator.prototype.classDescription = "IE Profile Migrator"; IEProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=ie"; IEProfileMigrator.prototype.classID = Components.ID("{3d2532e3-4932-4774-b7ba-968f5899d3a4}"); -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([IEProfileMigrator]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([IEProfileMigrator]); diff --git a/browser/components/migration/src/MigrationUtils.jsm b/browser/components/migration/src/MigrationUtils.jsm index 1f6087926e2..0669aa88372 100644 --- a/browser/components/migration/src/MigrationUtils.jsm +++ b/browser/components/migration/src/MigrationUtils.jsm @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["MigrationUtils", "MigratorPrototype"]; +let EXPORTED_SYMBOLS = ["MigrationUtils", "MigratorPrototype"]; const Cu = Components.utils; const Ci = Components.interfaces; @@ -86,7 +86,7 @@ function getMigratorKeyForDefaultBrowser() { * override |sourceHomePageURL| getter. * 7. For startup-only migrators, override |startupOnlyMigrator|. */ -this.MigratorPrototype = { +let MigratorPrototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIBrowserProfileMigrator]), /** @@ -323,7 +323,7 @@ this.MigratorPrototype = { } }; -this.MigrationUtils = Object.freeze({ +let MigrationUtils = Object.freeze({ resourceTypes: { SETTINGS: Ci.nsIBrowserProfileMigrator.SETTINGS, COOKIES: Ci.nsIBrowserProfileMigrator.COOKIES, diff --git a/browser/components/migration/src/ProfileMigrator.js b/browser/components/migration/src/ProfileMigrator.js index f67823bae75..744f1175fda 100644 --- a/browser/components/migration/src/ProfileMigrator.js +++ b/browser/components/migration/src/ProfileMigrator.js @@ -18,4 +18,4 @@ ProfileMigrator.prototype = { classID: Components.ID("6F8BB968-C14F-4D6F-9733-6C6737B35DCE") }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ProfileMigrator]); +let NSGetFactory = XPCOMUtils.generateNSGetFactory([ProfileMigrator]); diff --git a/browser/components/migration/src/SafariProfileMigrator.js b/browser/components/migration/src/SafariProfileMigrator.js index 8f6382d08eb..8f25c9c7a67 100644 --- a/browser/components/migration/src/SafariProfileMigrator.js +++ b/browser/components/migration/src/SafariProfileMigrator.js @@ -677,4 +677,4 @@ SafariProfileMigrator.prototype.classDescription = "Safari Profile Migrator"; SafariProfileMigrator.prototype.contractID = "@mozilla.org/profile/migrator;1?app=browser&type=safari"; SafariProfileMigrator.prototype.classID = Components.ID("{4b609ecf-60b2-4655-9df4-dc149e474da1}"); -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SafariProfileMigrator]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([SafariProfileMigrator]); diff --git a/browser/components/nsBrowserContentHandler.js b/browser/components/nsBrowserContentHandler.js index 656c86d8c32..0c79aebf9c7 100644 --- a/browser/components/nsBrowserContentHandler.js +++ b/browser/components/nsBrowserContentHandler.js @@ -825,4 +825,4 @@ nsDefaultCommandLineHandler.prototype = { }; var components = [nsBrowserContentHandler, nsDefaultCommandLineHandler]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index 389f09d8c3a..ce11b262e3c 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -1751,4 +1751,4 @@ ContentPermissionPrompt.prototype = { }; var components = [BrowserGlue, ContentPermissionPrompt]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/browser/components/places/src/PlacesProtocolHandler.js b/browser/components/places/src/PlacesProtocolHandler.js index ebffd2e28c0..07641c73217 100644 --- a/browser/components/places/src/PlacesProtocolHandler.js +++ b/browser/components/places/src/PlacesProtocolHandler.js @@ -46,4 +46,4 @@ PlacesProtocolHandler.prototype = { classID: Components.ID("{6bcb9bde-9018-4443-a071-c32653469597}") }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PlacesProtocolHandler]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([PlacesProtocolHandler]); diff --git a/browser/components/places/src/PlacesUIUtils.jsm b/browser/components/places/src/PlacesUIUtils.jsm index 278e28446da..9caf0859c10 100644 --- a/browser/components/places/src/PlacesUIUtils.jsm +++ b/browser/components/places/src/PlacesUIUtils.jsm @@ -3,7 +3,7 @@ * 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 = ["PlacesUIUtils"]; +var EXPORTED_SYMBOLS = ["PlacesUIUtils"]; var Ci = Components.interfaces; var Cc = Components.classes; @@ -21,7 +21,7 @@ XPCOMUtils.defineLazyGetter(this, "PlacesUtils", function() { return PlacesUtils; }); -this.PlacesUIUtils = { +var PlacesUIUtils = { ORGANIZER_LEFTPANE_VERSION: 7, ORGANIZER_FOLDER_ANNO: "PlacesOrganizer/OrganizerFolder", ORGANIZER_QUERY_ANNO: "PlacesOrganizer/OrganizerQuery", diff --git a/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js b/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js index 2d4c16f521a..b5a01656d9d 100644 --- a/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js +++ b/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js @@ -591,4 +591,4 @@ PrivateBrowsingService.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PrivateBrowsingService]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([PrivateBrowsingService]); diff --git a/browser/components/sessionstore/src/DocumentUtils.jsm b/browser/components/sessionstore/src/DocumentUtils.jsm index 6b3f729b54c..63de0fa311d 100644 --- a/browser/components/sessionstore/src/DocumentUtils.jsm +++ b/browser/components/sessionstore/src/DocumentUtils.jsm @@ -2,7 +2,7 @@ * 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 = [ "DocumentUtils" ]; +EXPORTED_SYMBOLS = [ "DocumentUtils" ]; const Cu = Components.utils; const Ci = Components.interfaces; @@ -10,7 +10,7 @@ const Ci = Components.interfaces; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource:///modules/sessionstore/XPathGenerator.jsm"); -this.DocumentUtils = { +let DocumentUtils = { /** * Obtain form data for a DOMDocument instance. * diff --git a/browser/components/sessionstore/src/SessionStorage.jsm b/browser/components/sessionstore/src/SessionStorage.jsm index 8c14900c8d8..ef22b6b453f 100644 --- a/browser/components/sessionstore/src/SessionStorage.jsm +++ b/browser/components/sessionstore/src/SessionStorage.jsm @@ -2,7 +2,7 @@ * 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 = ["SessionStorage"]; +let EXPORTED_SYMBOLS = ["SessionStorage"]; const Cu = Components.utils; @@ -12,7 +12,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "SessionStore", "resource:///modules/sessionstore/SessionStore.jsm"); -this.SessionStorage = { +let SessionStorage = { /** * Updates all sessionStorage "super cookies" * @param aDocShell diff --git a/browser/components/sessionstore/src/SessionStore.jsm b/browser/components/sessionstore/src/SessionStore.jsm index 79fcc80cbdb..3bde16f6197 100644 --- a/browser/components/sessionstore/src/SessionStore.jsm +++ b/browser/components/sessionstore/src/SessionStore.jsm @@ -2,7 +2,7 @@ * 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 = ["SessionStore"]; +let EXPORTED_SYMBOLS = ["SessionStore"]; const Cu = Components.utils; const Cc = Components.classes; @@ -99,7 +99,7 @@ function debug(aMsg) { Services.console.logStringMessage(aMsg); } -this.SessionStore = { +let SessionStore = { get canRestoreLastSession() { return SessionStoreInternal.canRestoreLastSession; }, diff --git a/browser/components/sessionstore/src/XPathGenerator.jsm b/browser/components/sessionstore/src/XPathGenerator.jsm index 83ff2b80afc..f194e3d8218 100644 --- a/browser/components/sessionstore/src/XPathGenerator.jsm +++ b/browser/components/sessionstore/src/XPathGenerator.jsm @@ -2,9 +2,9 @@ * 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 = ["XPathGenerator"]; +let EXPORTED_SYMBOLS = ["XPathGenerator"]; -this.XPathGenerator = { +let XPathGenerator = { // these two hashes should be kept in sync namespaceURIs: { "xhtml": "http://www.w3.org/1999/xhtml" }, namespacePrefixes: { "http://www.w3.org/1999/xhtml": "xhtml" }, diff --git a/browser/components/sessionstore/src/nsSessionStartup.js b/browser/components/sessionstore/src/nsSessionStartup.js index 0aeb656cbf3..dba9f813de4 100644 --- a/browser/components/sessionstore/src/nsSessionStartup.js +++ b/browser/components/sessionstore/src/nsSessionStartup.js @@ -319,4 +319,4 @@ SessionStartup.prototype = { classID: Components.ID("{ec7a6c20-e081-11da-8ad9-0800200c9a66}"), }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStartup]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStartup]); diff --git a/browser/components/sessionstore/src/nsSessionStore.js b/browser/components/sessionstore/src/nsSessionStore.js index 38713d500f9..a61bb646ab3 100644 --- a/browser/components/sessionstore/src/nsSessionStore.js +++ b/browser/components/sessionstore/src/nsSessionStore.js @@ -34,4 +34,4 @@ SessionStoreService.prototype.classID = SessionStoreService.prototype.QueryInterface = XPCOMUtils.generateQI([Ci.nsISessionStore]); -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStoreService]); +let NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStoreService]); diff --git a/browser/components/shell/src/nsSetDefaultBrowser.js b/browser/components/shell/src/nsSetDefaultBrowser.js index f0fb661f728..47bab18a945 100644 --- a/browser/components/shell/src/nsSetDefaultBrowser.js +++ b/browser/components/shell/src/nsSetDefaultBrowser.js @@ -28,4 +28,4 @@ nsSetDefaultBrowser.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]), }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSetDefaultBrowser]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSetDefaultBrowser]); diff --git a/browser/components/sidebar/nsSidebar.js b/browser/components/sidebar/nsSidebar.js index 5b055e2d9ed..1083e6798db 100644 --- a/browser/components/sidebar/nsSidebar.js +++ b/browser/components/sidebar/nsSidebar.js @@ -183,7 +183,7 @@ nsSidebar.prototype.classInfo = XPCOMUtils.generateCI({classID: SIDEBAR_CID, nsSidebar.prototype.QueryInterface = XPCOMUtils.generateQI([nsISidebar, nsISidebarExternal]); -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSidebar]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSidebar]); /* static functions */ if (DEBUG) diff --git a/browser/components/tabview/modules/utils.jsm b/browser/components/tabview/modules/utils.jsm index f5fd4ed729e..3e2d98ea437 100644 --- a/browser/components/tabview/modules/utils.jsm +++ b/browser/components/tabview/modules/utils.jsm @@ -7,7 +7,7 @@ // ********** // Title: utils.js -this.EXPORTED_SYMBOLS = ["Point", "Rect", "Range", "Subscribable", "Utils", "MRUList"]; +let EXPORTED_SYMBOLS = ["Point", "Rect", "Range", "Subscribable", "Utils", "MRUList"]; // ######### const Ci = Components.interfaces; @@ -23,7 +23,7 @@ Cu.import("resource://gre/modules/Services.jsm"); // If a is a Point, creates a copy of it. Otherwise, expects a to be x, // and creates a Point with it along with y. If either a or y are omitted, // 0 is used in their place. -this.Point = function Point(a, y) { +function Point(a, y) { if (Utils.isPoint(a)) { this.x = a.x; this.y = a.y; @@ -60,7 +60,7 @@ Point.prototype = { // Constructor: Rect // If a is a Rect, creates a copy of it. Otherwise, expects a to be left, // and creates a Rect with it along with top, width, and height. -this.Rect = function Rect(a, top, width, height) { +function Rect(a, top, width, height) { // Note: perhaps 'a' should really be called 'rectOrLeft' if (Utils.isRect(a)) { this.left = a.left; @@ -251,7 +251,7 @@ Rect.prototype = { // // Constructor: Range // Creates a Range with the given min and max -this.Range = function Range(min, max) { +function Range(min, max) { if (Utils.isRange(min) && !max) { // if the one variable given is a range, copy it. this.min = min.min; this.max = min.max; @@ -357,7 +357,7 @@ Range.prototype = { // ########## // Class: Subscribable // A mix-in for allowing objects to collect subscribers for custom events. -this.Subscribable = function Subscribable() { +function Subscribable() { this.subscribers = null; }; @@ -438,7 +438,7 @@ Subscribable.prototype = { // ########## // Class: Utils // Singelton with common utility functions. -this.Utils = { +let Utils = { // ---------- // Function: toString // Prints [Utils] for debug use @@ -768,7 +768,7 @@ this.Utils = { // // Constructor: MRUList // If a is an array of entries, creates a copy of it. -this.MRUList = function MRUList(a) { +function MRUList(a) { if (Array.isArray(a)) this._list = a.concat(); else diff --git a/browser/components/thumbnails/PageThumbs.jsm b/browser/components/thumbnails/PageThumbs.jsm index 0350ff2e817..d1ee2f3998f 100644 --- a/browser/components/thumbnails/PageThumbs.jsm +++ b/browser/components/thumbnails/PageThumbs.jsm @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["PageThumbs", "PageThumbsStorage"]; +let EXPORTED_SYMBOLS = ["PageThumbs", "PageThumbsStorage"]; const Cu = Components.utils; const Cc = Components.classes; @@ -59,7 +59,7 @@ XPCOMUtils.defineLazyGetter(this, "gUnicodeConverter", function () { * Singleton providing functionality for capturing web page thumbnails and for * accessing them if already cached. */ -this.PageThumbs = { +let PageThumbs = { _initialized: false, /** @@ -278,7 +278,7 @@ this.PageThumbs = { }, }; -this.PageThumbsStorage = { +let PageThumbsStorage = { getDirectory: function Storage_getDirectory(aCreate = true) { return FileUtils.getDir("ProfLD", [THUMBNAIL_DIRECTORY], aCreate); }, diff --git a/browser/components/thumbnails/PageThumbsProtocol.js b/browser/components/thumbnails/PageThumbsProtocol.js index e39795f095e..a20a3845c1d 100644 --- a/browser/components/thumbnails/PageThumbsProtocol.js +++ b/browser/components/thumbnails/PageThumbsProtocol.js @@ -88,7 +88,7 @@ Protocol.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler]) }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([Protocol]); +let NSGetFactory = XPCOMUtils.generateNSGetFactory([Protocol]); /** * Parses a given URI and extracts all parameters relevant to this protocol. diff --git a/browser/devtools/commandline/CmdAddon.jsm b/browser/devtools/commandline/CmdAddon.jsm index 71c5a6ffb74..927ad9ecc9c 100644 --- a/browser/devtools/commandline/CmdAddon.jsm +++ b/browser/devtools/commandline/CmdAddon.jsm @@ -4,7 +4,7 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; -this.EXPORTED_SYMBOLS = [ "Flags" ]; +let EXPORTED_SYMBOLS = [ "Flags" ]; Cu.import("resource:///modules/devtools/gcli.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); @@ -15,7 +15,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "AddonManager", // We need to use an object in which to store any flags because a primitive // would remain undefined. -this.Flags = { +let Flags = { addonsLoaded: false }; diff --git a/browser/devtools/commandline/CmdBreak.jsm b/browser/devtools/commandline/CmdBreak.jsm index 819e7002b25..75c26667d51 100644 --- a/browser/devtools/commandline/CmdBreak.jsm +++ b/browser/devtools/commandline/CmdBreak.jsm @@ -4,7 +4,7 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; -this.EXPORTED_SYMBOLS = [ ]; +let EXPORTED_SYMBOLS = [ ]; Cu.import("resource:///modules/devtools/gcli.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); diff --git a/browser/devtools/commandline/CmdCalllog.jsm b/browser/devtools/commandline/CmdCalllog.jsm index d143a4b2a69..42cbf9c3336 100644 --- a/browser/devtools/commandline/CmdCalllog.jsm +++ b/browser/devtools/commandline/CmdCalllog.jsm @@ -4,7 +4,7 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; -this.EXPORTED_SYMBOLS = [ ]; +let EXPORTED_SYMBOLS = [ ]; Cu.import("resource:///modules/devtools/gcli.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); diff --git a/browser/devtools/commandline/CmdCalllogChrome.jsm b/browser/devtools/commandline/CmdCalllogChrome.jsm index 80aa141155c..a5550c8c1cc 100644 --- a/browser/devtools/commandline/CmdCalllogChrome.jsm +++ b/browser/devtools/commandline/CmdCalllogChrome.jsm @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -this.EXPORTED_SYMBOLS = [ ]; +let EXPORTED_SYMBOLS = [ ]; const { classes: Cc, interfaces: Ci, utils: Cu } = Components; diff --git a/browser/devtools/commandline/CmdCmd.jsm b/browser/devtools/commandline/CmdCmd.jsm index cd137632d96..7894da8590d 100644 --- a/browser/devtools/commandline/CmdCmd.jsm +++ b/browser/devtools/commandline/CmdCmd.jsm @@ -2,7 +2,7 @@ * 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 = [ "CmdCommands" ]; +let EXPORTED_SYMBOLS = [ "CmdCommands" ]; const { classes: Cc, interfaces: Ci, utils: Cu } = Components; @@ -32,7 +32,7 @@ let commands = []; /** * Exported API */ -this.CmdCommands = { +let CmdCommands = { /** * Called to look in a directory pointed at by the devtools.commands.dir pref * for *.mozcmd files which are then loaded. diff --git a/browser/devtools/commandline/CmdConsole.jsm b/browser/devtools/commandline/CmdConsole.jsm index 391ced0b7be..c537b059ef7 100644 --- a/browser/devtools/commandline/CmdConsole.jsm +++ b/browser/devtools/commandline/CmdConsole.jsm @@ -4,7 +4,7 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; -this.EXPORTED_SYMBOLS = [ ]; +let EXPORTED_SYMBOLS = [ ]; Cu.import("resource:///modules/devtools/gcli.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); diff --git a/browser/devtools/commandline/CmdCookie.jsm b/browser/devtools/commandline/CmdCookie.jsm index 88bd1b92c4b..1b72a37ccfb 100644 --- a/browser/devtools/commandline/CmdCookie.jsm +++ b/browser/devtools/commandline/CmdCookie.jsm @@ -4,7 +4,7 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; -this.EXPORTED_SYMBOLS = [ ]; +let EXPORTED_SYMBOLS = [ ]; Cu.import("resource:///modules/devtools/gcli.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); diff --git a/browser/devtools/commandline/CmdDbg.jsm b/browser/devtools/commandline/CmdDbg.jsm index 257efd2afc2..f3059359858 100644 --- a/browser/devtools/commandline/CmdDbg.jsm +++ b/browser/devtools/commandline/CmdDbg.jsm @@ -4,7 +4,7 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; -this.EXPORTED_SYMBOLS = [ ]; +let EXPORTED_SYMBOLS = [ ]; Cu.import("resource:///modules/devtools/gcli.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); diff --git a/browser/devtools/commandline/CmdEcho.jsm b/browser/devtools/commandline/CmdEcho.jsm index 607ee1d7b11..4af05c3494e 100644 --- a/browser/devtools/commandline/CmdEcho.jsm +++ b/browser/devtools/commandline/CmdEcho.jsm @@ -4,7 +4,7 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; -this.EXPORTED_SYMBOLS = [ ]; +let EXPORTED_SYMBOLS = [ ]; Cu.import("resource:///modules/devtools/gcli.jsm"); diff --git a/browser/devtools/commandline/CmdExport.jsm b/browser/devtools/commandline/CmdExport.jsm index 175f294a8b2..df76a5f6a9c 100644 --- a/browser/devtools/commandline/CmdExport.jsm +++ b/browser/devtools/commandline/CmdExport.jsm @@ -3,8 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; - -this.EXPORTED_SYMBOLS = [ ]; +let EXPORTED_SYMBOLS = [ ]; Cu.import("resource:///modules/devtools/gcli.jsm"); diff --git a/browser/devtools/commandline/CmdJsb.jsm b/browser/devtools/commandline/CmdJsb.jsm index 5a31f500fcb..f19c32f86ed 100644 --- a/browser/devtools/commandline/CmdJsb.jsm +++ b/browser/devtools/commandline/CmdJsb.jsm @@ -6,7 +6,7 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; const XMLHttpRequest = Components.Constructor("@mozilla.org/xmlextras/xmlhttprequest;1"); -this.EXPORTED_SYMBOLS = [ ]; +let EXPORTED_SYMBOLS = [ ]; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource:///modules/devtools/gcli.jsm"); diff --git a/browser/devtools/commandline/CmdPagemod.jsm b/browser/devtools/commandline/CmdPagemod.jsm index e65d2bcd75f..54a055798ff 100644 --- a/browser/devtools/commandline/CmdPagemod.jsm +++ b/browser/devtools/commandline/CmdPagemod.jsm @@ -4,7 +4,7 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; -this.EXPORTED_SYMBOLS = [ ]; +let EXPORTED_SYMBOLS = [ ]; Cu.import("resource:///modules/devtools/gcli.jsm"); diff --git a/browser/devtools/commandline/CmdRestart.jsm b/browser/devtools/commandline/CmdRestart.jsm index d196fdbd3e5..ea8e343a951 100644 --- a/browser/devtools/commandline/CmdRestart.jsm +++ b/browser/devtools/commandline/CmdRestart.jsm @@ -4,7 +4,7 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; -this.EXPORTED_SYMBOLS = [ ]; +let EXPORTED_SYMBOLS = [ ]; Cu.import("resource:///modules/devtools/gcli.jsm"); Cu.import("resource://gre/modules/Services.jsm"); diff --git a/browser/devtools/commandline/CmdScreenshot.jsm b/browser/devtools/commandline/CmdScreenshot.jsm index 1c164a51b55..7a65a3b5b8d 100644 --- a/browser/devtools/commandline/CmdScreenshot.jsm +++ b/browser/devtools/commandline/CmdScreenshot.jsm @@ -4,7 +4,7 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; -this.EXPORTED_SYMBOLS = [ ]; +let EXPORTED_SYMBOLS = [ ]; Cu.import("resource:///modules/devtools/gcli.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); diff --git a/browser/devtools/commandline/Commands.jsm b/browser/devtools/commandline/Commands.jsm index c1ca7dd0ffa..c96aa26a69d 100644 --- a/browser/devtools/commandline/Commands.jsm +++ b/browser/devtools/commandline/Commands.jsm @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -this.EXPORTED_SYMBOLS = [ ]; +let EXPORTED_SYMBOLS = [ ]; const Cu = Components.utils; diff --git a/browser/devtools/commandline/gcli.jsm b/browser/devtools/commandline/gcli.jsm index b3bde36bdb6..b222e7ba922 100644 --- a/browser/devtools/commandline/gcli.jsm +++ b/browser/devtools/commandline/gcli.jsm @@ -24,7 +24,7 @@ * For more information, ask Joe Walker */ -this.EXPORTED_SYMBOLS = [ "gcli" ]; +var EXPORTED_SYMBOLS = [ "gcli" ]; Components.utils.import("resource://gre/modules/devtools/Require.jsm"); Components.utils.import("resource://gre/modules/devtools/Console.jsm"); @@ -10479,4 +10479,4 @@ define("text!gcli/ui/tooltip.html", [], "\n" + // Satisfy EXPORTED_SYMBOLS -this.gcli = require('gcli/index'); +const gcli = require('gcli/index'); diff --git a/browser/devtools/commandline/test/helpers.js b/browser/devtools/commandline/test/helpers.js index 7537a88254d..4f477e05292 100644 --- a/browser/devtools/commandline/test/helpers.js +++ b/browser/devtools/commandline/test/helpers.js @@ -54,7 +54,7 @@ * of GCLI and can be run as a test case. */ -this.EXPORTED_SYMBOLS = [ 'helpers' ]; +var EXPORTED_SYMBOLS = [ 'helpers' ]; var test = { }; @@ -503,7 +503,7 @@ DeveloperToolbarTest.closeAllTabs = function() { /////////////////////////////////////////////////////////////////////////////// -this.helpers = {}; +var helpers = {}; var assert = { ok: ok, is: is, log: info }; diff --git a/browser/devtools/debugger/DebuggerUI.jsm b/browser/devtools/debugger/DebuggerUI.jsm index bcc4df734cb..a6159fc77c2 100644 --- a/browser/devtools/debugger/DebuggerUI.jsm +++ b/browser/devtools/debugger/DebuggerUI.jsm @@ -25,7 +25,7 @@ XPCOMUtils.defineLazyModuleGetter(this, XPCOMUtils.defineLazyModuleGetter(this, "FileUtils", "resource:///modules/FileUtils.jsm"); -this.EXPORTED_SYMBOLS = ["DebuggerUI"]; +let EXPORTED_SYMBOLS = ["DebuggerUI"]; /** * Provides a simple mechanism of managing debugger instances. @@ -33,10 +33,10 @@ this.EXPORTED_SYMBOLS = ["DebuggerUI"]; * @param nsIDOMWindow aWindow * The chrome window for which the DebuggerUI instance is created. */ -this.DebuggerUI = function DebuggerUI(aWindow) { +function DebuggerUI(aWindow) { this.chromeWindow = aWindow; this.listenToTabs(); -}; +} DebuggerUI.prototype = { /** diff --git a/browser/devtools/highlighter/CmdInspect.jsm b/browser/devtools/highlighter/CmdInspect.jsm index c352c96cb28..1e4dbf33367 100644 --- a/browser/devtools/highlighter/CmdInspect.jsm +++ b/browser/devtools/highlighter/CmdInspect.jsm @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; -this.EXPORTED_SYMBOLS = [ ]; +let EXPORTED_SYMBOLS = [ ]; Cu.import("resource:///modules/devtools/gcli.jsm"); diff --git a/browser/devtools/highlighter/highlighter.jsm b/browser/devtools/highlighter/highlighter.jsm index e94d41bfa55..95228bb65b4 100644 --- a/browser/devtools/highlighter/highlighter.jsm +++ b/browser/devtools/highlighter/highlighter.jsm @@ -12,7 +12,7 @@ Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource:///modules/devtools/LayoutHelpers.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -this.EXPORTED_SYMBOLS = ["Highlighter"]; +var EXPORTED_SYMBOLS = ["Highlighter"]; const INSPECTOR_INVISIBLE_ELEMENTS = { "head": true, @@ -113,7 +113,7 @@ const PSEUDO_CLASSES = [":hover", ":active", ":focus"]; * * @param object aWindow */ -this.Highlighter = function Highlighter(aWindow) +function Highlighter(aWindow) { this.chromeWin = aWindow; this.tabbrowser = aWindow.gBrowser; diff --git a/browser/devtools/highlighter/inspector.jsm b/browser/devtools/highlighter/inspector.jsm index 2ffbaf77cec..02de2ac5a29 100644 --- a/browser/devtools/highlighter/inspector.jsm +++ b/browser/devtools/highlighter/inspector.jsm @@ -9,7 +9,7 @@ const Cu = Components.utils; const Ci = Components.interfaces; const Cr = Components.results; -this.EXPORTED_SYMBOLS = ["InspectorUI"]; +var EXPORTED_SYMBOLS = ["InspectorUI"]; Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); @@ -411,7 +411,7 @@ Inspector.prototype = { * @param nsIDOMWindow aWindow * The chrome window for which the Inspector instance is created. */ -this.InspectorUI = function InspectorUI(aWindow) +function InspectorUI(aWindow) { // Let style inspector tools register themselves. let tmp = {}; diff --git a/browser/devtools/highlighter/test/helpers.js b/browser/devtools/highlighter/test/helpers.js index 60362d5925e..5ccba0d2490 100644 --- a/browser/devtools/highlighter/test/helpers.js +++ b/browser/devtools/highlighter/test/helpers.js @@ -54,7 +54,7 @@ * of GCLI and can be run as a test case. */ -this.EXPORTED_SYMBOLS = [ 'helpers' ]; +var EXPORTED_SYMBOLS = [ 'helpers' ]; var test = { }; @@ -496,7 +496,7 @@ DeveloperToolbarTest.closeAllTabs = function() { /////////////////////////////////////////////////////////////////////////////// -this.helpers = {}; +var helpers = {}; helpers._display = undefined; diff --git a/browser/devtools/layoutview/LayoutView.jsm b/browser/devtools/layoutview/LayoutView.jsm index b07d411acff..600cff78549 100644 --- a/browser/devtools/layoutview/LayoutView.jsm +++ b/browser/devtools/layoutview/LayoutView.jsm @@ -12,9 +12,9 @@ Cu.import("resource:///modules/inspector.jsm"); Cu.import("resource:///modules/devtools/LayoutHelpers.jsm"); Cu.import("resource:///modules/devtools/CssLogic.jsm"); -this.EXPORTED_SYMBOLS = ["LayoutView"]; +var EXPORTED_SYMBOLS = ["LayoutView"]; -this.LayoutView = function LayoutView(aOptions) +function LayoutView(aOptions) { this.chromeDoc = aOptions.document; this.inspector = aOptions.inspector; diff --git a/browser/devtools/markupview/MarkupView.jsm b/browser/devtools/markupview/MarkupView.jsm index a45b7b63510..f52d2fd0eb4 100644 --- a/browser/devtools/markupview/MarkupView.jsm +++ b/browser/devtools/markupview/MarkupView.jsm @@ -13,7 +13,7 @@ const PAGE_SIZE = 10; const PREVIEW_AREA = 700; -this.EXPORTED_SYMBOLS = ["MarkupView"]; +var EXPORTED_SYMBOLS = ["MarkupView"]; Cu.import("resource:///modules/devtools/LayoutHelpers.jsm"); Cu.import("resource:///modules/devtools/CssRuleView.jsm"); @@ -39,7 +39,7 @@ Cu.import("resource://gre/modules/Services.jsm"); * @param iframe aFrame * An iframe in which the caller has kindly loaded markup-view.xhtml. */ -this.MarkupView = function MarkupView(aInspector, aFrame) +function MarkupView(aInspector, aFrame) { this._inspector = aInspector; this._frame = aFrame; diff --git a/browser/devtools/responsivedesign/CmdResize.jsm b/browser/devtools/responsivedesign/CmdResize.jsm index 1303136c296..2ac6250032a 100644 --- a/browser/devtools/responsivedesign/CmdResize.jsm +++ b/browser/devtools/responsivedesign/CmdResize.jsm @@ -4,7 +4,7 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; -this.EXPORTED_SYMBOLS = [ ]; +let EXPORTED_SYMBOLS = [ ]; Cu.import("resource:///modules/devtools/gcli.jsm"); diff --git a/browser/devtools/responsivedesign/responsivedesign.jsm b/browser/devtools/responsivedesign/responsivedesign.jsm index ed3e50b5857..a32aa46c088 100644 --- a/browser/devtools/responsivedesign/responsivedesign.jsm +++ b/browser/devtools/responsivedesign/responsivedesign.jsm @@ -12,7 +12,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource:///modules/devtools/FloatingScrollbars.jsm"); Cu.import("resource:///modules/devtools/EventEmitter.jsm"); -this.EXPORTED_SYMBOLS = ["ResponsiveUIManager"]; +var EXPORTED_SYMBOLS = ["ResponsiveUIManager"]; const MIN_WIDTH = 50; const MIN_HEIGHT = 50; @@ -20,7 +20,7 @@ const MIN_HEIGHT = 50; const MAX_WIDTH = 10000; const MAX_HEIGHT = 10000; -this.ResponsiveUIManager = { +let ResponsiveUIManager = { /** * Check if the a tab is in a responsive mode. * Leave the responsive mode if active, diff --git a/browser/devtools/responsivedesign/test/helpers.js b/browser/devtools/responsivedesign/test/helpers.js index 60362d5925e..5ccba0d2490 100644 --- a/browser/devtools/responsivedesign/test/helpers.js +++ b/browser/devtools/responsivedesign/test/helpers.js @@ -54,7 +54,7 @@ * of GCLI and can be run as a test case. */ -this.EXPORTED_SYMBOLS = [ 'helpers' ]; +var EXPORTED_SYMBOLS = [ 'helpers' ]; var test = { }; @@ -496,7 +496,7 @@ DeveloperToolbarTest.closeAllTabs = function() { /////////////////////////////////////////////////////////////////////////////// -this.helpers = {}; +var helpers = {}; helpers._display = undefined; diff --git a/browser/devtools/scratchpad/scratchpad-manager.jsm b/browser/devtools/scratchpad/scratchpad-manager.jsm index a54685d2360..94e073efcfa 100644 --- a/browser/devtools/scratchpad/scratchpad-manager.jsm +++ b/browser/devtools/scratchpad/scratchpad-manager.jsm @@ -5,7 +5,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["ScratchpadManager"]; +var EXPORTED_SYMBOLS = ["ScratchpadManager"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -21,7 +21,7 @@ Cu.import("resource://gre/modules/Services.jsm"); * of open scratchpads for session restore. There's only one ScratchpadManager in * the life of the browser. */ -this.ScratchpadManager = { +var ScratchpadManager = { _nextUid: 1, _scratchpads: [], diff --git a/browser/devtools/shared/Browser.jsm b/browser/devtools/shared/Browser.jsm index 8ae927c2b03..a4a955074ea 100644 --- a/browser/devtools/shared/Browser.jsm +++ b/browser/devtools/shared/Browser.jsm @@ -11,14 +11,14 @@ * forwards to dump(); */ -this.EXPORTED_SYMBOLS = [ "Node", "HTMLElement", "setTimeout", "clearTimeout" ]; +const EXPORTED_SYMBOLS = [ "Node", "HTMLElement", "setTimeout", "clearTimeout" ]; /** * Expose Node/HTMLElement objects. This allows us to use the Node constants * without resorting to hardcoded numbers */ -this.Node = Components.interfaces.nsIDOMNode; -this.HTMLElement = Components.interfaces.nsIDOMHTMLElement; +const Node = Components.interfaces.nsIDOMNode; +const HTMLElement = Components.interfaces.nsIDOMHTMLElement; Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); @@ -66,7 +66,7 @@ TimerCallback.prototype.notify = function(timer) { * @return the ID of the timeout, which can be used later with * window.clearTimeout. */ -this.setTimeout = function setTimeout(callback, delay) { +const setTimeout = function setTimeout(callback, delay) { const timer = Components.classes["@mozilla.org/timer;1"] .createInstance(Components.interfaces.nsITimer); @@ -83,7 +83,7 @@ this.setTimeout = function setTimeout(callback, delay) { * @param timerID the ID of the timeout you wish to clear, as returned by * window.setTimeout(). */ -this.clearTimeout = function clearTimeout(timerID) { +const clearTimeout = function clearTimeout(timerID) { let timer = timers[timerID]; if (timer) { timer.cancel(); diff --git a/browser/devtools/shared/DOMHelpers.jsm b/browser/devtools/shared/DOMHelpers.jsm index 49a6d0b6fd5..489db50bef7 100644 --- a/browser/devtools/shared/DOMHelpers.jsm +++ b/browser/devtools/shared/DOMHelpers.jsm @@ -2,7 +2,7 @@ * 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 = ["DOMHelpers"]; +const EXPORTED_SYMBOLS = ["DOMHelpers"]; /** * DOMHelpers @@ -12,7 +12,7 @@ this.EXPORTED_SYMBOLS = ["DOMHelpers"]; * @param nsIDOMWindow aWindow * The content window, owning the document to traverse. */ -this.DOMHelpers = function DOMHelpers(aWindow) { +function DOMHelpers(aWindow) { this.window = aWindow; }; diff --git a/browser/devtools/shared/DeveloperToolbar.jsm b/browser/devtools/shared/DeveloperToolbar.jsm index e98e158cf26..c70f1c751b0 100644 --- a/browser/devtools/shared/DeveloperToolbar.jsm +++ b/browser/devtools/shared/DeveloperToolbar.jsm @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = [ "DeveloperToolbar" ]; +const EXPORTED_SYMBOLS = [ "DeveloperToolbar" ]; const NS_XHTML = "http://www.w3.org/1999/xhtml"; const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; @@ -46,7 +46,7 @@ XPCOMUtils.defineLazyGetter(this, "isLinux", function () { * @param aChromeWindow The browser window to which this toolbar is attached * @param aToolbarElement See browser.xul: */ -this.DeveloperToolbar = function DeveloperToolbar(aChromeWindow, aToolbarElement) +function DeveloperToolbar(aChromeWindow, aToolbarElement) { this._chromeWindow = aChromeWindow; diff --git a/browser/devtools/shared/EventEmitter.jsm b/browser/devtools/shared/EventEmitter.jsm index d70324fc570..dafa50c9a74 100644 --- a/browser/devtools/shared/EventEmitter.jsm +++ b/browser/devtools/shared/EventEmitter.jsm @@ -1,8 +1,6 @@ -// XXXkhuey this should have a license header. +var EXPORTED_SYMBOLS = ["EventEmitter"]; -this.EXPORTED_SYMBOLS = ["EventEmitter"]; - -this.EventEmitter = function EventEmitter() { +function EventEmitter() { } EventEmitter.prototype = { diff --git a/browser/devtools/shared/FloatingScrollbars.jsm b/browser/devtools/shared/FloatingScrollbars.jsm index a47a784bdd4..3ed738c88f3 100644 --- a/browser/devtools/shared/FloatingScrollbars.jsm +++ b/browser/devtools/shared/FloatingScrollbars.jsm @@ -6,7 +6,7 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; -this.EXPORTED_SYMBOLS = [ "switchToFloatingScrollbars", "switchToNativeScrollbars" ]; +const EXPORTED_SYMBOLS = [ "switchToFloatingScrollbars", "switchToNativeScrollbars" ]; Cu.import("resource://gre/modules/Services.jsm"); @@ -20,7 +20,7 @@ let trackedTabs = new WeakMap(); * @param aTab the targeted tab. * */ -this.switchToFloatingScrollbars = function switchToFloatingScrollbars(aTab) { +function switchToFloatingScrollbars(aTab) { let mgr = trackedTabs.get(aTab); if (!mgr) { mgr = new ScrollbarManager(aTab); @@ -34,7 +34,7 @@ this.switchToFloatingScrollbars = function switchToFloatingScrollbars(aTab) { * @param aTab the targeted tab. * */ -this.switchToNativeScrollbars = function switchToNativeScrollbars(aTab) { +function switchToNativeScrollbars(aTab) { let mgr = trackedTabs.get(aTab); if (mgr) { mgr.reset(); diff --git a/browser/devtools/shared/Jsbeautify.jsm b/browser/devtools/shared/Jsbeautify.jsm index 4171d57468f..325cc36e0ed 100644 --- a/browser/devtools/shared/Jsbeautify.jsm +++ b/browser/devtools/shared/Jsbeautify.jsm @@ -56,9 +56,9 @@ */ -this.EXPORTED_SYMBOLS = ["js_beautify"]; +let EXPORTED_SYMBOLS = ["js_beautify"]; -this.js_beautify = function js_beautify(js_source_text, options) { +function js_beautify(js_source_text, options) { var input, output, token_text, last_type, last_text, last_last_text, last_word, flags, flag_store, indent_string; var whitespace, wordchar, punct, parser_pos, line_starters, digits; diff --git a/browser/devtools/shared/LayoutHelpers.jsm b/browser/devtools/shared/LayoutHelpers.jsm index 64dd465478e..998a2668386 100644 --- a/browser/devtools/shared/LayoutHelpers.jsm +++ b/browser/devtools/shared/LayoutHelpers.jsm @@ -18,9 +18,9 @@ XPCOMUtils.defineLazyGetter(this, "PlatformKeys", function() { "chrome://global-platform/locale/platformKeys.properties"); }); -this.EXPORTED_SYMBOLS = ["LayoutHelpers"]; +var EXPORTED_SYMBOLS = ["LayoutHelpers"]; -this.LayoutHelpers = LayoutHelpers = { +LayoutHelpers = { /** * Compute the position and the dimensions for the visible portion diff --git a/browser/devtools/shared/SplitView.jsm b/browser/devtools/shared/SplitView.jsm index 214ce0d5672..6bce85dd4cf 100644 --- a/browser/devtools/shared/SplitView.jsm +++ b/browser/devtools/shared/SplitView.jsm @@ -5,7 +5,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["SplitView"]; +const EXPORTED_SYMBOLS = ["SplitView"]; /* this must be kept in sync with CSS (ie. splitview.css) */ const LANDSCAPE_MEDIA_QUERY = "(min-width: 551px)"; @@ -26,7 +26,7 @@ const BINDING_USERDATA = "splitview-binding"; * @param DOMElement aRoot * @see appendItem */ -this.SplitView = function SplitView(aRoot) +function SplitView(aRoot) { this._root = aRoot; this._controller = aRoot.querySelector(".splitview-controller"); diff --git a/browser/devtools/shared/Templater.jsm b/browser/devtools/shared/Templater.jsm index c0c9af26542..8779c8bba6c 100644 --- a/browser/devtools/shared/Templater.jsm +++ b/browser/devtools/shared/Templater.jsm @@ -15,7 +15,7 @@ */ -this.EXPORTED_SYMBOLS = [ "Templater", "template" ]; +var EXPORTED_SYMBOLS = [ "Templater", "template" ]; Components.utils.import("resource://gre/modules/Services.jsm"); const Node = Components.interfaces.nsIDOMNode; @@ -44,7 +44,7 @@ const Node = Components.interfaces.nsIDOMNode; * convert null/undefined to ''. By setting blankNullUndefined:true, this * conversion is handled by DOMTemplate */ -this.template = function template(node, data, options) { +function template(node, data, options) { var template = new Templater(options || {}); template.processNode(node, data); return template; @@ -54,7 +54,7 @@ this.template = function template(node, data, options) { * Construct a Templater object. Use template() in preference to this ctor. * @deprecated Use template(node, data, options); */ -this.Templater = function Templater(options) { +function Templater(options) { if (options == null) { options = { allowEval: true }; } diff --git a/browser/devtools/shared/Undo.jsm b/browser/devtools/shared/Undo.jsm index 5312d6249f2..3e91ae14361 100644 --- a/browser/devtools/shared/Undo.jsm +++ b/browser/devtools/shared/Undo.jsm @@ -5,7 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ const Cu = Components.utils; -this.EXPORTED_SYMBOLS = ["UndoStack"]; +var EXPORTED_SYMBOLS=["UndoStack"]; /** * A simple undo stack manager. @@ -19,7 +19,7 @@ this.EXPORTED_SYMBOLS = ["UndoStack"]; * @param integer aMaxUndo Maximum number of undo steps. * defaults to 50. */ -this.UndoStack = function UndoStack(aMaxUndo) +function UndoStack(aMaxUndo) { this.maxUndo = aMaxUndo || 50; this._stack = []; diff --git a/browser/devtools/shared/test/helpers.js b/browser/devtools/shared/test/helpers.js index 60362d5925e..5ccba0d2490 100644 --- a/browser/devtools/shared/test/helpers.js +++ b/browser/devtools/shared/test/helpers.js @@ -54,7 +54,7 @@ * of GCLI and can be run as a test case. */ -this.EXPORTED_SYMBOLS = [ 'helpers' ]; +var EXPORTED_SYMBOLS = [ 'helpers' ]; var test = { }; @@ -496,7 +496,7 @@ DeveloperToolbarTest.closeAllTabs = function() { /////////////////////////////////////////////////////////////////////////////// -this.helpers = {}; +var helpers = {}; helpers._display = undefined; diff --git a/browser/devtools/sourceeditor/source-editor-orion.jsm b/browser/devtools/sourceeditor/source-editor-orion.jsm index b9dd7fa4a4c..d67dda9b3c6 100644 --- a/browser/devtools/sourceeditor/source-editor-orion.jsm +++ b/browser/devtools/sourceeditor/source-editor-orion.jsm @@ -140,7 +140,7 @@ if (Services.appinfo.OS == "WINNT" || }); } -this.EXPORTED_SYMBOLS = ["SourceEditor"]; +var EXPORTED_SYMBOLS = ["SourceEditor"]; /** * The SourceEditor object constructor. The SourceEditor component allows you to @@ -151,7 +151,7 @@ this.EXPORTED_SYMBOLS = ["SourceEditor"]; * * @constructor */ -this.SourceEditor = function SourceEditor() { +function SourceEditor() { // Update the SourceEditor defaults from user preferences. SourceEditor.DEFAULTS.tabSize = diff --git a/browser/devtools/sourceeditor/source-editor-ui.jsm b/browser/devtools/sourceeditor/source-editor-ui.jsm index 8b74d16238f..c0d4e52cdfc 100644 --- a/browser/devtools/sourceeditor/source-editor-ui.jsm +++ b/browser/devtools/sourceeditor/source-editor-ui.jsm @@ -9,12 +9,12 @@ const Cu = Components.utils; Cu.import("resource://gre/modules/Services.jsm"); -this.EXPORTED_SYMBOLS = ["SourceEditorUI"]; +var EXPORTED_SYMBOLS = ["SourceEditorUI"]; /** * The Source Editor component user interface. */ -this.SourceEditorUI = function SourceEditorUI(aEditor) +function SourceEditorUI(aEditor) { this.editor = aEditor; this._onDirtyChanged = this._onDirtyChanged.bind(this); diff --git a/browser/devtools/sourceeditor/source-editor.jsm b/browser/devtools/sourceeditor/source-editor.jsm index 04622183f67..def2cfb5a7a 100644 --- a/browser/devtools/sourceeditor/source-editor.jsm +++ b/browser/devtools/sourceeditor/source-editor.jsm @@ -34,8 +34,8 @@ try { } // Export the SourceEditor. -this.SourceEditor = obj.SourceEditor; -this.EXPORTED_SYMBOLS = ["SourceEditor"]; +var SourceEditor = obj.SourceEditor; +var EXPORTED_SYMBOLS = ["SourceEditor"]; // Add the constants used by all SourceEditors. diff --git a/browser/devtools/styleeditor/CmdEdit.jsm b/browser/devtools/styleeditor/CmdEdit.jsm index 0449ef48921..593afe94053 100644 --- a/browser/devtools/styleeditor/CmdEdit.jsm +++ b/browser/devtools/styleeditor/CmdEdit.jsm @@ -4,7 +4,7 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; -this.EXPORTED_SYMBOLS = [ ]; +let EXPORTED_SYMBOLS = [ ]; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource:///modules/devtools/gcli.jsm"); diff --git a/browser/devtools/styleeditor/StyleEditor.jsm b/browser/devtools/styleeditor/StyleEditor.jsm index 685d039d2a0..a43a285d3bb 100644 --- a/browser/devtools/styleeditor/StyleEditor.jsm +++ b/browser/devtools/styleeditor/StyleEditor.jsm @@ -5,7 +5,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["StyleEditor", "StyleEditorFlags", "StyleEditorManager"]; +const EXPORTED_SYMBOLS = ["StyleEditor", "StyleEditorFlags", "StyleEditorManager"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -65,7 +65,7 @@ const TRANSITIONS_ENABLED = Services.prefs.getBoolPref(TRANSITIONS_PREF); * @see inputElement * @see StyleEditorChrome */ -this.StyleEditor = function StyleEditor(aDocument, aStyleSheet) +function StyleEditor(aDocument, aStyleSheet) { assert(aDocument, "Argument 'aDocument' is required."); @@ -1143,7 +1143,7 @@ StyleEditor.prototype = { * * @see StyleEditor.setFlag */ -this.StyleEditorFlags = { +let StyleEditorFlags = { DISABLED: "disabled", ERROR: "error", IMPORTED: "imported", @@ -1282,7 +1282,7 @@ function setupBracketCompletion(aSourceEditor) * Manage the different editors instances. */ -this.StyleEditorManager = function StyleEditorManager(aWindow) { +function StyleEditorManager(aWindow) { this.chromeWindow = aWindow; this.listenToTabs(); this.editors = new WeakMap(); diff --git a/browser/devtools/styleeditor/StyleEditorChrome.jsm b/browser/devtools/styleeditor/StyleEditorChrome.jsm index ca9dccd9e2f..93d02f27caf 100644 --- a/browser/devtools/styleeditor/StyleEditorChrome.jsm +++ b/browser/devtools/styleeditor/StyleEditorChrome.jsm @@ -5,7 +5,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["StyleEditorChrome"]; +const EXPORTED_SYMBOLS = ["StyleEditorChrome"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -32,7 +32,7 @@ const STYLE_EDITOR_TEMPLATE = "stylesheet"; * @param DOMWindow aContentWindow * Content DOMWindow to attach to this chrome. */ -this.StyleEditorChrome = function StyleEditorChrome(aRoot, aContentWindow) +function StyleEditorChrome(aRoot, aContentWindow) { assert(aRoot, "Argument 'aRoot' is required to initialize StyleEditorChrome."); diff --git a/browser/devtools/styleeditor/StyleEditorUtil.jsm b/browser/devtools/styleeditor/StyleEditorUtil.jsm index 7ef4a10c6fe..96de0a5c9d5 100644 --- a/browser/devtools/styleeditor/StyleEditorUtil.jsm +++ b/browser/devtools/styleeditor/StyleEditorUtil.jsm @@ -5,11 +5,11 @@ "use strict"; -this.EXPORTED_SYMBOLS = [ +const EXPORTED_SYMBOLS = [ "_", "assert", - "attr", // XXXkhuey unused? - "getCurrentBrowserTabContentWindow", // XXXkhuey unused? + "attr", + "getCurrentBrowserTabContentWindow", "log", "text", "wire" @@ -35,7 +35,7 @@ const gStringBundle = Services.strings.createBundle(PROPERTIES_URL); * Optional arguments to format in the string. * @return string */ -this._ = function _(aName) +function _(aName) { if (arguments.length == 1) { @@ -53,7 +53,7 @@ this._ = function _(aName) * Optional message. * @return aExpression */ -this.assert = function assert(aExpression, aMessage) +function assert(aExpression, aMessage) { if (!!!(aExpression)) { let msg = aMessage ? "ASSERTION FAILURE:" + aMessage : "ASSERTION FAILURE"; @@ -76,7 +76,7 @@ this.assert = function assert(aExpression, aMessage) * Text content of matching element or null if there were no element * matching aSelector. */ -this.text = function text(aRoot, aSelector, aText) +function text(aRoot, aSelector, aText) { let element = aRoot.querySelector(aSelector); if (!element) { @@ -113,7 +113,7 @@ function forEach(aObject, aCallback) * One or multiple arguments to log. * If multiple arguments are given, they will be joined by " " in the log. */ -this.log = function log() +function log() { console.logStringMessage(Array.prototype.slice.call(arguments).join(" ")); } @@ -136,7 +136,7 @@ this.log = function log() * If aDescriptor is a function, the argument is equivalent to : * {events: {'click': aDescriptor}} */ -this.wire = function wire(aRoot, aSelectorOrElement, aDescriptor) +function wire(aRoot, aSelectorOrElement, aDescriptor) { let matches; if (typeof(aSelectorOrElement) == "string") { // selector diff --git a/browser/devtools/styleeditor/test/helpers.js b/browser/devtools/styleeditor/test/helpers.js index 60362d5925e..5ccba0d2490 100644 --- a/browser/devtools/styleeditor/test/helpers.js +++ b/browser/devtools/styleeditor/test/helpers.js @@ -54,7 +54,7 @@ * of GCLI and can be run as a test case. */ -this.EXPORTED_SYMBOLS = [ 'helpers' ]; +var EXPORTED_SYMBOLS = [ 'helpers' ]; var test = { }; @@ -496,7 +496,7 @@ DeveloperToolbarTest.closeAllTabs = function() { /////////////////////////////////////////////////////////////////////////////// -this.helpers = {}; +var helpers = {}; helpers._display = undefined; diff --git a/browser/devtools/styleinspector/CssHtmlTree.jsm b/browser/devtools/styleinspector/CssHtmlTree.jsm index 520a02eb10c..b74b8f29131 100644 --- a/browser/devtools/styleinspector/CssHtmlTree.jsm +++ b/browser/devtools/styleinspector/CssHtmlTree.jsm @@ -18,7 +18,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource:///modules/devtools/CssLogic.jsm"); Cu.import("resource:///modules/devtools/Templater.jsm"); -this.EXPORTED_SYMBOLS = ["CssHtmlTree", "PropertyView"]; +var EXPORTED_SYMBOLS = ["CssHtmlTree", "PropertyView"]; /** * Helper for long-running processes that should yield occasionally to @@ -116,7 +116,7 @@ UpdateProcess.prototype = { * @params {StyleInspector} aStyleInspector The owner of this CssHtmlTree * @constructor */ -this.CssHtmlTree = function CssHtmlTree(aStyleInspector) +function CssHtmlTree(aStyleInspector) { this.styleWin = aStyleInspector.iframe; this.styleInspector = aStyleInspector; @@ -719,7 +719,7 @@ CssHtmlTree.prototype = { * @param {string} aName the CSS property name for which this PropertyView * instance will render the rules. */ -this.PropertyView = function PropertyView(aTree, aName) +function PropertyView(aTree, aName) { this.tree = aTree; this.name = aName; diff --git a/browser/devtools/styleinspector/CssLogic.jsm b/browser/devtools/styleinspector/CssLogic.jsm index 9f9aa994c19..fc146a2aaf6 100644 --- a/browser/devtools/styleinspector/CssLogic.jsm +++ b/browser/devtools/styleinspector/CssLogic.jsm @@ -53,9 +53,9 @@ const RX_PSEUDO = /\s*:?:([\w-]+)(\(?\)?)\s*/g; Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -this.EXPORTED_SYMBOLS = ["CssLogic", "CssSelector"]; +var EXPORTED_SYMBOLS = ["CssLogic", "CssSelector"]; -this.CssLogic = function CssLogic() +function CssLogic() { // The cache of examined CSS properties. _propertyInfos: {}; @@ -1350,7 +1350,7 @@ CssRule.prototype = { * @param {CssRule} aCssRule the CssRule instance from where the selector comes. * @param {string} aSelector The selector that we wish to investigate. */ -this.CssSelector = function CssSelector(aCssRule, aSelector) +function CssSelector(aCssRule, aSelector) { this._cssRule = aCssRule; this.text = aSelector; diff --git a/browser/devtools/styleinspector/CssRuleView.jsm b/browser/devtools/styleinspector/CssRuleView.jsm index 7114415d8d0..df0a9139bb3 100644 --- a/browser/devtools/styleinspector/CssRuleView.jsm +++ b/browser/devtools/styleinspector/CssRuleView.jsm @@ -31,11 +31,11 @@ Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource:///modules/devtools/CssLogic.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -this.EXPORTED_SYMBOLS = ["CssRuleView", - "_ElementStyle", - "editableItem", - "_editableField", - "_getInplaceEditorForSpan"]; +var EXPORTED_SYMBOLS = ["CssRuleView", + "_ElementStyle", + "editableItem", + "_editableField", + "_getInplaceEditorForSpan"]; /** * Our model looks like this: @@ -97,7 +97,7 @@ function ElementStyle(aElement, aStore) this.populate(); } // We're exporting _ElementStyle for unit tests. -this._ElementStyle = ElementStyle; +var _ElementStyle = ElementStyle; ElementStyle.prototype = { @@ -874,7 +874,7 @@ TextProperty.prototype = { * set of disabled properties. * @constructor */ -this.CssRuleView = function CssRuleView(aDoc, aStore) +function CssRuleView(aDoc, aStore) { this.doc = aDoc; this.store = aStore; @@ -1925,7 +1925,7 @@ function editableField(aOptions) * @param function aCallback * Called when the editor is activated. */ -this.editableItem = function editableItem(aOptions, aCallback) +function editableItem(aOptions, aCallback) { let trigger = aOptions.trigger || "click" let element = aOptions.element; @@ -1967,7 +1967,7 @@ this.editableItem = function editableItem(aOptions, aCallback) element._editable = true; } -this._editableField = editableField; +var _editableField = editableField; function InplaceEditor(aOptions, aEvent) { @@ -2257,7 +2257,7 @@ InplaceEditor.prototype = { * own compartment, those expandos live on Xray wrappers that are only visible * within this JSM. So we provide a little workaround here. */ -this._getInplaceEditorForSpan = function _getInplaceEditorForSpan(aSpan) { return aSpan.inplaceEditor; }; +function _getInplaceEditorForSpan(aSpan) { return aSpan.inplaceEditor; }; /** * Store of CSSStyleDeclarations mapped to properties that have been changed by diff --git a/browser/devtools/styleinspector/StyleInspector.jsm b/browser/devtools/styleinspector/StyleInspector.jsm index 0496c381de4..673d88afe5a 100644 --- a/browser/devtools/styleinspector/StyleInspector.jsm +++ b/browser/devtools/styleinspector/StyleInspector.jsm @@ -15,7 +15,7 @@ Cu.import("resource:///modules/inspector.jsm"); // This module doesn't currently export any symbols directly, it only // registers inspector tools. -this.EXPORTED_SYMBOLS = []; +var EXPORTED_SYMBOLS = []; /** * Lookup l10n string from a string bundle. diff --git a/browser/devtools/tilt/CmdTilt.jsm b/browser/devtools/tilt/CmdTilt.jsm index ff6d84de145..0519656d87f 100644 --- a/browser/devtools/tilt/CmdTilt.jsm +++ b/browser/devtools/tilt/CmdTilt.jsm @@ -3,7 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -this.EXPORTED_SYMBOLS = [ ]; +let EXPORTED_SYMBOLS = [ ]; Components.utils.import("resource:///modules/devtools/gcli.jsm"); Components.utils.import("resource:///modules/HUDService.jsm"); diff --git a/browser/devtools/tilt/Tilt.jsm b/browser/devtools/tilt/Tilt.jsm index a32e80a39f3..64f430adb17 100644 --- a/browser/devtools/tilt/Tilt.jsm +++ b/browser/devtools/tilt/Tilt.jsm @@ -48,7 +48,7 @@ Cu.import("resource:///modules/devtools/TiltGL.jsm"); Cu.import("resource:///modules/devtools/TiltUtils.jsm"); Cu.import("resource:///modules/devtools/TiltVisualizer.jsm"); -this.EXPORTED_SYMBOLS = ["Tilt"]; +let EXPORTED_SYMBOLS = ["Tilt"]; /** * Object managing instances of the visualizer. @@ -56,7 +56,7 @@ this.EXPORTED_SYMBOLS = ["Tilt"]; * @param {Window} aWindow * the chrome window used by each visualizer instance */ -this.Tilt = function Tilt(aWindow) +function Tilt(aWindow) { /** * Save a reference to the top-level window. diff --git a/browser/devtools/tilt/TiltGL.jsm b/browser/devtools/tilt/TiltGL.jsm index 41232dbef7e..76563983ed8 100644 --- a/browser/devtools/tilt/TiltGL.jsm +++ b/browser/devtools/tilt/TiltGL.jsm @@ -15,12 +15,12 @@ Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource:///modules/devtools/TiltMath.jsm"); Cu.import("resource:///modules/devtools/TiltUtils.jsm"); -this.EXPORTED_SYMBOLS = ["TiltGL"]; +let EXPORTED_SYMBOLS = ["TiltGL"]; /** * Module containing thin wrappers around low-level WebGL functions. */ -this.TiltGL = {}; +let TiltGL = {}; /** * Contains commonly used helper methods used in any 3D application. diff --git a/browser/devtools/tilt/TiltMath.jsm b/browser/devtools/tilt/TiltMath.jsm index 0ce2a48c83d..d00908aab0c 100644 --- a/browser/devtools/tilt/TiltMath.jsm +++ b/browser/devtools/tilt/TiltMath.jsm @@ -9,7 +9,7 @@ const Cu = Components.utils; Cu.import("resource:///modules/devtools/TiltUtils.jsm"); -this.EXPORTED_SYMBOLS = +let EXPORTED_SYMBOLS = ["EPSILON", "TiltMath", "vec3", "mat3", "mat4", "quat4"]; /** @@ -17,7 +17,7 @@ this.EXPORTED_SYMBOLS = * Inspired by glMatrix, version 0.9.6, (c) 2011 Brandon Jones. */ -this.EPSILON = 0.01; +const EPSILON = 0.01; const PI_OVER_180 = Math.PI / 180; const INV_PI_OVER_180 = 180 / Math.PI; const FIFTEEN_OVER_225 = 15 / 225; @@ -26,7 +26,7 @@ const ONE_OVER_255 = 1 / 255; /** * vec3 - 3 Dimensional Vector. */ -this.vec3 = { +let vec3 = { /** * Creates a new instance of a vec3 using the Float32Array type. @@ -496,7 +496,7 @@ this.vec3 = { /** * mat3 - 3x3 Matrix. */ -this.mat3 = { +let mat3 = { /** * Creates a new instance of a mat3 using the Float32Array array type. @@ -659,7 +659,7 @@ this.mat3 = { /** * mat4 - 4x4 Matrix. */ -this.mat4 = { +let mat4 = { /** * Creates a new instance of a mat4 using the default Float32Array type. @@ -1627,7 +1627,7 @@ this.mat4 = { /** * quat4 - Quaternion. */ -this.quat4 = { +let quat4 = { /** * Creates a new instance of a quat4 using the default Float32Array type. @@ -2116,7 +2116,7 @@ this.quat4 = { /** * Various algebraic math functions required by the engine. */ -this.TiltMath = { +let TiltMath = { /** * Helper function, converts degrees to radians. diff --git a/browser/devtools/tilt/TiltUtils.jsm b/browser/devtools/tilt/TiltUtils.jsm index 275dfe59976..c142feb9e6b 100644 --- a/browser/devtools/tilt/TiltUtils.jsm +++ b/browser/devtools/tilt/TiltUtils.jsm @@ -13,12 +13,12 @@ Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource:///modules/devtools/LayoutHelpers.jsm"); -this.EXPORTED_SYMBOLS = ["TiltUtils"]; +let EXPORTED_SYMBOLS = ["TiltUtils"]; /** * Module containing various helper functions used throughout Tilt. */ -this.TiltUtils = {}; +let TiltUtils = {}; /** * Various console/prompt output functions required by the engine. diff --git a/browser/devtools/tilt/TiltVisualizer.jsm b/browser/devtools/tilt/TiltVisualizer.jsm index 05d678ad854..4218a5a085b 100644 --- a/browser/devtools/tilt/TiltVisualizer.jsm +++ b/browser/devtools/tilt/TiltVisualizer.jsm @@ -56,7 +56,7 @@ Cu.import("resource:///modules/devtools/TiltMath.jsm"); Cu.import("resource:///modules/devtools/TiltUtils.jsm"); Cu.import("resource:///modules/devtools/TiltVisualizerStyle.jsm"); -this.EXPORTED_SYMBOLS = ["TiltVisualizer"]; +let EXPORTED_SYMBOLS = ["TiltVisualizer"]; /** * Initializes the visualization presenter and controller. @@ -70,7 +70,7 @@ this.EXPORTED_SYMBOLS = ["TiltVisualizer"]; * {Function} onError: optional, function called if initialization failed * {Function} onLoad: optional, function called if initialization worked */ -this.TiltVisualizer = function TiltVisualizer(aProperties) +function TiltVisualizer(aProperties) { // make sure the properties parameter is a valid object aProperties = aProperties || {}; diff --git a/browser/devtools/tilt/TiltVisualizerStyle.jsm b/browser/devtools/tilt/TiltVisualizerStyle.jsm index ef44d5ba9f4..7d8dabeb9ae 100644 --- a/browser/devtools/tilt/TiltVisualizerStyle.jsm +++ b/browser/devtools/tilt/TiltVisualizerStyle.jsm @@ -9,13 +9,13 @@ const Cu = Components.utils; Cu.import("resource:///modules/devtools/TiltMath.jsm"); -this.EXPORTED_SYMBOLS = ["TiltVisualizerStyle"]; +let EXPORTED_SYMBOLS = ["TiltVisualizerStyle"]; let rgba = TiltMath.hex2rgba; /** * Various colors and style settings used throughout Tilt. */ -this.TiltVisualizerStyle = { +let TiltVisualizerStyle = { canvas: { background: "-moz-linear-gradient(top, #454545 0%, #000 100%)", diff --git a/browser/devtools/webconsole/AutocompletePopup.jsm b/browser/devtools/webconsole/AutocompletePopup.jsm index d9fd6d859db..e410e080db5 100644 --- a/browser/devtools/webconsole/AutocompletePopup.jsm +++ b/browser/devtools/webconsole/AutocompletePopup.jsm @@ -20,7 +20,7 @@ XPCOMUtils.defineLazyGetter(this, "stringBundle", function () { }); -this.EXPORTED_SYMBOLS = ["AutocompletePopup"]; +var EXPORTED_SYMBOLS = ["AutocompletePopup"]; /** * Autocomplete popup UI implementation. @@ -29,7 +29,7 @@ this.EXPORTED_SYMBOLS = ["AutocompletePopup"]; * @param nsIDOMDocument aDocument * The document you want the popup attached to. */ -this.AutocompletePopup = function AutocompletePopup(aDocument) +function AutocompletePopup(aDocument) { this._document = aDocument; diff --git a/browser/devtools/webconsole/HUDService.jsm b/browser/devtools/webconsole/HUDService.jsm index 5f901d74a71..8d9c5e12f51 100644 --- a/browser/devtools/webconsole/HUDService.jsm +++ b/browser/devtools/webconsole/HUDService.jsm @@ -23,7 +23,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "WebConsoleUtils", const STRINGS_URI = "chrome://browser/locale/devtools/webconsole.properties"; let l10n = new WebConsoleUtils.l10n(STRINGS_URI); -this.EXPORTED_SYMBOLS = ["HUDService"]; +var EXPORTED_SYMBOLS = ["HUDService"]; function LogFactory(aMessagePrefix) { diff --git a/browser/devtools/webconsole/NetworkPanel.jsm b/browser/devtools/webconsole/NetworkPanel.jsm index 35e83391a57..9c5d26faf58 100644 --- a/browser/devtools/webconsole/NetworkPanel.jsm +++ b/browser/devtools/webconsole/NetworkPanel.jsm @@ -27,7 +27,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "WebConsoleUtils", const STRINGS_URI = "chrome://browser/locale/devtools/webconsole.properties"; let l10n = new WebConsoleUtils.l10n(STRINGS_URI); -this.EXPORTED_SYMBOLS = ["NetworkPanel"]; +var EXPORTED_SYMBOLS = ["NetworkPanel"]; /** * Creates a new NetworkPanel. @@ -37,7 +37,7 @@ this.EXPORTED_SYMBOLS = ["NetworkPanel"]; * @param object aHttpActivity * HttpActivity to display in the panel. */ -this.NetworkPanel = function NetworkPanel(aParent, aHttpActivity) +function NetworkPanel(aParent, aHttpActivity) { let doc = aParent.ownerDocument; this.httpActivity = aHttpActivity; diff --git a/browser/devtools/webconsole/PropertyPanel.jsm b/browser/devtools/webconsole/PropertyPanel.jsm index a04b5a885ff..38c36364616 100644 --- a/browser/devtools/webconsole/PropertyPanel.jsm +++ b/browser/devtools/webconsole/PropertyPanel.jsm @@ -15,7 +15,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "WebConsoleUtils", "resource://gre/modules/devtools/WebConsoleUtils.jsm"); -this.EXPORTED_SYMBOLS = ["PropertyPanel", "PropertyTreeView"]; +var EXPORTED_SYMBOLS = ["PropertyPanel", "PropertyTreeView"]; /////////////////////////////////////////////////////////////////////////// //// PropertyTreeView. @@ -25,7 +25,7 @@ this.EXPORTED_SYMBOLS = ["PropertyPanel", "PropertyTreeView"]; * interface properties, see the documentation: * https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsITreeView */ -this.PropertyTreeView = function() { +var PropertyTreeView = function() { this._rows = []; this._objectActors = []; }; @@ -404,7 +404,7 @@ function appendChild(aDocument, aParent, aTag, aAttributes) * @param array of objects aButtons * Array with buttons to display at the bottom of the panel. */ -this.PropertyPanel = function PropertyPanel(aParent, aTitle, aObject, aButtons) +function PropertyPanel(aParent, aTitle, aObject, aButtons) { let document = aParent.ownerDocument; diff --git a/browser/fuel/src/fuelApplication.js b/browser/fuel/src/fuelApplication.js index 4373ad966d5..623694bb766 100644 --- a/browser/fuel/src/fuelApplication.js +++ b/browser/fuel/src/fuelApplication.js @@ -804,5 +804,5 @@ Application.prototype = { // set the proto, defined in extApplication.js Application.prototype.__proto__ = extApplication.prototype; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([Application]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([Application]); diff --git a/browser/modules/AboutHomeUtils.jsm b/browser/modules/AboutHomeUtils.jsm index 08977441786..98d7e052e1d 100644 --- a/browser/modules/AboutHomeUtils.jsm +++ b/browser/modules/AboutHomeUtils.jsm @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = [ "AboutHomeUtils" ]; +const EXPORTED_SYMBOLS = [ "AboutHomeUtils" ]; Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); Components.utils.import("resource://gre/modules/Services.jsm"); @@ -15,7 +15,7 @@ const SNIPPETS_URL_PREF = "browser.aboutHomeSnippets.updateUrl"; // Should be bumped up if the snippets content format changes. const STARTPAGE_VERSION = 3; -this.AboutHomeUtils = new Object(); +let AboutHomeUtils = new Object(); /** * Returns an object containing the name and searchURL of the original default diff --git a/browser/modules/BrowserNewTabPreloader.jsm b/browser/modules/BrowserNewTabPreloader.jsm index 91662f23cf0..fecd7d383e9 100644 --- a/browser/modules/BrowserNewTabPreloader.jsm +++ b/browser/modules/BrowserNewTabPreloader.jsm @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["BrowserNewTabPreloader"]; +let EXPORTED_SYMBOLS = ["BrowserNewTabPreloader"]; const Cu = Components.utils; const Cc = Components.classes; @@ -18,7 +18,7 @@ const PREF_BRANCH = "browser.newtab."; const TOPIC_DELAYED_STARTUP = "browser-delayed-startup-finished"; const PRELOADER_INIT_DELAY_MS = 5000; -this.BrowserNewTabPreloader = { +let BrowserNewTabPreloader = { init: function Preloader_init() { Initializer.start(); }, diff --git a/browser/modules/NetworkPrioritizer.jsm b/browser/modules/NetworkPrioritizer.jsm index 027f4b8865c..a656adf8ac0 100644 --- a/browser/modules/NetworkPrioritizer.jsm +++ b/browser/modules/NetworkPrioritizer.jsm @@ -13,7 +13,7 @@ * Lowest (+10): Background tabs in background windows. */ -this.EXPORTED_SYMBOLS = ["trackBrowserWindow"]; +let EXPORTED_SYMBOLS = ["trackBrowserWindow"]; const Ci = Components.interfaces; @@ -39,7 +39,7 @@ let _windows = []; // Exported symbol -this.trackBrowserWindow = function trackBrowserWindow(aWindow) { +function trackBrowserWindow(aWindow) { WindowHelper.addWindow(aWindow); } diff --git a/browser/modules/NewTabUtils.jsm b/browser/modules/NewTabUtils.jsm index ea78faef425..d1c1b0db669 100644 --- a/browser/modules/NewTabUtils.jsm +++ b/browser/modules/NewTabUtils.jsm @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["NewTabUtils"]; +let EXPORTED_SYMBOLS = ["NewTabUtils"]; const Ci = Components.interfaces; const Cc = Components.classes; @@ -675,7 +675,7 @@ let ExpirationFilter = { /** * Singleton that provides the public API of this JSM. */ -this.NewTabUtils = { +let NewTabUtils = { _initialized: false, init: function NewTabUtils_init() { diff --git a/browser/modules/SignInToWebsite.jsm b/browser/modules/SignInToWebsite.jsm index b1943ef8f7d..f3716e9948b 100644 --- a/browser/modules/SignInToWebsite.jsm +++ b/browser/modules/SignInToWebsite.jsm @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["SignInToWebsiteUX"]; +const EXPORTED_SYMBOLS = ["SignInToWebsiteUX"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -23,7 +23,7 @@ function log(...aMessageArgs) { Logger.log.apply(Logger, ["SignInToWebsiteUX"].concat(aMessageArgs)); } -this.SignInToWebsiteUX = { +let SignInToWebsiteUX = { init: function SignInToWebsiteUX_init() { diff --git a/browser/modules/Social.jsm b/browser/modules/Social.jsm index 478b72f3338..1d72652ea9f 100644 --- a/browser/modules/Social.jsm +++ b/browser/modules/Social.jsm @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["Social"]; +let EXPORTED_SYMBOLS = ["Social"]; const Ci = Components.interfaces; const Cc = Components.classes; @@ -16,7 +16,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "SocialService", "resource://gre/modules/SocialService.jsm"); -this.Social = { +let Social = { lastEventReceived: 0, provider: null, _disabledForSafeMode: false, diff --git a/browser/modules/TelemetryTimestamps.jsm b/browser/modules/TelemetryTimestamps.jsm index 7a17b877078..22a4edbcc53 100644 --- a/browser/modules/TelemetryTimestamps.jsm +++ b/browser/modules/TelemetryTimestamps.jsm @@ -2,7 +2,7 @@ * 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 = ["TelemetryTimestamps"]; +let EXPORTED_SYMBOLS = ["TelemetryTimestamps"]; /** * This module's purpose is to collect timestamps for important @@ -15,7 +15,7 @@ this.EXPORTED_SYMBOLS = ["TelemetryTimestamps"]; */ let timeStamps = {}; -this.TelemetryTimestamps = { +let TelemetryTimestamps = { /** * Adds a timestamp to the list. The addition of TimeStamps that already have * a value stored is ignored. diff --git a/browser/modules/WindowsJumpLists.jsm b/browser/modules/WindowsJumpLists.jsm index b4f098e14e7..65f29a01c6a 100644 --- a/browser/modules/WindowsJumpLists.jsm +++ b/browser/modules/WindowsJumpLists.jsm @@ -35,7 +35,7 @@ const LIST_TYPE = { * Exports */ -this.EXPORTED_SYMBOLS = [ +let EXPORTED_SYMBOLS = [ "WinTaskbarJumpList", ]; @@ -157,7 +157,7 @@ var tasksCfg = [ ///////////////////////////////////////////////////////////////////////////// // Implementation -this.WinTaskbarJumpList = +var WinTaskbarJumpList = { _builder: null, _tasks: null, diff --git a/browser/modules/WindowsPreviewPerTab.jsm b/browser/modules/WindowsPreviewPerTab.jsm index ca4bbb53adf..4e9ce2bf0b8 100644 --- a/browser/modules/WindowsPreviewPerTab.jsm +++ b/browser/modules/WindowsPreviewPerTab.jsm @@ -41,7 +41,7 @@ * buttons appear on the taskbar, so a magic pref-controlled number determines * when this threshold has been crossed. */ -this.EXPORTED_SYMBOLS = ["AeroPeek"]; +var EXPORTED_SYMBOLS = ["AeroPeek"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -558,7 +558,7 @@ TabWindow.prototype = { * This object acts as global storage and external interface for this feature. * It maintains the values of the prefs. */ -this.AeroPeek = { +var AeroPeek = { available: false, // Does the pref say we're enabled? _prefenabled: true, diff --git a/browser/modules/offlineAppCache.jsm b/browser/modules/offlineAppCache.jsm index 5153711e290..26c99b00b93 100644 --- a/browser/modules/offlineAppCache.jsm +++ b/browser/modules/offlineAppCache.jsm @@ -2,12 +2,12 @@ * 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 = ["OfflineAppCacheHelper"]; +let EXPORTED_SYMBOLS = ["OfflineAppCacheHelper"]; const Cc = Components.classes; const Ci = Components.interfaces; -this.OfflineAppCacheHelper = { +let OfflineAppCacheHelper = { clear: function() { var cacheService = Cc["@mozilla.org/network/cache-service;1"]. getService(Ci.nsICacheService); diff --git a/browser/modules/openLocationLastURL.jsm b/browser/modules/openLocationLastURL.jsm index 0d653df28ba..a00d4397db6 100644 --- a/browser/modules/openLocationLastURL.jsm +++ b/browser/modules/openLocationLastURL.jsm @@ -8,7 +8,7 @@ const Ci = Components.interfaces; Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); -this.EXPORTED_SYMBOLS = [ "OpenLocationLastURL" ]; +var EXPORTED_SYMBOLS = [ "OpenLocationLastURL" ]; let prefSvc = Components.classes["@mozilla.org/preferences-service;1"] .getService(Components.interfaces.nsIPrefBranch); @@ -41,7 +41,7 @@ os.addObserver(observer, "last-pb-context-exited", true); os.addObserver(observer, "browser:purge-session-history", true); -this.OpenLocationLastURL = function OpenLocationLastURL(aWindow) { +function OpenLocationLastURL(aWindow) { this.window = aWindow; } diff --git a/browser/modules/webappsUI.jsm b/browser/modules/webappsUI.jsm index b8305ce2c25..fb86cbfc20c 100644 --- a/browser/modules/webappsUI.jsm +++ b/browser/modules/webappsUI.jsm @@ -2,7 +2,7 @@ * 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 = ["webappsUI"]; +let EXPORTED_SYMBOLS = ["webappsUI"]; let Ci = Components.interfaces; let Cc = Components.classes; @@ -15,7 +15,7 @@ Cu.import("resource://gre/modules/AppsUtils.jsm"); Cu.import("resource://gre/modules/WebappsInstaller.jsm"); Cu.import("resource://gre/modules/WebappOSUtils.jsm"); -this.webappsUI = { +let webappsUI = { init: function webappsUI_init() { Services.obs.addObserver(this, "webapps-ask-install", false); Services.obs.addObserver(this, "webapps-launch", false); diff --git a/browser/modules/webrtcUI.jsm b/browser/modules/webrtcUI.jsm index f385c4cbe04..19ef9c9a20f 100644 --- a/browser/modules/webrtcUI.jsm +++ b/browser/modules/webrtcUI.jsm @@ -4,14 +4,14 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["webrtcUI"]; +let EXPORTED_SYMBOLS = ["webrtcUI"]; const Cu = Components.utils; const Ci = Components.interfaces; Cu.import("resource://gre/modules/Services.jsm"); -this.webrtcUI = { +let webrtcUI = { init: function () { Services.obs.addObserver(handleRequest, "getUserMedia:request", false); }, diff --git a/content/base/src/CSPUtils.jsm b/content/base/src/CSPUtils.jsm index efa15770bf9..599bfedb429 100644 --- a/content/base/src/CSPUtils.jsm +++ b/content/base/src/CSPUtils.jsm @@ -20,8 +20,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource://gre/modules/Services.jsm"); // Module stuff -this.EXPORTED_SYMBOLS = ["CSPRep", "CSPSourceList", "CSPSource", "CSPHost", - "CSPdebug", "CSPViolationReportListener", "CSPLocalizer"]; +var EXPORTED_SYMBOLS = ["CSPRep", "CSPSourceList", "CSPSource", "CSPHost", + "CSPdebug", "CSPViolationReportListener", "CSPLocalizer"]; var STRINGS_URI = "chrome://global/locale/security/csp.properties"; @@ -94,7 +94,7 @@ var gPrefObserver = { }, }; -this.CSPdebug = function CSPdebug(aMsg) { +function CSPdebug(aMsg) { if (!gPrefObserver.debugEnabled) return; aMsg = 'CSP debug: ' + aMsg + "\n"; @@ -160,7 +160,7 @@ CSPPolicyURIListener.prototype = { /** * Class that represents a parsed policy structure. */ -this.CSPRep = function CSPRep() { +function CSPRep() { // this gets set to true when the policy is done parsing, or when a // URI-borne policy has finished loading. this._isInitialized = false; @@ -664,7 +664,7 @@ CSPRep.prototype = { /** * Class to represent a list of sources */ -this.CSPSourceList = function CSPSourceList() { +function CSPSourceList() { this._sources = []; this._permitAllSources = false; @@ -900,7 +900,7 @@ CSPSourceList.prototype = { /** * Class to model a source (scheme, host, port) */ -this.CSPSource = function CSPSource() { +function CSPSource() { this._scheme = undefined; this._port = undefined; this._host = undefined; @@ -1387,7 +1387,7 @@ CSPSource.prototype = { /** * Class to model a host *.x.y. */ -this.CSPHost = function CSPHost() { +function CSPHost() { this._segments = []; } @@ -1556,7 +1556,7 @@ CSPHost.prototype = { /** * Class that listens to violation report transmission and logs errors. */ -this.CSPViolationReportListener = function CSPViolationReportListener(reportURI) { +function CSPViolationReportListener(reportURI) { this._reportURI = reportURI; } @@ -1636,7 +1636,7 @@ function cspWarn(aCSPRep, aMessage) { ////////////////////////////////////////////////////////////////////// -this.CSPLocalizer = { +CSPLocalizer = { /** * Retrieve a localized string. * diff --git a/content/base/src/contentAreaDropListener.js b/content/base/src/contentAreaDropListener.js index b101dfc62b8..5a7ae4f6335 100644 --- a/content/base/src/contentAreaDropListener.js +++ b/content/base/src/contentAreaDropListener.js @@ -151,4 +151,4 @@ ContentAreaDropListener.prototype = }; var components = [ContentAreaDropListener]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/content/base/src/contentSecurityPolicy.js b/content/base/src/contentSecurityPolicy.js index 7807d809f11..2d017fd73be 100644 --- a/content/base/src/contentSecurityPolicy.js +++ b/content/base/src/contentSecurityPolicy.js @@ -570,4 +570,4 @@ CSPReportRedirectSink.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentSecurityPolicy]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentSecurityPolicy]); diff --git a/content/base/src/messageWakeupService.js b/content/base/src/messageWakeupService.js index 73d7c243145..ca68a5afd20 100644 --- a/content/base/src/messageWakeupService.js +++ b/content/base/src/messageWakeupService.js @@ -92,5 +92,5 @@ MessageWakeupService.prototype = }; var components = [MessageWakeupService]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/content/base/src/nsBadCertHandler.js b/content/base/src/nsBadCertHandler.js index 28119e4c2e9..e2224c6dd14 100644 --- a/content/base/src/nsBadCertHandler.js +++ b/content/base/src/nsBadCertHandler.js @@ -42,4 +42,4 @@ BadCertHandler.prototype = { classID: Components.ID("{dbded6ec-edbf-4054-a834-287b82c260f9}"), }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([BadCertHandler]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([BadCertHandler]); diff --git a/content/xslt/src/xslt/txEXSLTRegExFunctions.js b/content/xslt/src/xslt/txEXSLTRegExFunctions.js index 9aa60cc8314..afa421568f0 100644 --- a/content/xslt/src/xslt/txEXSLTRegExFunctions.js +++ b/content/xslt/src/xslt/txEXSLTRegExFunctions.js @@ -66,4 +66,4 @@ txEXSLTRegExFunctions.prototype = { } } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([txEXSLTRegExFunctions]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([txEXSLTRegExFunctions]); diff --git a/content/xtf/test/unit/xtfComponent.js b/content/xtf/test/unit/xtfComponent.js index 5cb38c59189..e95d19c2063 100644 --- a/content/xtf/test/unit/xtfComponent.js +++ b/content/xtf/test/unit/xtfComponent.js @@ -152,4 +152,4 @@ FooElementFactory.prototype = /* */ -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([FooElementFactory]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([FooElementFactory]); diff --git a/dom/activities/src/ActivitiesService.jsm b/dom/activities/src/ActivitiesService.jsm index 6ad759b0945..85343cf5591 100644 --- a/dom/activities/src/ActivitiesService.jsm +++ b/dom/activities/src/ActivitiesService.jsm @@ -16,7 +16,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "ppmm", "@mozilla.org/parentprocessmessagemanager;1", "nsIMessageBroadcaster"); -this.EXPORTED_SYMBOLS = []; +const EXPORTED_SYMBOLS = []; let idbGlobal = this; diff --git a/dom/activities/src/ActivityOptions.js b/dom/activities/src/ActivityOptions.js index 6481266cb79..cd5f4fdf32b 100644 --- a/dom/activities/src/ActivityOptions.js +++ b/dom/activities/src/ActivityOptions.js @@ -53,4 +53,4 @@ ActivityOptions.prototype = { }) } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivityOptions]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivityOptions]); diff --git a/dom/activities/src/ActivityProxy.js b/dom/activities/src/ActivityProxy.js index f38a99e4f1e..4d48fd1ce8e 100644 --- a/dom/activities/src/ActivityProxy.js +++ b/dom/activities/src/ActivityProxy.js @@ -100,4 +100,4 @@ ActivityProxy.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIActivityProxy]) } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivityProxy]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivityProxy]); diff --git a/dom/activities/src/ActivityRequestHandler.js b/dom/activities/src/ActivityRequestHandler.js index 3bc1436249d..3688bd05d00 100644 --- a/dom/activities/src/ActivityRequestHandler.js +++ b/dom/activities/src/ActivityRequestHandler.js @@ -77,4 +77,4 @@ ActivityRequestHandler.prototype = { }) } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivityRequestHandler]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivityRequestHandler]); diff --git a/dom/activities/src/ActivityWrapper.js b/dom/activities/src/ActivityWrapper.js index 8cdc99846df..ee4b01bb851 100644 --- a/dom/activities/src/ActivityWrapper.js +++ b/dom/activities/src/ActivityWrapper.js @@ -42,5 +42,5 @@ ActivityWrapper.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsISystemMessagesWrapper]) } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivityWrapper]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivityWrapper]); diff --git a/dom/alarm/AlarmDB.jsm b/dom/alarm/AlarmDB.jsm index 00938282d3a..b4402707ba0 100644 --- a/dom/alarm/AlarmDB.jsm +++ b/dom/alarm/AlarmDB.jsm @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["AlarmDB"]; +const EXPORTED_SYMBOLS = ["AlarmDB"]; /* static functions */ const DEBUG = false; @@ -23,7 +23,7 @@ const ALARMDB_NAME = "alarms"; const ALARMDB_VERSION = 1; const ALARMSTORE_NAME = "alarms"; -this.AlarmDB = function AlarmDB(aGlobal) { +function AlarmDB(aGlobal) { debug("AlarmDB()"); this._global = aGlobal; } diff --git a/dom/alarm/AlarmService.jsm b/dom/alarm/AlarmService.jsm index 3cf777e81c7..e94681efcaf 100644 --- a/dom/alarm/AlarmService.jsm +++ b/dom/alarm/AlarmService.jsm @@ -18,7 +18,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/AlarmDB.jsm"); -this.EXPORTED_SYMBOLS = ["AlarmService"]; +let EXPORTED_SYMBOLS = ["AlarmService"]; XPCOMUtils.defineLazyServiceGetter(this, "ppmm", "@mozilla.org/parentprocessmessagemanager;1", @@ -30,7 +30,7 @@ XPCOMUtils.defineLazyGetter(this, "messenger", function() { let myGlobal = this; -this.AlarmService = { +let AlarmService = { init: function init() { debug("init()"); diff --git a/dom/alarm/AlarmsManager.js b/dom/alarm/AlarmsManager.js index 0fb7c75e30b..e4ad93ec509 100644 --- a/dom/alarm/AlarmsManager.js +++ b/dom/alarm/AlarmsManager.js @@ -171,4 +171,4 @@ AlarmsManager.prototype = { }, } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AlarmsManager]) +const NSGetFactory = XPCOMUtils.generateNSGetFactory([AlarmsManager]) diff --git a/dom/apps/src/AppsService.js b/dom/apps/src/AppsService.js index 2baacb1c2fe..34a6782a8b1 100644 --- a/dom/apps/src/AppsService.js +++ b/dom/apps/src/AppsService.js @@ -62,4 +62,4 @@ AppsService.prototype = { QueryInterface : XPCOMUtils.generateQI([Ci.nsIAppsService]) } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AppsService]) +const NSGetFactory = XPCOMUtils.generateNSGetFactory([AppsService]) diff --git a/dom/apps/src/AppsServiceChild.jsm b/dom/apps/src/AppsServiceChild.jsm index 950c83acfbe..e89a8a6cdbd 100644 --- a/dom/apps/src/AppsServiceChild.jsm +++ b/dom/apps/src/AppsServiceChild.jsm @@ -11,7 +11,7 @@ const Ci = Components.interfaces; // This module exposes a subset of the functionnalities of the parent DOM // Registry to content processes, to be be used from the AppsService component. -this.EXPORTED_SYMBOLS = ["DOMApplicationRegistry"]; +let EXPORTED_SYMBOLS = ["DOMApplicationRegistry"]; Cu.import("resource://gre/modules/AppsUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); @@ -20,7 +20,7 @@ function debug(s) { //dump("-*- AppsServiceChild.jsm: " + s + "\n"); } -this.DOMApplicationRegistry = { +let DOMApplicationRegistry = { init: function init() { debug("init"); this.cpmm = Cc["@mozilla.org/childprocessmessagemanager;1"] diff --git a/dom/apps/src/AppsUtils.jsm b/dom/apps/src/AppsUtils.jsm index a8198a7ca92..acb13c34b4e 100644 --- a/dom/apps/src/AppsUtils.jsm +++ b/dom/apps/src/AppsUtils.jsm @@ -14,13 +14,13 @@ Cu.import("resource://gre/modules/Services.jsm"); // Shared code for AppsServiceChild.jsm, Webapps.jsm and Webapps.js -this.EXPORTED_SYMBOLS = ["AppsUtils", "ManifestHelper"]; +let EXPORTED_SYMBOLS = ["AppsUtils", "ManifestHelper"]; function debug(s) { //dump("-*- AppsUtils.jsm: " + s + "\n"); } -this.AppsUtils = { +let AppsUtils = { // Clones a app, without the manifest. cloneAppObject: function cloneAppObject(aApp) { return { @@ -240,7 +240,7 @@ this.AppsUtils = { /** * Helper object to access manifest information with locale support */ -this.ManifestHelper = function(aManifest, aOrigin) { +let ManifestHelper = function(aManifest, aOrigin) { this._origin = Services.io.newURI(aOrigin, null, null); this._manifest = aManifest; let chrome = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIXULChromeRegistry) diff --git a/dom/apps/src/OfflineCacheInstaller.jsm b/dom/apps/src/OfflineCacheInstaller.jsm index 3e9d38bbb83..0d3b0c29467 100644 --- a/dom/apps/src/OfflineCacheInstaller.jsm +++ b/dom/apps/src/OfflineCacheInstaller.jsm @@ -9,7 +9,7 @@ const Cc = Components.classes; const Ci = Components.interfaces; const CC = Components.Constructor; -this.EXPORTED_SYMBOLS = ["OfflineCacheInstaller"]; +let EXPORTED_SYMBOLS = ["OfflineCacheInstaller"]; Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/AppsUtils.jsm"); @@ -98,7 +98,7 @@ function readFile(aFile, aCallback) { }); } -this.OfflineCacheInstaller = { +const OfflineCacheInstaller = { installCache: function installCache(app) { let cacheDir = makeFile(app.basePath) cacheDir.append(app.appId); diff --git a/dom/apps/src/PermissionsInstaller.jsm b/dom/apps/src/PermissionsInstaller.jsm index 4cb6181cf9c..a8acdecdd13 100644 --- a/dom/apps/src/PermissionsInstaller.jsm +++ b/dom/apps/src/PermissionsInstaller.jsm @@ -11,10 +11,10 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/AppsUtils.jsm"); Cu.import("resource://gre/modules/PermissionSettings.jsm"); -this.EXPORTED_SYMBOLS = ["PermissionsInstaller", - "expandPermissions", - "PermissionsTable", - ]; +var EXPORTED_SYMBOLS = ["PermissionsInstaller", + "expandPermissions", + "PermissionsTable", + ]; const UNKNOWN_ACTION = Ci.nsIPermissionManager.UNKNOWN_ACTION; const ALLOW_ACTION = Ci.nsIPermissionManager.ALLOW_ACTION; const DENY_ACTION = Ci.nsIPermissionManager.DENY_ACTION; @@ -50,7 +50,7 @@ function mapSuffixes(aPermName, aSuffixes) // battery-status, network-information, vibration, // device-capabilities -this.PermissionsTable = { "resource-lock": { +const PermissionsTable = { "resource-lock": { app: ALLOW_ACTION, privileged: ALLOW_ACTION, certified: ALLOW_ACTION @@ -275,7 +275,7 @@ for (let permName in PermissionsTable) { * @param string aAccess * @returns Array **/ -this.expandPermissions = function expandPermissions(aPermName, aAccess) { +function expandPermissions(aPermName, aAccess) { if (!PermissionsTable[aPermName]) { Cu.reportError("PermissionsTable.jsm: expandPermissions: Unknown Permission: " + aPermName); return []; @@ -322,9 +322,9 @@ Temporarily disabled in order to add access fields to gaia: See Bug 805646 } } return expandedPerms; -}; +} -this.PermissionsInstaller = { +let PermissionsInstaller = { /** * Install permissisions or remove deprecated permissions upon re-install * @param object aApp @@ -453,4 +453,4 @@ this.PermissionsInstaller = { } ); } -}; +} diff --git a/dom/apps/src/Webapps.js b/dom/apps/src/Webapps.js index bcc78d58821..f676040a51d 100644 --- a/dom/apps/src/Webapps.js +++ b/dom/apps/src/Webapps.js @@ -758,6 +758,6 @@ WebappsApplicationMgmt.prototype = { classDescription: "Webapps Application Mgmt"}) } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WebappsRegistry, - WebappsApplication, - DOMError]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([WebappsRegistry, + WebappsApplication, + DOMError]); diff --git a/dom/apps/src/Webapps.jsm b/dom/apps/src/Webapps.jsm index 4c7cc7ebbb8..3337880ea9e 100644 --- a/dom/apps/src/Webapps.jsm +++ b/dom/apps/src/Webapps.jsm @@ -9,7 +9,7 @@ const Cc = Components.classes; const Ci = Components.interfaces; const Cr = Components.results; -this.EXPORTED_SYMBOLS = ["DOMApplicationRegistry"]; +let EXPORTED_SYMBOLS = ["DOMApplicationRegistry"]; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); @@ -54,7 +54,7 @@ XPCOMUtils.defineLazyGetter(this, "msgmgr", function() { const DIRECTORY_NAME = WEBAPP_RUNTIME ? "WebappRegD" : "ProfD"; #endif -this.DOMApplicationRegistry = { +let DOMApplicationRegistry = { appsFile: null, webapps: { }, children: [ ], diff --git a/dom/base/ConsoleAPI.js b/dom/base/ConsoleAPI.js index 77176cbdd3c..4a3f845beed 100644 --- a/dom/base/ConsoleAPI.js +++ b/dom/base/ConsoleAPI.js @@ -485,4 +485,4 @@ ConsoleAPI.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ConsoleAPI]); +let NSGetFactory = XPCOMUtils.generateNSGetFactory([ConsoleAPI]); diff --git a/dom/base/ConsoleAPIStorage.jsm b/dom/base/ConsoleAPIStorage.jsm index bbdee79ce8c..7b6e02f57bb 100644 --- a/dom/base/ConsoleAPIStorage.jsm +++ b/dom/base/ConsoleAPIStorage.jsm @@ -11,7 +11,7 @@ Cu.import("resource://gre/modules/Services.jsm"); const STORAGE_MAX_EVENTS = 200; -this.EXPORTED_SYMBOLS = ["ConsoleAPIStorage"]; +var EXPORTED_SYMBOLS = ["ConsoleAPIStorage"]; var _consoleStorage = {}; @@ -36,7 +36,7 @@ var _consoleStorage = {}; * // Clear the events for the given inner window ID. * ConsoleAPIStorage.clearEvents(innerWindowID); */ -this.ConsoleAPIStorage = { +var ConsoleAPIStorage = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]), diff --git a/dom/base/DOMRequestHelper.jsm b/dom/base/DOMRequestHelper.jsm index 79a9df4439f..be2c3b43d8a 100644 --- a/dom/base/DOMRequestHelper.jsm +++ b/dom/base/DOMRequestHelper.jsm @@ -10,7 +10,7 @@ const Cu = Components.utils; const Cc = Components.classes; const Ci = Components.interfaces; -this.EXPORTED_SYMBOLS = ["DOMRequestIpcHelper"]; +let EXPORTED_SYMBOLS = ["DOMRequestIpcHelper"]; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); @@ -19,7 +19,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "cpmm", "@mozilla.org/childprocessmessagemanager;1", "nsIMessageListenerManager"); -this.DOMRequestIpcHelper = function DOMRequestIpcHelper() { +function DOMRequestIpcHelper() { } DOMRequestIpcHelper.prototype = { diff --git a/dom/base/IndexedDBHelper.jsm b/dom/base/IndexedDBHelper.jsm index 7feac95a112..108ab45e6ce 100644 --- a/dom/base/IndexedDBHelper.jsm +++ b/dom/base/IndexedDBHelper.jsm @@ -5,7 +5,6 @@ "use strict" let DEBUG = 0; -let debug; if (DEBUG) { debug = function (s) { dump("-*- IndexedDBHelper: " + s + "\n"); } } else { @@ -16,12 +15,12 @@ const Cu = Components.utils; const Cc = Components.classes; const Ci = Components.interfaces; -this.EXPORTED_SYMBOLS = ["IndexedDBHelper"]; +let EXPORTED_SYMBOLS = ["IndexedDBHelper"]; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); -this.IndexedDBHelper = function IndexedDBHelper() {} +function IndexedDBHelper() { } IndexedDBHelper.prototype = { diff --git a/dom/base/ObjectWrapper.jsm b/dom/base/ObjectWrapper.jsm index 7521c351371..b3563a181e2 100644 --- a/dom/base/ObjectWrapper.jsm +++ b/dom/base/ObjectWrapper.jsm @@ -8,11 +8,11 @@ const Cu = Components.utils; const Cc = Components.classes; const Ci = Components.interfaces; -this.EXPORTED_SYMBOLS = ["ObjectWrapper"]; +const EXPORTED_SYMBOLS = ["ObjectWrapper"]; // Makes sure that we expose correctly chrome JS objects to content. -this.ObjectWrapper = { +let ObjectWrapper = { getObjectKind: function objWrapper_getobjectkind(aObject) { if (!aObject) { return "null"; diff --git a/dom/base/SiteSpecificUserAgent.js b/dom/base/SiteSpecificUserAgent.js index b94acc5cc61..b84dabc2aca 100644 --- a/dom/base/SiteSpecificUserAgent.js +++ b/dom/base/SiteSpecificUserAgent.js @@ -24,4 +24,4 @@ SiteSpecificUserAgent.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsISiteSpecificUserAgent]) }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SiteSpecificUserAgent]); +let NSGetFactory = XPCOMUtils.generateNSGetFactory([SiteSpecificUserAgent]); diff --git a/dom/browser-element/BrowserElementParent.js b/dom/browser-element/BrowserElementParent.js index 12c7a31f9b4..020707c93bb 100644 --- a/dom/browser-element/BrowserElementParent.js +++ b/dom/browser-element/BrowserElementParent.js @@ -646,4 +646,4 @@ BrowserElementParent.prototype = { }, }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([BrowserElementParentFactory]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([BrowserElementParentFactory]); diff --git a/dom/browser-element/BrowserElementPromptService.jsm b/dom/browser-element/BrowserElementPromptService.jsm index 8f66c425414..5883904b0bf 100644 --- a/dom/browser-element/BrowserElementPromptService.jsm +++ b/dom/browser-element/BrowserElementPromptService.jsm @@ -11,7 +11,7 @@ let Cc = Components.classes; let Cr = Components.results; let Cm = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); -this.EXPORTED_SYMBOLS = ["BrowserElementPromptService"]; +let EXPORTED_SYMBOLS = ["BrowserElementPromptService"]; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); @@ -541,7 +541,7 @@ BrowserElementPromptFactory.prototype = { } }; -this.BrowserElementPromptService = { +let BrowserElementPromptService = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]), diff --git a/dom/contacts/ContactManager.js b/dom/contacts/ContactManager.js index 89c521b8fec..63520fe3ed1 100644 --- a/dom/contacts/ContactManager.js +++ b/dom/contacts/ContactManager.js @@ -601,5 +601,5 @@ ContactManager.prototype = { flags: nsIClassInfo.DOM_OBJECT}) } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory( +const NSGetFactory = XPCOMUtils.generateNSGetFactory( [Contact, ContactManager, ContactProperties, ContactAddress, ContactField, ContactTelField, ContactFindOptions]) diff --git a/dom/contacts/fallback/ContactDB.jsm b/dom/contacts/fallback/ContactDB.jsm index b00b3afca5e..2d04a86ff93 100644 --- a/dom/contacts/fallback/ContactDB.jsm +++ b/dom/contacts/fallback/ContactDB.jsm @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ['ContactDB']; +const EXPORTED_SYMBOLS = ['ContactDB']; const DEBUG = false; function debug(s) { dump("-*- ContactDB component: " + s + "\n"); } @@ -20,7 +20,7 @@ const DB_NAME = "contacts"; const DB_VERSION = 4; const STORE_NAME = "contacts"; -this.ContactDB = function ContactDB(aGlobal) { +function ContactDB(aGlobal) { if (DEBUG) debug("Constructor"); this._global = aGlobal; } diff --git a/dom/contacts/fallback/ContactService.jsm b/dom/contacts/fallback/ContactService.jsm index bc91a9935ba..20d7a112afb 100644 --- a/dom/contacts/fallback/ContactService.jsm +++ b/dom/contacts/fallback/ContactService.jsm @@ -11,7 +11,7 @@ const Cu = Components.utils; const Cc = Components.classes; const Ci = Components.interfaces; -this.EXPORTED_SYMBOLS = ["DOMContactManager"]; +let EXPORTED_SYMBOLS = ["DOMContactManager"]; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); @@ -38,7 +38,7 @@ XPCOMUtils.defineLazyGetter(this, "mRIL", function () { let myGlobal = this; -this.DOMContactManager = { +let DOMContactManager = { init: function() { if (DEBUG) debug("Init"); this._messages = ["Contacts:Find", "Contacts:Clear", "Contact:Save", "Contact:Remove", "Contacts:GetSimContacts"]; diff --git a/dom/encoding/test/file_stringencoding.jsm b/dom/encoding/test/file_stringencoding.jsm index cf554217027..79f78bb2309 100644 --- a/dom/encoding/test/file_stringencoding.jsm +++ b/dom/encoding/test/file_stringencoding.jsm @@ -1,6 +1,6 @@ -this.EXPORTED_SYMBOLS = ['checkFromJSM']; +var EXPORTED_SYMBOLS = ['checkFromJSM']; -this.checkFromJSM = function checkFromJSM(is_op) { +function checkFromJSM(is_op) { is_op(new TextDecoder().encoding, "utf-8", "JSM should have TextDecoder"); is_op(new TextEncoder().encoding, "utf-8", "JSM should have TextEncoder"); } diff --git a/dom/fm/DOMFMRadioChild.js b/dom/fm/DOMFMRadioChild.js index e151609269b..5a56725e198 100644 --- a/dom/fm/DOMFMRadioChild.js +++ b/dom/fm/DOMFMRadioChild.js @@ -383,5 +383,5 @@ DOMFMRadioChild.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DOMFMRadioChild]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([DOMFMRadioChild]); diff --git a/dom/fm/DOMFMRadioParent.jsm b/dom/fm/DOMFMRadioParent.jsm index 6fca3a325ef..78083028c09 100644 --- a/dom/fm/DOMFMRadioParent.jsm +++ b/dom/fm/DOMFMRadioParent.jsm @@ -60,9 +60,9 @@ XPCOMUtils.defineLazyServiceGetter(this, "gSettingsService", "@mozilla.org/settingsService;1", "nsISettingsService"); -this.EXPORTED_SYMBOLS = ["DOMFMRadioParent"]; +let EXPORTED_SYMBOLS = ["DOMFMRadioParent"]; -this.DOMFMRadioParent = { +let DOMFMRadioParent = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISettingsServiceCallback]), diff --git a/dom/identity/DOMIdentity.jsm b/dom/identity/DOMIdentity.jsm index b2a1282fc03..323f8442ad4 100644 --- a/dom/identity/DOMIdentity.jsm +++ b/dom/identity/DOMIdentity.jsm @@ -7,7 +7,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components; // This is the parent process corresponding to nsDOMIdentity. -this.EXPORTED_SYMBOLS = ["DOMIdentity"]; +let EXPORTED_SYMBOLS = ["DOMIdentity"]; Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); @@ -123,7 +123,7 @@ RPWatchContext.prototype = { } }; -this.DOMIdentity = { +let DOMIdentity = { // nsIMessageListener receiveMessage: function DOMIdentity_receiveMessage(aMessage) { let msg = aMessage.json; diff --git a/dom/identity/nsDOMIdentity.js b/dom/identity/nsDOMIdentity.js index 6bee460a141..ddf891f7692 100644 --- a/dom/identity/nsDOMIdentity.js +++ b/dom/identity/nsDOMIdentity.js @@ -534,4 +534,4 @@ nsDOMIdentityInternal.prototype = { }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsDOMIdentityInternal]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([nsDOMIdentityInternal]); diff --git a/dom/identity/nsIDService.js b/dom/identity/nsIDService.js index 64137ef3b29..d6d4bd648f6 100644 --- a/dom/identity/nsIDService.js +++ b/dom/identity/nsIDService.js @@ -31,4 +31,4 @@ IDService.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([IDService]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([IDService]); diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.js index d89086d8824..d6b40c66b81 100644 --- a/dom/media/PeerConnection.js +++ b/dom/media/PeerConnection.js @@ -673,6 +673,6 @@ PeerConnectionObserver.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory( +let NSGetFactory = XPCOMUtils.generateNSGetFactory( [IceCandidate, SessionDescription, PeerConnection] ); diff --git a/dom/messages/SystemMessageInternal.js b/dom/messages/SystemMessageInternal.js index 0a10bf3f4a7..aa942c63bea 100644 --- a/dom/messages/SystemMessageInternal.js +++ b/dom/messages/SystemMessageInternal.js @@ -361,4 +361,4 @@ SystemMessageInternal.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsISystemMessagesInternal, Ci.nsIObserver]) } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SystemMessageInternal]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([SystemMessageInternal]); diff --git a/dom/messages/SystemMessageManager.js b/dom/messages/SystemMessageManager.js index 0015b797b24..837d3ec86bc 100644 --- a/dom/messages/SystemMessageManager.js +++ b/dom/messages/SystemMessageManager.js @@ -217,4 +217,4 @@ SystemMessageManager.prototype = { classDescription: "System Messages"}) } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SystemMessageManager]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([SystemMessageManager]); diff --git a/dom/mms/src/ril/MmsPduHelper.jsm b/dom/mms/src/ril/MmsPduHelper.jsm index 3c388fe98ca..fd7e69111ee 100644 --- a/dom/mms/src/ril/MmsPduHelper.jsm +++ b/dom/mms/src/ril/MmsPduHelper.jsm @@ -13,7 +13,7 @@ Cu.import("resource://gre/modules/mms_consts.js"); let DEBUG; // set to true to see debug messages -this.translatePduErrorToStatus = function translatePduErrorToStatus(error) { +function translatePduErrorToStatus(error) { if (error == MMS_PDU_ERROR_OK) { return MMS_PDU_STATUS_RETRIEVED; } @@ -40,7 +40,7 @@ function defineLazyRegExp(obj, name, pattern) { * Yes = * No = */ -this.BooleanValue = { +let BooleanValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -76,7 +76,7 @@ this.BooleanValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A section 8 */ -this.Address = { +let Address = { /** * @param data * A wrapped object to store encoded raw data. @@ -187,7 +187,7 @@ defineLazyRegExp(Address, "REGEXP_ALPHANUM", "^\\w+$"); * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.2 */ -this.HeaderField = { +let HeaderField = { /** * @param data * A wrapped object containing raw PDU data. @@ -224,7 +224,7 @@ this.HeaderField = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.2 */ -this.MmsHeader = { +let MmsHeader = { /** * @param data * A wrapped object containing raw PDU data. @@ -300,7 +300,7 @@ this.MmsHeader = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.9 */ -this.ContentClassValue = { +let ContentClassValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -345,7 +345,7 @@ this.ContentClassValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.10 */ -this.ContentLocationValue = { +let ContentLocationValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -384,7 +384,7 @@ this.ContentLocationValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.18 */ -this.ElementDescriptorValue = { +let ElementDescriptorValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -422,7 +422,7 @@ this.ElementDescriptorValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.18 */ -this.Parameter = { +let Parameter = { /** * @param data * A wrapped object containing raw PDU data. @@ -532,7 +532,7 @@ this.Parameter = { * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.19 * @see OMA-TS-MMS_CONF-V1_3-20110913-A clause 10.2.1 */ -this.EncodedStringValue = { +let EncodedStringValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -670,7 +670,7 @@ this.EncodedStringValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.20 */ -this.ExpiryValue = { +let ExpiryValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -743,7 +743,7 @@ this.ExpiryValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.21 */ -this.FromValue = { +let FromValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -806,7 +806,7 @@ this.FromValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.23 */ -this.PreviouslySentByValue = { +let PreviouslySentByValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -836,7 +836,7 @@ this.PreviouslySentByValue = { * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.23 * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.24 */ -this.PreviouslySentDateValue = { +let PreviouslySentDateValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -870,7 +870,7 @@ this.PreviouslySentDateValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.27 */ -this.MessageClassValue = { +let MessageClassValue = { WELL_KNOWN_CLASSES: ["personal", "advertisement", "informational", "auto"], /** @@ -926,7 +926,7 @@ this.MessageClassValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.30 */ -this.MessageTypeValue = { +let MessageTypeValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -969,7 +969,7 @@ this.MessageTypeValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.32 */ -this.MmFlagsValue = { +let MmFlagsValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1032,7 +1032,7 @@ this.MmFlagsValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.33 */ -this.MmStateValue = { +let MmStateValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1075,7 +1075,7 @@ this.MmStateValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.35 */ -this.PriorityValue = { +let PriorityValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1114,7 +1114,7 @@ this.PriorityValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.39 */ -this.RecommendedRetrievalModeValue = { +let RecommendedRetrievalModeValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1136,7 +1136,7 @@ this.RecommendedRetrievalModeValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.43 */ -this.ReplyChargingValue = { +let ReplyChargingValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1180,7 +1180,7 @@ this.ReplyChargingValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.49 */ -this.ResponseText = { +let ResponseText = { /** * @param data * A wrapped object containing raw PDU data. @@ -1232,7 +1232,7 @@ this.ResponseText = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.50 */ -this.RetrieveStatusValue = { +let RetrieveStatusValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1270,7 +1270,7 @@ this.RetrieveStatusValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.54 */ -this.StatusValue = { +let StatusValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1305,7 +1305,7 @@ this.StatusValue = { }, }; -this.PduHelper = { +let PduHelper = { /** * @param data * A wrapped object containing raw PDU data. @@ -1695,7 +1695,7 @@ if (DEBUG) { debug = function (s) {}; } -this.EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS.concat([ +const EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS.concat([ // Utility functions "translatePduErrorToStatus", diff --git a/dom/mms/src/ril/MmsService.js b/dom/mms/src/ril/MmsService.js index 31fd26fcc10..84f07f40dd1 100644 --- a/dom/mms/src/ril/MmsService.js +++ b/dom/mms/src/ril/MmsService.js @@ -591,7 +591,7 @@ MmsService.prototype = { }, }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([MmsService]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([MmsService]); let debug; if (DEBUG) { diff --git a/dom/mms/src/ril/WapPushManager.js b/dom/mms/src/ril/WapPushManager.js index 284d48203ab..889db31ec8d 100644 --- a/dom/mms/src/ril/WapPushManager.js +++ b/dom/mms/src/ril/WapPushManager.js @@ -9,14 +9,14 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/WspPduHelper.jsm", this); +Cu.import("resource://gre/modules/WspPduHelper.jsm"); const DEBUG = false; // set to true to see debug messages /** * Helpers for WAP PDU processing. */ -this.WapPushManager = { +let WapPushManager = { /** * Parse raw PDU data and deliver to a proper target. @@ -86,7 +86,7 @@ if (DEBUG) { debug = function (s) {}; } -this.EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS.concat([ +const EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS.concat([ "WapPushManager", ]); diff --git a/dom/mms/src/ril/WspPduHelper.jsm b/dom/mms/src/ril/WspPduHelper.jsm index 60f9c1e212b..18fb69f6f5a 100644 --- a/dom/mms/src/ril/WspPduHelper.jsm +++ b/dom/mms/src/ril/WspPduHelper.jsm @@ -6,7 +6,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; -Cu.import("resource://gre/modules/wap_consts.js", this); +Cu.import("resource://gre/modules/wap_consts.js"); let DEBUG; // set to true to see debug messages @@ -26,7 +26,7 @@ const ASCIIS = 128; /** * Error class for generic encoding/decoding failures. */ -this.CodeError = function CodeError(message) { +function CodeError(message) { this.name = "CodeError"; this.message = message || "Invalid format"; } @@ -56,7 +56,7 @@ NullCharError.prototype.constructor = NullCharError; * @param message [optional] * A short description for the error. */ -this.FatalCodeError = function FatalCodeError(message) { +function FatalCodeError(message) { this.name = "FatalCodeError"; this.message = message || "Decoding fails"; } @@ -76,7 +76,7 @@ FatalCodeError.prototype.constructor = FatalCodeError; * @param message [optional] * A short description for the error. */ -this.NotWellKnownEncodingError = function NotWellKnownEncodingError(message) { +function NotWellKnownEncodingError(message) { this.name = "NotWellKnownEncodingError"; this.message = message || "Not well known encoding"; } @@ -96,7 +96,7 @@ NotWellKnownEncodingError.prototype.constructor = NotWellKnownEncodingError; * * @throws FatalCodeError if headers[name] is undefined. */ -this.ensureHeader = function ensureHeader(headers, name) { +function ensureHeader(headers, name) { let value = headers[name]; // Header field might have a null value as NoValue if (value === undefined) { @@ -130,7 +130,7 @@ this.ensureHeader = function ensureHeader(headers, name) { * * @see WAP-230-WSP-20010705-a clause 8.4.1.2 */ -this.skipValue = function skipValue(data) { +function skipValue(data) { let begin = data.offset; let value = Octet.decode(data); if (value <= 31) { @@ -165,7 +165,7 @@ this.skipValue = function skipValue(data) { * * @return Decoded value. */ -this.decodeAlternatives = function decodeAlternatives(data, options) { +function decodeAlternatives(data, options) { let begin = data.offset; for (let i = 2; i < arguments.length; i++) { try { @@ -191,7 +191,7 @@ this.decodeAlternatives = function decodeAlternatives(data, options) { * @param options * Extra context for encoding. */ -this.encodeAlternatives = function encodeAlternatives(data, value, options) { +function encodeAlternatives(data, value, options) { let begin = data.offset; for (let i = 3; i < arguments.length; i++) { try { @@ -208,7 +208,7 @@ this.encodeAlternatives = function encodeAlternatives(data, value, options) { } } -this.Octet = { +let Octet = { /** * @param data * A wrapped object containing raw PDU data. @@ -315,7 +315,7 @@ this.Octet = { * * @see RFC 2616 clause 2.2 Basic Rules */ -this.Text = { +let Text = { /** * @param data * A wrapped object containing raw PDU data. @@ -399,7 +399,7 @@ this.Text = { }, }; -this.NullTerminatedTexts = { +let NullTerminatedTexts = { /** * Decode internal referenced null terminated text string. * @@ -443,7 +443,7 @@ this.NullTerminatedTexts = { * * @see RFC 2616 clause 2.2 Basic Rules */ -this.Token = { +let Token = { /** * @param data * A wrapped object containing raw PDU data. @@ -519,7 +519,7 @@ this.Token = { * * @see RFC 2396 Uniform Resource Indentifiers (URI) */ -this.URIC = { +let URIC = { /** * @param data * A wrapped object containing raw PDU data. @@ -555,7 +555,7 @@ this.URIC = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.1 */ -this.TextString = { +let TextString = { /** * @param data * A wrapped object containing raw PDU data. @@ -611,7 +611,7 @@ this.TextString = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.1 */ -this.TokenText = { +let TokenText = { /** * @param data * A wrapped object containing raw PDU data. @@ -654,7 +654,7 @@ this.TokenText = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.1 */ -this.QuotedString = { +let QuotedString = { /** * @param data * A wrapped object containing raw PDU data. @@ -693,7 +693,7 @@ this.QuotedString = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.1 */ -this.ShortInteger = { +let ShortInteger = { /** * @param data * A wrapped object containing raw PDU data. @@ -739,7 +739,7 @@ this.ShortInteger = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.1 */ -this.LongInteger = { +let LongInteger = { /** * @param data * A wrapped object containing raw PDU data. @@ -821,7 +821,7 @@ this.LongInteger = { /** * @see WAP-230-WSP-20010705-a clause 8.4.2.1 */ -this.UintVar = { +let UintVar = { /** * @param data * A wrapped object containing raw PDU data. @@ -874,7 +874,7 @@ this.UintVar = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.1 */ -this.ConstrainedEncoding = { +let ConstrainedEncoding = { /** * @param data * A wrapped object containing raw PDU data. @@ -908,7 +908,7 @@ this.ConstrainedEncoding = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.2 */ -this.ValueLength = { +let ValueLength = { /** * @param data * A wrapped object containing raw PDU data. @@ -950,7 +950,7 @@ this.ValueLength = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.3 */ -this.NoValue = { +let NoValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -981,7 +981,7 @@ this.NoValue = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.3 */ -this.TextValue = { +let TextValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1008,7 +1008,7 @@ this.TextValue = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.3 */ -this.IntegerValue = { +let IntegerValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1044,7 +1044,7 @@ this.IntegerValue = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.3 */ -this.DateValue = { +let DateValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1087,7 +1087,7 @@ this.DateValue = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.3 */ -this.DeltaSecondsValue = IntegerValue; +let DeltaSecondsValue = IntegerValue; /** * Quality factor 0 and quality factors with one or two decimal digits are @@ -1097,7 +1097,7 @@ this.DeltaSecondsValue = IntegerValue; * * @see WAP-230-WSP-20010705-a clause 8.4.2.3 */ -this.QValue = { +let QValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1153,7 +1153,7 @@ this.QValue = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.3 */ -this.VersionValue = { +let VersionValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1218,7 +1218,7 @@ this.VersionValue = { * @see WAP-230-WSP-20010705-a clause 8.4.2.3 * @see RFC 2616 clause 2.2 Basic Rules */ -this.UriValue = { +let UriValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1245,7 +1245,7 @@ this.UriValue = { * * @see WAP-230-WSP-20010705-a table 38 */ -this.TypeValue = { +let TypeValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1306,7 +1306,7 @@ this.TypeValue = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.4 */ -this.Parameter = { +let Parameter = { /** * @param data * A wrapped object containing raw PDU data. @@ -1500,7 +1500,7 @@ this.Parameter = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.6 */ -this.Header = { +let Header = { /** * @param data * A wrapped object containing raw PDU data. @@ -1551,7 +1551,7 @@ this.Header = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.6 */ -this.WellKnownHeader = { +let WellKnownHeader = { /** * @param data * A wrapped object containing raw PDU data. @@ -1617,7 +1617,7 @@ this.WellKnownHeader = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.6 */ -this.ApplicationHeader = { +let ApplicationHeader = { /** * @param data * A wrapped object containing raw PDU data. @@ -1674,7 +1674,7 @@ this.ApplicationHeader = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.6 */ -this.FieldName = { +let FieldName = { /** * @param data * A wrapped object containing raw PDU data. @@ -1726,7 +1726,7 @@ this.FieldName = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.8 */ -this.AcceptCharsetValue = { +let AcceptCharsetValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1841,7 +1841,7 @@ this.AcceptCharsetValue = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.8 */ -this.WellKnownCharset = { +let WellKnownCharset = { /** * @param data * A wrapped object containing raw PDU data. @@ -1915,7 +1915,7 @@ this.WellKnownCharset = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.24 */ -this.ContentTypeValue = { +let ContentTypeValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -2103,7 +2103,7 @@ this.ContentTypeValue = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.54 */ -this.ApplicationIdValue = { +let ApplicationIdValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -2139,7 +2139,7 @@ this.ApplicationIdValue = { }, }; -this.PduHelper = { +let PduHelper = { /** * Parse multiple header fields with end mark. * @@ -2380,7 +2380,7 @@ this.PduHelper = { // Deprecated items should only be supported for backward compatibility // purpose. // @see WAP-230-WSP-20010705-a Appendix A. Assigned Numbers. -this.WSP_HEADER_FIELDS = (function () { +const WSP_HEADER_FIELDS = (function () { let names = {}; function add(name, number, coder) { let entry = { @@ -2476,7 +2476,7 @@ this.WSP_HEADER_FIELDS = (function () { // WSP Content Type Assignments // @see http://www.wapforum.org/wina -this.WSP_WELL_KNOWN_CONTENT_TYPES = (function () { +const WSP_WELL_KNOWN_CONTENT_TYPES = (function () { let types = {}; function add(type, number) { @@ -2504,7 +2504,7 @@ this.WSP_WELL_KNOWN_CONTENT_TYPES = (function () { // Note: Items commented out are either deprecated or not implemented. // Deprecated items should not be used. // @see WAP-230-WSP-20010705-a Appendix A. Assigned Numbers. -this.WSP_WELL_KNOWN_PARAMS = (function () { +const WSP_WELL_KNOWN_PARAMS = (function () { let params = {}; function add(name, number, coder) { @@ -2559,7 +2559,7 @@ this.WSP_WELL_KNOWN_PARAMS = (function () { // WSP Character Set Assignments // @see WAP-230-WSP-20010705-a Appendix A. Assigned Numbers. // @see http://www.iana.org/assignments/character-sets -this.WSP_WELL_KNOWN_CHARSETS = (function () { +const WSP_WELL_KNOWN_CHARSETS = (function () { let charsets = {}; function add(name, number, converter) { @@ -2582,7 +2582,7 @@ this.WSP_WELL_KNOWN_CHARSETS = (function () { // OMNA PUSH Application ID // @see http://www.openmobilealliance.org/tech/omna/omna-push-app-id.aspx -this.OMNA_PUSH_APPLICATION_IDS = (function () { +const OMNA_PUSH_APPLICATION_IDS = (function () { let ids = {}; function add(urn, number) { @@ -2608,7 +2608,7 @@ if (DEBUG) { debug = function (s) {}; } -this.EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS.concat([ +const EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS.concat([ // Constant values "WSP_HEADER_FIELDS", "WSP_WELL_KNOWN_CONTENT_TYPES", @@ -2663,3 +2663,4 @@ this.EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS.concat([ // Parser "PduHelper", ]); + diff --git a/dom/mms/src/ril/mms_consts.js b/dom/mms/src/ril/mms_consts.js index 6f2d2937fb0..1ee179e8b41 100644 --- a/dom/mms/src/ril/mms_consts.js +++ b/dom/mms/src/ril/mms_consts.js @@ -4,99 +4,98 @@ // Encoded X-Mms-Message-Type values // @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.30 -this.MMS_PDU_TYPE_SEND_REQ = 128; -this.MMS_PDU_TYPE_SEND_CONF = 129; -this.MMS_PDU_TYPE_NOTIFICATION_IND = 130; -this.MMS_PDU_TYPE_NOTIFYRESP_IND = 131; -this.MMS_PDU_TYPE_RETRIEVE_CONF = 132; -this.MMS_PDU_TYPE_ACKNOWLEDGE_IND = 133; -this.MMS_PDU_TYPE_DELIVERY_IND = 134; -this.MMS_PDU_TYPE_READ_REC_IND = 135; -this.MMS_PDU_TYPE_READ_ORIG_IND = 136; -this.MMS_PDU_TYPE_FORWARD_REQ = 137; -this.MMS_PDU_TYPE_FORWARD_CONF = 138; -this.MMS_PDU_TYPE_MBOX_STORE_REQ = 139; -this.MMS_PDU_TYPE_MBOX_STORE_CONF = 140; -this.MMS_PDU_TYPE_MBOX_VIEW_REQ = 141; -this.MMS_PDU_TYPE_MBOX_VIEW_CONF = 142; -this.MMS_PDU_TYPE_MBOX_UPLOAD_REQ = 143; -this.MMS_PDU_TYPE_MBOX_UPLOAD_CONF = 144; -this.MMS_PDU_TYPE_MBOX_DELETE_REQ = 145; -this.MMS_PDU_TYPE_MBOX_DELETE_CONF = 146; -this.MMS_PDU_TYPE_MBOX_DESCR = 147; -this.MMS_PDU_TYPE_DELETE_REQ = 148; -this.MMS_PDU_TYPE_DELETE_CONF = 149; -this.MMS_PDU_TYPE_CANCEL_REQ = 150; -this.MMS_PDU_TYPE_CANCEL_CONF = 151; +const MMS_PDU_TYPE_SEND_REQ = 128; +const MMS_PDU_TYPE_SEND_CONF = 129; +const MMS_PDU_TYPE_NOTIFICATION_IND = 130; +const MMS_PDU_TYPE_NOTIFYRESP_IND = 131; +const MMS_PDU_TYPE_RETRIEVE_CONF = 132; +const MMS_PDU_TYPE_ACKNOWLEDGE_IND = 133; +const MMS_PDU_TYPE_DELIVERY_IND = 134; +const MMS_PDU_TYPE_READ_REC_IND = 135; +const MMS_PDU_TYPE_READ_ORIG_IND = 136; +const MMS_PDU_TYPE_FORWARD_REQ = 137; +const MMS_PDU_TYPE_FORWARD_CONF = 138; +const MMS_PDU_TYPE_MBOX_STORE_REQ = 139; +const MMS_PDU_TYPE_MBOX_STORE_CONF = 140; +const MMS_PDU_TYPE_MBOX_VIEW_REQ = 141; +const MMS_PDU_TYPE_MBOX_VIEW_CONF = 142; +const MMS_PDU_TYPE_MBOX_UPLOAD_REQ = 143; +const MMS_PDU_TYPE_MBOX_UPLOAD_CONF = 144; +const MMS_PDU_TYPE_MBOX_DELETE_REQ = 145; +const MMS_PDU_TYPE_MBOX_DELETE_CONF = 146; +const MMS_PDU_TYPE_MBOX_DESCR = 147; +const MMS_PDU_TYPE_DELETE_REQ = 148; +const MMS_PDU_TYPE_DELETE_CONF = 149; +const MMS_PDU_TYPE_CANCEL_REQ = 150; +const MMS_PDU_TYPE_CANCEL_CONF = 151; // MMS version 1.3 // @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.34 -this.MMS_VERSION = (0x01 << 4) | 0x03; +const MMS_VERSION = (0x01 << 4) | 0x03; // Common Status Values -this.MMS_PDU_ERROR_OK = 128; -this.MMS_PDU_ERROR_TRANSIENT_FAILURE = 192; -this.MMS_PDU_ERROR_PERMANENT_FAILURE = 224; +const MMS_PDU_ERROR_OK = 128; +const MMS_PDU_ERROR_TRANSIENT_FAILURE = 192; +const MMS_PDU_ERROR_PERMANENT_FAILURE = 224; // X-Mms-Response-Status values // @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.48 // @see OMA-TS-MMS_ENC-V1_3-20110913-A Table 28, 29, 30 -//this.MMS_PDU_RESPONSE_ERROR_UNSPECIFIED = 129; (obsolete) -//this.MMS_PDU_RESPONSE_ERROR_SERVICE_DENIED = 130; (obsolete) -//this.MMS_PDU_RESPONSE_ERROR_MESSAGE_FORMAT_CORRUPT = 131; (obsolete) -//this.MMS_PDU_RESPONSE_ERROR_SENDING_ADDRESS_UNRESOLVED = 132; (obsolete) -//this.MMS_PDU_RESPONSE_ERROR_MESSAGE_NOT_FOUND = 133; (obsolete) -//this.MMS_PDU_RESPONSE_ERROR_NETWORK_PROBLEM = 134; (obsolete) -//this.MMS_PDU_RESPONSE_ERROR_CONTENT_NOT_ACCEPTED = 135; (obsolete) -this.MMS_PDU_RESPONSE_ERROR_UNSUPPORTED_MESSAGE = 136; -this.MMS_PDU_RESPONSE_ERROR_TRANSIENT_SENDING_ADDRESS_UNRESOLVED = 193; -this.MMS_PDU_RESPONSE_ERROR_TRANSIENT_MESSAGE_NOT_FOUND = 194; -this.MMS_PDU_RESPONSE_ERROR_TRANSIENT_NETWORK_PROBLEM = 195; -this.MMS_PDU_RESPONSE_ERROR_TRANSIENT_PARTIAL_SUCCESS = 196; -this.MMS_PDU_RESPONSE_ERROR_PERMANENT_SERVICE_DENIED = 225; -this.MMS_PDU_RESPONSE_ERROR_PERMANENT_MESSAGE_FORMAT_CORRUPT = 226; -this.MMS_PDU_RESPONSE_ERROR_PERMANENT_SENDING_ADDRESS_UNRESOLVED = 227; -this.MMS_PDU_RESPONSE_ERROR_PERMANENT_MESSAGE_NOT_FOUND = 228; -this.MMS_PDU_RESPONSE_ERROR_PERMANENT_CONTENT_NOT_ACCEPTED = 229; -this.MMS_PDU_RESPONSE_ERROR_PERMANENT_REPLY_CHARGING_LIMITATIONS_NOT_MET = 230; -this.MMS_PDU_RESPONSE_ERROR_PERMANENT_REPLY_CHARGING_REQUEST_NOT_ACCEPTED = 231; -this.MMS_PDU_RESPONSE_ERROR_PERMANENT_REPLY_CHARGING_FORWARDING_DENIED = 232; -this.MMS_PDU_RESPONSE_ERROR_PERMANENT_REPLY_CHARGING_NOT_SUPPORTED = 233; -this.MMS_PDU_RESPONSE_ERROR_PERMANENT_ADDRESS_HIDING_NOT_SUPPORTED = 234; -this.MMS_PDU_RESPONSE_ERROR_PERMANENT_LACK_OF_PREPAID = 235; +//const MMS_PDU_RESPONSE_ERROR_UNSPECIFIED = 129; (obsolete) +//const MMS_PDU_RESPONSE_ERROR_SERVICE_DENIED = 130; (obsolete) +//const MMS_PDU_RESPONSE_ERROR_MESSAGE_FORMAT_CORRUPT = 131; (obsolete) +//const MMS_PDU_RESPONSE_ERROR_SENDING_ADDRESS_UNRESOLVED = 132; (obsolete) +//const MMS_PDU_RESPONSE_ERROR_MESSAGE_NOT_FOUND = 133; (obsolete) +//const MMS_PDU_RESPONSE_ERROR_NETWORK_PROBLEM = 134; (obsolete) +//const MMS_PDU_RESPONSE_ERROR_CONTENT_NOT_ACCEPTED = 135; (obsolete) +const MMS_PDU_RESPONSE_ERROR_UNSUPPORTED_MESSAGE = 136; +const MMS_PDU_RESPONSE_ERROR_TRANSIENT_SENDING_ADDRESS_UNRESOLVED = 193; +const MMS_PDU_RESPONSE_ERROR_TRANSIENT_MESSAGE_NOT_FOUND = 194; +const MMS_PDU_RESPONSE_ERROR_TRANSIENT_NETWORK_PROBLEM = 195; +const MMS_PDU_RESPONSE_ERROR_TRANSIENT_PARTIAL_SUCCESS = 196; +const MMS_PDU_RESPONSE_ERROR_PERMANENT_SERVICE_DENIED = 225; +const MMS_PDU_RESPONSE_ERROR_PERMANENT_MESSAGE_FORMAT_CORRUPT = 226; +const MMS_PDU_RESPONSE_ERROR_PERMANENT_SENDING_ADDRESS_UNRESOLVED = 227; +const MMS_PDU_RESPONSE_ERROR_PERMANENT_MESSAGE_NOT_FOUND = 228; +const MMS_PDU_RESPONSE_ERROR_PERMANENT_CONTENT_NOT_ACCEPTED = 229; +const MMS_PDU_RESPONSE_ERROR_PERMANENT_REPLY_CHARGING_LIMITATIONS_NOT_MET = 230; +const MMS_PDU_RESPONSE_ERROR_PERMANENT_REPLY_CHARGING_REQUEST_NOT_ACCEPTED = 231; +const MMS_PDU_RESPONSE_ERROR_PERMANENT_REPLY_CHARGING_FORWARDING_DENIED = 232; +const MMS_PDU_RESPONSE_ERROR_PERMANENT_REPLY_CHARGING_NOT_SUPPORTED = 233; +const MMS_PDU_RESPONSE_ERROR_PERMANENT_ADDRESS_HIDING_NOT_SUPPORTED = 234; +const MMS_PDU_RESPONSE_ERROR_PERMANENT_LACK_OF_PREPAID = 235; // X-Mms-Retrieve-Status values // @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.50 // @see OMA-TS-MMS_ENC-V1_3-20110913-A Table 31 -this.MMS_PDU_RETRIEVE_ERROR_TRANSIENT_MESSAGE_NOT_FOUND = 193; -this.MMS_PDU_RETRIEVE_ERROR_TRANSIENT_NETWORK_PROBLEM = 194; -this.MMS_PDU_RETRIEVE_ERROR_PERMANENT_SERVICE_DENIED = 225; -this.MMS_PDU_RETRIEVE_ERROR_PERMANENT_MESSAGE_NOT_FOUND = 226; -this.MMS_PDU_RETRIEVE_ERROR_PERMANENT_CONTENT_UNSUPPORTED = 227; +const MMS_PDU_RETRIEVE_ERROR_TRANSIENT_MESSAGE_NOT_FOUND = 193; +const MMS_PDU_RETRIEVE_ERROR_TRANSIENT_NETWORK_PROBLEM = 194; +const MMS_PDU_RETRIEVE_ERROR_PERMANENT_SERVICE_DENIED = 225; +const MMS_PDU_RETRIEVE_ERROR_PERMANENT_MESSAGE_NOT_FOUND = 226; +const MMS_PDU_RETRIEVE_ERROR_PERMANENT_CONTENT_UNSUPPORTED = 227; // X-Mms-Store-Status values // @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.58 // @see OMA-TS-MMS_ENC-V1_3-20110913-A Table 35 -this.MMS_PDU_STORE_ERROR_TRANSIENT_NETWORK_PROBLEM = 193; -this.MMS_PDU_STORE_ERROR_PERMANENT_SERVICE_DENIED = 225; -this.MMS_PDU_STORE_ERROR_PERMANENT_MESSAGE_FORMAT_CORRUPT = 226; -this.MMS_PDU_STORE_ERROR_PERMANENT_MESSAGE_NOT_FOUND = 227; -this.MMS_PDU_STORE_ERROR_PERMANENT_MMBOX_FULL = 228; +const MMS_PDU_STORE_ERROR_TRANSIENT_NETWORK_PROBLEM = 193; +const MMS_PDU_STORE_ERROR_PERMANENT_SERVICE_DENIED = 225; +const MMS_PDU_STORE_ERROR_PERMANENT_MESSAGE_FORMAT_CORRUPT = 226; +const MMS_PDU_STORE_ERROR_PERMANENT_MESSAGE_NOT_FOUND = 227; +const MMS_PDU_STORE_ERROR_PERMANENT_MMBOX_FULL = 228; // X-Mms-Status values // @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.54 -this.MMS_PDU_STATUS_EXPIRED = 128; -this.MMS_PDU_STATUS_RETRIEVED = 129; -this.MMS_PDU_STATUS_REJECTED = 130; -this.MMS_PDU_STATUS_DEFERRED = 131; -this.MMS_PDU_STATUS_UNRECOGNISED = 132; -this.MMS_PDU_STATUS_INDETERMINATE = 133; -this.MMS_PDU_STATUS_FORWARDED = 134; -this.MMS_PDU_STATUS_UNREACHABLE = 135; +const MMS_PDU_STATUS_EXPIRED = 128; +const MMS_PDU_STATUS_RETRIEVED = 129; +const MMS_PDU_STATUS_REJECTED = 130; +const MMS_PDU_STATUS_DEFERRED = 131; +const MMS_PDU_STATUS_UNRECOGNISED = 132; +const MMS_PDU_STATUS_INDETERMINATE = 133; +const MMS_PDU_STATUS_FORWARDED = 134; +const MMS_PDU_STATUS_UNREACHABLE = 135; -this.ALL_CONST_SYMBOLS = undefined; // We want ALL_CONST_SYMBOLS to be exported. -this.ALL_CONST_SYMBOLS = Object.keys(this); +const ALL_CONST_SYMBOLS = Object.keys(this); // Allow this file to be imported via Components.utils.import(). -this.EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS; +const EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS; diff --git a/dom/mms/src/ril/wap_consts.js b/dom/mms/src/ril/wap_consts.js index c376d9fb668..322d0f370e5 100644 --- a/dom/mms/src/ril/wap_consts.js +++ b/dom/mms/src/ril/wap_consts.js @@ -6,17 +6,17 @@ // WSP PDU Type Assignments // @see WAP-230-WSP-20010705-a Appendix A. Assigned Numbers. -this.WSP_PDU_TYPE_PUSH = 0x06; +const WSP_PDU_TYPE_PUSH = 0x06; // Registered WDP Port Numbers // @see WAP-259-WDP-20010614-a Appendix B. Port Number Definitions. -this.WDP_PORT_PUSH = 2948; +const WDP_PORT_PUSH = 2948; // Bearer Type Assignments // @see WAP-259-WDP-20010614-a Appendix C. Network Bearer Table. -this.WDP_BEARER_GSM_SMS_GSM_MSISDN = 0x03; +const WDP_BEARER_GSM_SMS_GSM_MSISDN = 0x03; -this.ALL_CONST_SYMBOLS = undefined; // We want ALL_CONST_SYMBOLS to be exported. -this.ALL_CONST_SYMBOLS = Object.keys(this); +const ALL_CONST_SYMBOLS = Object.keys(this); + +const EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS; -this.EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS; diff --git a/dom/network/src/NetworkStatsDB.jsm b/dom/network/src/NetworkStatsDB.jsm index 111732bbb3c..bcfa70df7a4 100644 --- a/dom/network/src/NetworkStatsDB.jsm +++ b/dom/network/src/NetworkStatsDB.jsm @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ['NetworkStatsDB']; +const EXPORTED_SYMBOLS = ['NetworkStatsDB']; const DEBUG = false; function debug(s) { dump("-*- NetworkStatsDB: " + s + "\n"); } @@ -25,7 +25,7 @@ const VALUES_MAX_LENGTH = 6 * 30; // Constant defining the rate of the samples. Daily. const SAMPLE_RATE = 1000 * 60 * 60 * 24; -this.NetworkStatsDB = function NetworkStatsDB(aGlobal) { +function NetworkStatsDB(aGlobal) { if (DEBUG) { debug("Constructor"); } diff --git a/dom/network/src/NetworkStatsManager.js b/dom/network/src/NetworkStatsManager.js index 8266bc2bc12..75d4a8788ca 100644 --- a/dom/network/src/NetworkStatsManager.js +++ b/dom/network/src/NetworkStatsManager.js @@ -233,6 +233,6 @@ NetworkStatsManager.prototype = { flags: nsIClassInfo.DOM_OBJECT}) } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([NetworkStatsData, - NetworkStats, - NetworkStatsManager]) +const NSGetFactory = XPCOMUtils.generateNSGetFactory([NetworkStatsData, + NetworkStats, + NetworkStatsManager]) diff --git a/dom/network/src/NetworkStatsService.jsm b/dom/network/src/NetworkStatsService.jsm index f13a7effb71..4b3ef3071c2 100644 --- a/dom/network/src/NetworkStatsService.jsm +++ b/dom/network/src/NetworkStatsService.jsm @@ -9,7 +9,7 @@ function debug(s) { dump("-*- NetworkStatsService: " + s + "\n"); } const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; -this.EXPORTED_SYMBOLS = ["NetworkStatsService"]; +let EXPORTED_SYMBOLS = ["NetworkStatsService"]; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); @@ -36,7 +36,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "networkManager", let myGlobal = this; -this.NetworkStatsService = { +let NetworkStatsService = { init: function() { if (DEBUG) { debug("Service started"); diff --git a/dom/network/src/TCPSocket.js b/dom/network/src/TCPSocket.js index b19cec9a4a6..74587bf5ef8 100644 --- a/dom/network/src/TCPSocket.js +++ b/dom/network/src/TCPSocket.js @@ -634,4 +634,4 @@ SecurityCallbacks.prototype = { }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TCPSocket]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([TCPSocket]); diff --git a/dom/network/src/TCPSocketParentIntermediary.js b/dom/network/src/TCPSocketParentIntermediary.js index 1b1712ac849..b70034abaf8 100644 --- a/dom/network/src/TCPSocketParentIntermediary.js +++ b/dom/network/src/TCPSocketParentIntermediary.js @@ -52,4 +52,4 @@ TCPSocketParentIntermediary.prototype = { ]) }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TCPSocketParentIntermediary]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([TCPSocketParentIntermediary]); diff --git a/dom/payment/Payment.js b/dom/payment/Payment.js index 24ad05b6d16..ba8da152837 100644 --- a/dom/payment/Payment.js +++ b/dom/payment/Payment.js @@ -104,4 +104,4 @@ PaymentContentHelper.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PaymentContentHelper]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([PaymentContentHelper]); diff --git a/dom/payment/Payment.jsm b/dom/payment/Payment.jsm index 2f37b9c4098..0b760fbc9cb 100644 --- a/dom/payment/Payment.jsm +++ b/dom/payment/Payment.jsm @@ -9,7 +9,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); -this.EXPORTED_SYMBOLS = []; +let EXPORTED_SYMBOLS = []; const PAYMENT_IPC_MSG_NAMES = ["Payment:Pay", "Payment:Success", diff --git a/dom/payment/PaymentFlowInfo.js b/dom/payment/PaymentFlowInfo.js index 4596891adda..175edceccb9 100644 --- a/dom/payment/PaymentFlowInfo.js +++ b/dom/payment/PaymentFlowInfo.js @@ -19,4 +19,4 @@ PaymentFlowInfo.prototype = { requestMethod: null }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PaymentFlowInfo]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([PaymentFlowInfo]); diff --git a/dom/payment/PaymentRequestInfo.js b/dom/payment/PaymentRequestInfo.js index e824839bb92..acf99bf4403 100644 --- a/dom/payment/PaymentRequestInfo.js +++ b/dom/payment/PaymentRequestInfo.js @@ -126,7 +126,7 @@ PaymentRequestRefundInfo.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ +const NSGetFactory = XPCOMUtils.generateNSGetFactory([ PaymentProductPrice, PaymentRequestInfo, PaymentRequestPaymentInfo, diff --git a/dom/permission/PermissionPromptHelper.jsm b/dom/permission/PermissionPromptHelper.jsm index f7e343a924d..5fa7e95ee7f 100644 --- a/dom/permission/PermissionPromptHelper.jsm +++ b/dom/permission/PermissionPromptHelper.jsm @@ -20,7 +20,6 @@ "use strict"; let DEBUG = 0; -let debug; if (DEBUG) debug = function (s) { dump("-*- Permission Prompt Helper component: " + s + "\n"); } else @@ -30,7 +29,7 @@ const Cu = Components.utils; const Cc = Components.classes; const Ci = Components.interfaces; -this.EXPORTED_SYMBOLS = ["PermissionPromptHelper"]; +let EXPORTED_SYMBOLS = ["PermissionPromptHelper"]; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); @@ -48,7 +47,7 @@ var permissionManager = Cc["@mozilla.org/permissionmanager;1"].getService(Ci.nsI var secMan = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(Ci.nsIScriptSecurityManager); var appsService = Cc["@mozilla.org/AppsService;1"].getService(Ci.nsIAppsService); -this.PermissionPromptHelper = { +let PermissionPromptHelper = { init: function() { debug("Init"); ppmm.addMessageListener("PermissionPromptHelper:AskPermission", this); diff --git a/dom/permission/PermissionSettings.js b/dom/permission/PermissionSettings.js index 27239e8dc15..29a3d4f64db 100644 --- a/dom/permission/PermissionSettings.js +++ b/dom/permission/PermissionSettings.js @@ -102,4 +102,4 @@ PermissionSettings.prototype = { flags: Ci.nsIClassInfo.DOM_OBJECT}) } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PermissionSettings]) +const NSGetFactory = XPCOMUtils.generateNSGetFactory([PermissionSettings]) diff --git a/dom/permission/PermissionSettings.jsm b/dom/permission/PermissionSettings.jsm index f62a9e795f9..15c288b22c0 100644 --- a/dom/permission/PermissionSettings.jsm +++ b/dom/permission/PermissionSettings.jsm @@ -12,7 +12,7 @@ const Cu = Components.utils; const Cc = Components.classes; const Ci = Components.interfaces; -this.EXPORTED_SYMBOLS = ["PermissionSettingsModule"]; +let EXPORTED_SYMBOLS = ["PermissionSettingsModule"]; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); @@ -36,7 +36,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "@mozilla.org/AppsService;1", "nsIAppsService"); -this.PermissionSettingsModule = { +let PermissionSettingsModule = { init: function() { debug("Init"); ppmm.addMessageListener("PermissionSettings:AddPermission", this); diff --git a/dom/settings/SettingsChangeNotifier.jsm b/dom/settings/SettingsChangeNotifier.jsm index c4b99de5b3c..7062070279c 100644 --- a/dom/settings/SettingsChangeNotifier.jsm +++ b/dom/settings/SettingsChangeNotifier.jsm @@ -12,7 +12,7 @@ const Cu = Components.utils; const Cc = Components.classes; const Ci = Components.interfaces; -this.EXPORTED_SYMBOLS = ["SettingsChangeNotifier"]; +let EXPORTED_SYMBOLS = ["SettingsChangeNotifier"]; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); @@ -25,7 +25,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "ppmm", "@mozilla.org/parentprocessmessagemanager;1", "nsIMessageBroadcaster"); -this.SettingsChangeNotifier = { +let SettingsChangeNotifier = { init: function() { debug("init"); this.children = []; diff --git a/dom/settings/SettingsDB.jsm b/dom/settings/SettingsDB.jsm index 441b624d4c6..fd6f3b7e7c0 100644 --- a/dom/settings/SettingsDB.jsm +++ b/dom/settings/SettingsDB.jsm @@ -6,21 +6,21 @@ let Cc = Components.classes; let Ci = Components.interfaces; let Cu = Components.utils; -this.EXPORTED_SYMBOLS = ["SettingsDB", "SETTINGSDB_NAME", "SETTINGSSTORE_NAME"]; +let EXPORTED_SYMBOLS = ["SettingsDB", "SETTINGSDB_NAME", "SETTINGSSTORE_NAME"]; function debug(s) { //dump("-*- SettingsDB: " + s + "\n"); } -this.SETTINGSDB_NAME = "settings"; -this.SETTINGSDB_VERSION = 1; -this.SETTINGSSTORE_NAME = "settings"; +const SETTINGSDB_NAME = "settings"; +const SETTINGSDB_VERSION = 1; +const SETTINGSSTORE_NAME = "settings"; Cu.import("resource://gre/modules/IndexedDBHelper.jsm"); Cu.import("resource://gre/modules/FileUtils.jsm"); Cu.import("resource://gre/modules/NetUtil.jsm"); -this.SettingsDB = function SettingsDB() {} +function SettingsDB() {} SettingsDB.prototype = { diff --git a/dom/settings/SettingsManager.js b/dom/settings/SettingsManager.js index 081eee0bdc1..797f1b08b3b 100644 --- a/dom/settings/SettingsManager.js +++ b/dom/settings/SettingsManager.js @@ -365,4 +365,4 @@ SettingsManager.prototype = { flags: nsIClassInfo.DOM_OBJECT}) } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SettingsManager, SettingsLock]) +const NSGetFactory = XPCOMUtils.generateNSGetFactory([SettingsManager, SettingsLock]) diff --git a/dom/settings/SettingsQueue.jsm b/dom/settings/SettingsQueue.jsm index 746d3370aaf..6f8bb9c791a 100644 --- a/dom/settings/SettingsQueue.jsm +++ b/dom/settings/SettingsQueue.jsm @@ -2,9 +2,9 @@ * 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 = ["Queue"]; +let EXPORTED_SYMBOLS = ["Queue"]; -this.Queue = function Queue() { +function Queue() { this._queue = []; this._index = 0; } diff --git a/dom/settings/SettingsService.js b/dom/settings/SettingsService.js index ff23624188b..6eba91f08e4 100644 --- a/dom/settings/SettingsService.js +++ b/dom/settings/SettingsService.js @@ -6,7 +6,6 @@ /* static functions */ let DEBUG = 0; -let debug; if (DEBUG) debug = function (s) { dump("-*- SettingsService: " + s + "\n"); } else @@ -183,4 +182,4 @@ SettingsService.prototype = { QueryInterface : XPCOMUtils.generateQI([Ci.nsISettingsService]), } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SettingsService, SettingsServiceLock]) +const NSGetFactory = XPCOMUtils.generateNSGetFactory([SettingsService, SettingsServiceLock]) diff --git a/dom/sms/src/ril/SmsDatabaseService.js b/dom/sms/src/ril/SmsDatabaseService.js index ea76f211a3a..a52883b08e3 100644 --- a/dom/sms/src/ril/SmsDatabaseService.js +++ b/dom/sms/src/ril/SmsDatabaseService.js @@ -783,7 +783,7 @@ XPCOMUtils.defineLazyGetter(SmsDatabaseService.prototype, "mRIL", function () { .getInterface(Ci.nsIRadioInterfaceLayer); }); -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SmsDatabaseService]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([SmsDatabaseService]); function debug() { dump("SmsDatabaseService: " + Array.slice(arguments).join(" ") + "\n"); diff --git a/dom/system/GPSDGeolocationProvider.js b/dom/system/GPSDGeolocationProvider.js index 09b3866b91d..f89eee7a6ae 100644 --- a/dom/system/GPSDGeolocationProvider.js +++ b/dom/system/GPSDGeolocationProvider.js @@ -201,4 +201,4 @@ GPSDProvider.prototype = { }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([GPSDProvider]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([GPSDProvider]); diff --git a/dom/system/NetworkGeolocationProvider.js b/dom/system/NetworkGeolocationProvider.js index 8d260c5b955..278ff1d6a96 100755 --- a/dom/system/NetworkGeolocationProvider.js +++ b/dom/system/NetworkGeolocationProvider.js @@ -288,4 +288,4 @@ WifiGeoPositionProvider.prototype = { }, }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WifiGeoPositionProvider]); +let NSGetFactory = XPCOMUtils.generateNSGetFactory([WifiGeoPositionProvider]); diff --git a/dom/system/gonk/NetworkManager.js b/dom/system/gonk/NetworkManager.js index 44036249b90..a5e78691d54 100644 --- a/dom/system/gonk/NetworkManager.js +++ b/dom/system/gonk/NetworkManager.js @@ -773,7 +773,7 @@ NetworkManager.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([NetworkManager]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([NetworkManager]); let debug; diff --git a/dom/system/gonk/RILContentHelper.js b/dom/system/gonk/RILContentHelper.js index 040727106d3..e282e6bda12 100644 --- a/dom/system/gonk/RILContentHelper.js +++ b/dom/system/gonk/RILContentHelper.js @@ -883,7 +883,7 @@ RILContentHelper.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RILContentHelper]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([RILContentHelper]); let debug; if (DEBUG) { diff --git a/dom/system/gonk/RadioInterfaceLayer.js b/dom/system/gonk/RadioInterfaceLayer.js index 4a44313d016..470621b2154 100644 --- a/dom/system/gonk/RadioInterfaceLayer.js +++ b/dom/system/gonk/RadioInterfaceLayer.js @@ -2578,7 +2578,7 @@ RILNetworkInterface.prototype = { }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RadioInterfaceLayer]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([RadioInterfaceLayer]); let debug; if (DEBUG) { diff --git a/dom/system/gonk/ril_consts.js b/dom/system/gonk/ril_consts.js index a976cc6e98e..68d8d2b6610 100644 --- a/dom/system/gonk/ril_consts.js +++ b/dom/system/gonk/ril_consts.js @@ -14,226 +14,226 @@ */ // Set to true to debug all RIL layers -this.DEBUG_ALL = false; +const DEBUG_ALL = false; // Set individually to debug specific layers -this.DEBUG_WORKER = false || DEBUG_ALL; -this.DEBUG_CONTENT_HELPER = false || DEBUG_ALL; -this.DEBUG_RIL = false || DEBUG_ALL; +const DEBUG_WORKER = false || DEBUG_ALL; +const DEBUG_CONTENT_HELPER = false || DEBUG_ALL; +const DEBUG_RIL = false || DEBUG_ALL; -this.REQUEST_GET_SIM_STATUS = 1; -this.REQUEST_ENTER_SIM_PIN = 2; -this.REQUEST_ENTER_SIM_PUK = 3; -this.REQUEST_ENTER_SIM_PIN2 = 4; -this.REQUEST_ENTER_SIM_PUK2 = 5; -this.REQUEST_CHANGE_SIM_PIN = 6; -this.REQUEST_CHANGE_SIM_PIN2 = 7; -this.REQUEST_ENTER_NETWORK_DEPERSONALIZATION_CODE = 8; -this.REQUEST_GET_CURRENT_CALLS = 9; -this.REQUEST_DIAL = 10; -this.REQUEST_GET_IMSI = 11; -this.REQUEST_HANGUP = 12; -this.REQUEST_HANGUP_WAITING_OR_BACKGROUND = 13; -this.REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND = 14; -this.REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE = 15; -this.REQUEST_SWITCH_HOLDING_AND_ACTIVE = 15; -this.REQUEST_CONFERENCE = 16; -this.REQUEST_UDUB = 17; -this.REQUEST_LAST_CALL_FAIL_CAUSE = 18; -this.REQUEST_SIGNAL_STRENGTH = 19; -this.REQUEST_VOICE_REGISTRATION_STATE = 20; -this.REQUEST_DATA_REGISTRATION_STATE = 21; -this.REQUEST_OPERATOR = 22; -this.REQUEST_RADIO_POWER = 23; -this.REQUEST_DTMF = 24; -this.REQUEST_SEND_SMS = 25; -this.REQUEST_SEND_SMS_EXPECT_MORE = 26; -this.REQUEST_SETUP_DATA_CALL = 27; -this.REQUEST_SIM_IO = 28; -this.REQUEST_SEND_USSD = 29; -this.REQUEST_CANCEL_USSD = 30; -this.REQUEST_GET_CLIR = 31; -this.REQUEST_SET_CLIR = 32; -this.REQUEST_QUERY_CALL_FORWARD_STATUS = 33; -this.REQUEST_SET_CALL_FORWARD = 34; -this.REQUEST_QUERY_CALL_WAITING = 35; -this.REQUEST_SET_CALL_WAITING = 36; -this.REQUEST_SMS_ACKNOWLEDGE = 37; -this.REQUEST_GET_IMEI = 38; -this.REQUEST_GET_IMEISV = 39; -this.REQUEST_ANSWER = 40; -this.REQUEST_DEACTIVATE_DATA_CALL = 41; -this.REQUEST_QUERY_FACILITY_LOCK = 42; -this.REQUEST_SET_FACILITY_LOCK = 43; -this.REQUEST_CHANGE_BARRING_PASSWORD = 44; -this.REQUEST_QUERY_NETWORK_SELECTION_MODE = 45; -this.REQUEST_SET_NETWORK_SELECTION_AUTOMATIC = 46; -this.REQUEST_SET_NETWORK_SELECTION_MANUAL = 47; -this.REQUEST_QUERY_AVAILABLE_NETWORKS = 48; -this.REQUEST_DTMF_START = 49; -this.REQUEST_DTMF_STOP = 50; -this.REQUEST_BASEBAND_VERSION = 51; -this.REQUEST_SEPARATE_CONNECTION = 52; -this.REQUEST_SET_MUTE = 53; -this.REQUEST_GET_MUTE = 54; -this.REQUEST_QUERY_CLIP = 55; -this.REQUEST_LAST_DATA_CALL_FAIL_CAUSE = 56; -this.REQUEST_DATA_CALL_LIST = 57; -this.REQUEST_RESET_RADIO = 58; -this.REQUEST_OEM_HOOK_RAW = 59; -this.REQUEST_OEM_HOOK_STRINGS = 60; -this.REQUEST_SCREEN_STATE = 61; -this.REQUEST_SET_SUPP_SVC_NOTIFICATION = 62; -this.REQUEST_WRITE_SMS_TO_SIM = 63; -this.REQUEST_DELETE_SMS_ON_SIM = 64; -this.REQUEST_SET_BAND_MODE = 65; -this.REQUEST_QUERY_AVAILABLE_BAND_MODE = 66; -this.REQUEST_STK_GET_PROFILE = 67; -this.REQUEST_STK_SET_PROFILE = 68; -this.REQUEST_STK_SEND_ENVELOPE_COMMAND = 69; -this.REQUEST_STK_SEND_TERMINAL_RESPONSE = 70; -this.REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM = 71; -this.REQUEST_EXPLICIT_CALL_TRANSFER = 72; -this.REQUEST_SET_PREFERRED_NETWORK_TYPE = 73; -this.REQUEST_GET_PREFERRED_NETWORK_TYPE = 74; -this.REQUEST_GET_NEIGHBORING_CELL_IDS = 75; -this.REQUEST_SET_LOCATION_UPDATES = 76; -this.REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE = 77; -this.REQUEST_CDMA_SET_ROAMING_PREFERENCE = 78; -this.REQUEST_CDMA_QUERY_ROAMING_PREFERENCE = 79; -this.REQUEST_SET_TTY_MODE = 80; -this.REQUEST_QUERY_TTY_MODE = 81; -this.REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE = 82; -this.REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE = 83; -this.REQUEST_CDMA_FLASH = 84; -this.REQUEST_CDMA_BURST_DTMF = 85; -this.REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY = 86; -this.REQUEST_CDMA_SEND_SMS = 87; -this.REQUEST_CDMA_SMS_ACKNOWLEDGE = 88; -this.REQUEST_GSM_GET_BROADCAST_SMS_CONFIG = 89; -this.REQUEST_GSM_SET_BROADCAST_SMS_CONFIG = 90; -this.REQUEST_GSM_SMS_BROADCAST_ACTIVATION = 91; -this.REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG = 92; -this.REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG = 93; -this.REQUEST_CDMA_SMS_BROADCAST_ACTIVATION = 94; -this.REQUEST_CDMA_SUBSCRIPTION = 95; -this.REQUEST_CDMA_WRITE_SMS_TO_RUIM = 96; -this.REQUEST_CDMA_DELETE_SMS_ON_RUIM = 97; -this.REQUEST_DEVICE_IDENTITY = 98; -this.REQUEST_EXIT_EMERGENCY_CALLBACK_MODE = 99; -this.REQUEST_GET_SMSC_ADDRESS = 100; -this.REQUEST_SET_SMSC_ADDRESS = 101; -this.REQUEST_REPORT_SMS_MEMORY_STATUS = 102; -this.REQUEST_REPORT_STK_SERVICE_IS_RUNNING = 103; -this.REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE = 104; -this.REQUEST_ISIM_AUTHENTICATION = 105; -this.REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU = 106; -this.REQUEST_STK_SEND_ENVELOPE_WITH_STATUS = 107; -this.REQUEST_DIAL_EMERGENCY_CALL = 10016; +const REQUEST_GET_SIM_STATUS = 1; +const REQUEST_ENTER_SIM_PIN = 2; +const REQUEST_ENTER_SIM_PUK = 3; +const REQUEST_ENTER_SIM_PIN2 = 4; +const REQUEST_ENTER_SIM_PUK2 = 5; +const REQUEST_CHANGE_SIM_PIN = 6; +const REQUEST_CHANGE_SIM_PIN2 = 7; +const REQUEST_ENTER_NETWORK_DEPERSONALIZATION_CODE = 8; +const REQUEST_GET_CURRENT_CALLS = 9; +const REQUEST_DIAL = 10; +const REQUEST_GET_IMSI = 11; +const REQUEST_HANGUP = 12; +const REQUEST_HANGUP_WAITING_OR_BACKGROUND = 13; +const REQUEST_HANGUP_FOREGROUND_RESUME_BACKGROUND = 14; +const REQUEST_SWITCH_WAITING_OR_HOLDING_AND_ACTIVE = 15; +const REQUEST_SWITCH_HOLDING_AND_ACTIVE = 15; +const REQUEST_CONFERENCE = 16; +const REQUEST_UDUB = 17; +const REQUEST_LAST_CALL_FAIL_CAUSE = 18; +const REQUEST_SIGNAL_STRENGTH = 19; +const REQUEST_VOICE_REGISTRATION_STATE = 20; +const REQUEST_DATA_REGISTRATION_STATE = 21; +const REQUEST_OPERATOR = 22; +const REQUEST_RADIO_POWER = 23; +const REQUEST_DTMF = 24; +const REQUEST_SEND_SMS = 25; +const REQUEST_SEND_SMS_EXPECT_MORE = 26; +const REQUEST_SETUP_DATA_CALL = 27; +const REQUEST_SIM_IO = 28; +const REQUEST_SEND_USSD = 29; +const REQUEST_CANCEL_USSD = 30; +const REQUEST_GET_CLIR = 31; +const REQUEST_SET_CLIR = 32; +const REQUEST_QUERY_CALL_FORWARD_STATUS = 33; +const REQUEST_SET_CALL_FORWARD = 34; +const REQUEST_QUERY_CALL_WAITING = 35; +const REQUEST_SET_CALL_WAITING = 36; +const REQUEST_SMS_ACKNOWLEDGE = 37; +const REQUEST_GET_IMEI = 38; +const REQUEST_GET_IMEISV = 39; +const REQUEST_ANSWER = 40; +const REQUEST_DEACTIVATE_DATA_CALL = 41; +const REQUEST_QUERY_FACILITY_LOCK = 42; +const REQUEST_SET_FACILITY_LOCK = 43; +const REQUEST_CHANGE_BARRING_PASSWORD = 44; +const REQUEST_QUERY_NETWORK_SELECTION_MODE = 45; +const REQUEST_SET_NETWORK_SELECTION_AUTOMATIC = 46; +const REQUEST_SET_NETWORK_SELECTION_MANUAL = 47; +const REQUEST_QUERY_AVAILABLE_NETWORKS = 48; +const REQUEST_DTMF_START = 49; +const REQUEST_DTMF_STOP = 50; +const REQUEST_BASEBAND_VERSION = 51; +const REQUEST_SEPARATE_CONNECTION = 52; +const REQUEST_SET_MUTE = 53; +const REQUEST_GET_MUTE = 54; +const REQUEST_QUERY_CLIP = 55; +const REQUEST_LAST_DATA_CALL_FAIL_CAUSE = 56; +const REQUEST_DATA_CALL_LIST = 57; +const REQUEST_RESET_RADIO = 58; +const REQUEST_OEM_HOOK_RAW = 59; +const REQUEST_OEM_HOOK_STRINGS = 60; +const REQUEST_SCREEN_STATE = 61; +const REQUEST_SET_SUPP_SVC_NOTIFICATION = 62; +const REQUEST_WRITE_SMS_TO_SIM = 63; +const REQUEST_DELETE_SMS_ON_SIM = 64; +const REQUEST_SET_BAND_MODE = 65; +const REQUEST_QUERY_AVAILABLE_BAND_MODE = 66; +const REQUEST_STK_GET_PROFILE = 67; +const REQUEST_STK_SET_PROFILE = 68; +const REQUEST_STK_SEND_ENVELOPE_COMMAND = 69; +const REQUEST_STK_SEND_TERMINAL_RESPONSE = 70; +const REQUEST_STK_HANDLE_CALL_SETUP_REQUESTED_FROM_SIM = 71; +const REQUEST_EXPLICIT_CALL_TRANSFER = 72; +const REQUEST_SET_PREFERRED_NETWORK_TYPE = 73; +const REQUEST_GET_PREFERRED_NETWORK_TYPE = 74; +const REQUEST_GET_NEIGHBORING_CELL_IDS = 75; +const REQUEST_SET_LOCATION_UPDATES = 76; +const REQUEST_CDMA_SET_SUBSCRIPTION_SOURCE = 77; +const REQUEST_CDMA_SET_ROAMING_PREFERENCE = 78; +const REQUEST_CDMA_QUERY_ROAMING_PREFERENCE = 79; +const REQUEST_SET_TTY_MODE = 80; +const REQUEST_QUERY_TTY_MODE = 81; +const REQUEST_CDMA_SET_PREFERRED_VOICE_PRIVACY_MODE = 82; +const REQUEST_CDMA_QUERY_PREFERRED_VOICE_PRIVACY_MODE = 83; +const REQUEST_CDMA_FLASH = 84; +const REQUEST_CDMA_BURST_DTMF = 85; +const REQUEST_CDMA_VALIDATE_AND_WRITE_AKEY = 86; +const REQUEST_CDMA_SEND_SMS = 87; +const REQUEST_CDMA_SMS_ACKNOWLEDGE = 88; +const REQUEST_GSM_GET_BROADCAST_SMS_CONFIG = 89; +const REQUEST_GSM_SET_BROADCAST_SMS_CONFIG = 90; +const REQUEST_GSM_SMS_BROADCAST_ACTIVATION = 91; +const REQUEST_CDMA_GET_BROADCAST_SMS_CONFIG = 92; +const REQUEST_CDMA_SET_BROADCAST_SMS_CONFIG = 93; +const REQUEST_CDMA_SMS_BROADCAST_ACTIVATION = 94; +const REQUEST_CDMA_SUBSCRIPTION = 95; +const REQUEST_CDMA_WRITE_SMS_TO_RUIM = 96; +const REQUEST_CDMA_DELETE_SMS_ON_RUIM = 97; +const REQUEST_DEVICE_IDENTITY = 98; +const REQUEST_EXIT_EMERGENCY_CALLBACK_MODE = 99; +const REQUEST_GET_SMSC_ADDRESS = 100; +const REQUEST_SET_SMSC_ADDRESS = 101; +const REQUEST_REPORT_SMS_MEMORY_STATUS = 102; +const REQUEST_REPORT_STK_SERVICE_IS_RUNNING = 103; +const REQUEST_CDMA_GET_SUBSCRIPTION_SOURCE = 104; +const REQUEST_ISIM_AUTHENTICATION = 105; +const REQUEST_ACKNOWLEDGE_INCOMING_GSM_SMS_WITH_PDU = 106; +const REQUEST_STK_SEND_ENVELOPE_WITH_STATUS = 107; +const REQUEST_DIAL_EMERGENCY_CALL = 10016; // Akami/Maguro specific parcel types. -this.REQUEST_VOICE_RADIO_TECH = 105; -this.REQUEST_IMS_REGISTRATION_STATE = 106; -this.REQUEST_IMS_SEND_SMS = 107; -this.REQUEST_GET_DATA_CALL_PROFILE = 108; -this.REQUEST_SET_UICC_SUBSCRIPTION = 109; -this.REQUEST_SET_DATA_SUBSCRIPTION = 110; -this.REQUEST_GET_UICC_SUBSCRIPTION = 111; -this.REQUEST_GET_DATA_SUBSCRIPTION = 112; -this.REQUEST_SET_SUBSCRIPTION_MODE = 113; -this.REQUEST_SET_TRANSMIT_POWER = 114; -this.REQUEST_SETUP_QOS = 115; -this.REQUEST_RELEASE_QOS = 116; -this.REQUEST_GET_QOS_STATUS = 117; -this.REQUEST_MODIFY_QOS = 118; -this.REQUEST_SUSPEND_QOS = 119; -this.REQUEST_RESUME_QOS = 120; +const REQUEST_VOICE_RADIO_TECH = 105; +const REQUEST_IMS_REGISTRATION_STATE = 106; +const REQUEST_IMS_SEND_SMS = 107; +const REQUEST_GET_DATA_CALL_PROFILE = 108; +const REQUEST_SET_UICC_SUBSCRIPTION = 109; +const REQUEST_SET_DATA_SUBSCRIPTION = 110; +const REQUEST_GET_UICC_SUBSCRIPTION = 111; +const REQUEST_GET_DATA_SUBSCRIPTION = 112; +const REQUEST_SET_SUBSCRIPTION_MODE = 113; +const REQUEST_SET_TRANSMIT_POWER = 114; +const REQUEST_SETUP_QOS = 115; +const REQUEST_RELEASE_QOS = 116; +const REQUEST_GET_QOS_STATUS = 117; +const REQUEST_MODIFY_QOS = 118; +const REQUEST_SUSPEND_QOS = 119; +const REQUEST_RESUME_QOS = 120; -this.RESPONSE_TYPE_SOLICITED = 0; -this.RESPONSE_TYPE_UNSOLICITED = 1; +const RESPONSE_TYPE_SOLICITED = 0; +const RESPONSE_TYPE_UNSOLICITED = 1; -this.UNSOLICITED_RESPONSE_BASE = 1000; -this.UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED = 1000; -this.UNSOLICITED_RESPONSE_CALL_STATE_CHANGED = 1001; -this.UNSOLICITED_RESPONSE_VOICE_NETWORK_STATE_CHANGED = 1002; -this.UNSOLICITED_RESPONSE_NEW_SMS = 1003; -this.UNSOLICITED_RESPONSE_NEW_SMS_STATUS_REPORT = 1004; -this.UNSOLICITED_RESPONSE_NEW_SMS_ON_SIM = 1005; -this.UNSOLICITED_ON_USSD = 1006; -this.UNSOLICITED_ON_USSD_REQUEST = 1007; -this.UNSOLICITED_NITZ_TIME_RECEIVED = 1008; -this.UNSOLICITED_SIGNAL_STRENGTH = 1009; -this.UNSOLICITED_DATA_CALL_LIST_CHANGED = 1010; -this.UNSOLICITED_SUPP_SVC_NOTIFICATION = 1011; -this.UNSOLICITED_STK_SESSION_END = 1012; -this.UNSOLICITED_STK_PROACTIVE_COMMAND = 1013; -this.UNSOLICITED_STK_EVENT_NOTIFY = 1014; -this.UNSOLICITED_STK_CALL_SETUP = 1015; -this.UNSOLICITED_SIM_SMS_STORAGE_FULL = 1016; -this.UNSOLICITED_SIM_REFRESH = 1017; -this.UNSOLICITED_CALL_RING = 1018; -this.UNSOLICITED_RESPONSE_SIM_STATUS_CHANGED = 1019; -this.UNSOLICITED_RESPONSE_CDMA_NEW_SMS = 1020; -this.UNSOLICITED_RESPONSE_NEW_BROADCAST_SMS = 1021; -this.UNSOLICITED_CDMA_RUIM_SMS_STORAGE_FULL = 1022; -this.UNSOLICITED_RESTRICTED_STATE_CHANGED = 1023; -this.UNSOLICITED_ENTER_EMERGENCY_CALLBACK_MODE = 1024; -this.UNSOLICITED_CDMA_CALL_WAITING = 1025; -this.UNSOLICITED_CDMA_OTA_PROVISION_STATUS = 1026; -this.UNSOLICITED_CDMA_INFO_REC = 1027; -this.UNSOLICITED_OEM_HOOK_RAW = 1028; -this.UNSOLICITED_RINGBACK_TONE = 1029; -this.UNSOLICITED_RESEND_INCALL_MUTE = 1030; -this.UNSOLICITED_CDMA_SUBSCRIPTION_SOURCE_CHANGED = 1031; -this.UNSOLICITED_CDMA_PRL_CHANGED = 1032; -this.UNSOLICITED_EXIT_EMERGENCY_CALLBACK_MODE = 1033; -this.UNSOLICITED_RIL_CONNECTED = 1034; +const UNSOLICITED_RESPONSE_BASE = 1000; +const UNSOLICITED_RESPONSE_RADIO_STATE_CHANGED = 1000; +const UNSOLICITED_RESPONSE_CALL_STATE_CHANGED = 1001; +const UNSOLICITED_RESPONSE_VOICE_NETWORK_STATE_CHANGED = 1002; +const UNSOLICITED_RESPONSE_NEW_SMS = 1003; +const UNSOLICITED_RESPONSE_NEW_SMS_STATUS_REPORT = 1004; +const UNSOLICITED_RESPONSE_NEW_SMS_ON_SIM = 1005; +const UNSOLICITED_ON_USSD = 1006; +const UNSOLICITED_ON_USSD_REQUEST = 1007; +const UNSOLICITED_NITZ_TIME_RECEIVED = 1008; +const UNSOLICITED_SIGNAL_STRENGTH = 1009; +const UNSOLICITED_DATA_CALL_LIST_CHANGED = 1010; +const UNSOLICITED_SUPP_SVC_NOTIFICATION = 1011; +const UNSOLICITED_STK_SESSION_END = 1012; +const UNSOLICITED_STK_PROACTIVE_COMMAND = 1013; +const UNSOLICITED_STK_EVENT_NOTIFY = 1014; +const UNSOLICITED_STK_CALL_SETUP = 1015; +const UNSOLICITED_SIM_SMS_STORAGE_FULL = 1016; +const UNSOLICITED_SIM_REFRESH = 1017; +const UNSOLICITED_CALL_RING = 1018; +const UNSOLICITED_RESPONSE_SIM_STATUS_CHANGED = 1019; +const UNSOLICITED_RESPONSE_CDMA_NEW_SMS = 1020; +const UNSOLICITED_RESPONSE_NEW_BROADCAST_SMS = 1021; +const UNSOLICITED_CDMA_RUIM_SMS_STORAGE_FULL = 1022; +const UNSOLICITED_RESTRICTED_STATE_CHANGED = 1023; +const UNSOLICITED_ENTER_EMERGENCY_CALLBACK_MODE = 1024; +const UNSOLICITED_CDMA_CALL_WAITING = 1025; +const UNSOLICITED_CDMA_OTA_PROVISION_STATUS = 1026; +const UNSOLICITED_CDMA_INFO_REC = 1027; +const UNSOLICITED_OEM_HOOK_RAW = 1028; +const UNSOLICITED_RINGBACK_TONE = 1029; +const UNSOLICITED_RESEND_INCALL_MUTE = 1030; +const UNSOLICITED_CDMA_SUBSCRIPTION_SOURCE_CHANGED = 1031; +const UNSOLICITED_CDMA_PRL_CHANGED = 1032; +const UNSOLICITED_EXIT_EMERGENCY_CALLBACK_MODE = 1033; +const UNSOLICITED_RIL_CONNECTED = 1034; // Akami/Maguro specific parcels. -this.UNSOLICITED_VOICE_RADIO_TECH_CHANGED = 1034; -this.UNSOLICITED_RESPONSE_IMS_NETWORK_STATE_CHANGED = 1035; -this.UNSOLICITED_RESPONSE_TETHERED_MODE_STATE_CHANGED = 1036; -this.UNSOLICITED_RESPONSE_DATA_NETWORK_STATE_CHANGED = 1037; -this.UNSOLICITED_ON_SS = 1038; -this.UNSOLICITED_STK_CC_ALPHA_NOTIFY = 1039; -this.UNSOLICITED_UICC_SUBSCRIPTION_STATUS_CHANGED = 1040; -this.UNSOLICITED_QOS_STATE_CHANGED_IND = 1041; +const UNSOLICITED_VOICE_RADIO_TECH_CHANGED = 1034; +const UNSOLICITED_RESPONSE_IMS_NETWORK_STATE_CHANGED = 1035; +const UNSOLICITED_RESPONSE_TETHERED_MODE_STATE_CHANGED = 1036; +const UNSOLICITED_RESPONSE_DATA_NETWORK_STATE_CHANGED = 1037; +const UNSOLICITED_ON_SS = 1038; +const UNSOLICITED_STK_CC_ALPHA_NOTIFY = 1039; +const UNSOLICITED_UICC_SUBSCRIPTION_STATUS_CHANGED = 1040; +const UNSOLICITED_QOS_STATE_CHANGED_IND = 1041; -this.ERROR_SUCCESS = 0; -this.ERROR_RADIO_NOT_AVAILABLE = 1; -this.ERROR_GENERIC_FAILURE = 2; -this.ERROR_PASSWORD_INCORRECT = 3; -this.ERROR_SIM_PIN2 = 4; -this.ERROR_SIM_PUK2 = 5; -this.ERROR_REQUEST_NOT_SUPPORTED = 6; -this.ERROR_CANCELLED = 7; -this.ERROR_OP_NOT_ALLOWED_DURING_VOICE_CALL = 8; -this.ERROR_OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9; -this.ERROR_SMS_SEND_FAIL_RETRY = 10; -this.ERROR_SIM_ABSENT = 11; -this.ERROR_SUBSCRIPTION_NOT_AVAILABLE = 12; -this.ERROR_MODE_NOT_SUPPORTED = 13; -this.ERROR_FDN_CHECK_FAILURE = 14; -this.ERROR_ILLEGAL_SIM_OR_ME = 15; -this.ERROR_DIAL_MODIFIED_TO_USSD = 17; -this.ERROR_DIAL_MODIFIED_TO_SS = 18; -this.ERROR_DIAL_MODIFIED_TO_DIAL = 19; -this.ERROR_USSD_MODIFIED_TO_DIAL = 20; -this.ERROR_USSD_MODIFIED_TO_SS = 21; -this.ERROR_USSD_MODIFIED_TO_USSD = 22; -this.ERROR_SS_MODIFIED_TO_DIAL = 23; -this.ERROR_SS_MODIFIED_TO_USSD = 24; -this.ERROR_SS_MODIFIED_TO_SS = 25; -this.ERROR_SUBSCRIPTION_NOT_SUPPORTED = 26; +const ERROR_SUCCESS = 0; +const ERROR_RADIO_NOT_AVAILABLE = 1; +const ERROR_GENERIC_FAILURE = 2; +const ERROR_PASSWORD_INCORRECT = 3; +const ERROR_SIM_PIN2 = 4; +const ERROR_SIM_PUK2 = 5; +const ERROR_REQUEST_NOT_SUPPORTED = 6; +const ERROR_CANCELLED = 7; +const ERROR_OP_NOT_ALLOWED_DURING_VOICE_CALL = 8; +const ERROR_OP_NOT_ALLOWED_BEFORE_REG_TO_NW = 9; +const ERROR_SMS_SEND_FAIL_RETRY = 10; +const ERROR_SIM_ABSENT = 11; +const ERROR_SUBSCRIPTION_NOT_AVAILABLE = 12; +const ERROR_MODE_NOT_SUPPORTED = 13; +const ERROR_FDN_CHECK_FAILURE = 14; +const ERROR_ILLEGAL_SIM_OR_ME = 15; +const ERROR_DIAL_MODIFIED_TO_USSD = 17; +const ERROR_DIAL_MODIFIED_TO_SS = 18; +const ERROR_DIAL_MODIFIED_TO_DIAL = 19; +const ERROR_USSD_MODIFIED_TO_DIAL = 20; +const ERROR_USSD_MODIFIED_TO_SS = 21; +const ERROR_USSD_MODIFIED_TO_USSD = 22; +const ERROR_SS_MODIFIED_TO_DIAL = 23; +const ERROR_SS_MODIFIED_TO_USSD = 24; +const ERROR_SS_MODIFIED_TO_SS = 25; +const ERROR_SUBSCRIPTION_NOT_SUPPORTED = 26; -this.GECKO_ERROR_SUCCESS = null; -this.GECKO_ERROR_RADIO_NOT_AVAILABLE = "RadioNotAvailable"; -this.GECKO_ERROR_GENERIC_FAILURE = "GenericFailure"; -this.GECKO_ERROR_REQUEST_NOT_SUPPORTED = "RequestNotSupported"; -this.GECKO_ERROR_ILLEGAL_SIM_OR_ME = "IllegalSIMorME"; -this.GECKO_ERROR_PASSWORD_INCORRECT = "IncorrectPassword"; +const GECKO_ERROR_SUCCESS = null; +const GECKO_ERROR_RADIO_NOT_AVAILABLE = "RadioNotAvailable"; +const GECKO_ERROR_GENERIC_FAILURE = "GenericFailure"; +const GECKO_ERROR_REQUEST_NOT_SUPPORTED = "RequestNotSupported"; +const GECKO_ERROR_ILLEGAL_SIM_OR_ME = "IllegalSIMorME"; +const GECKO_ERROR_PASSWORD_INCORRECT = "IncorrectPassword"; -this.RIL_ERROR_TO_GECKO_ERROR = {}; +const RIL_ERROR_TO_GECKO_ERROR = {}; RIL_ERROR_TO_GECKO_ERROR[ERROR_SUCCESS] = GECKO_ERROR_SUCCESS; RIL_ERROR_TO_GECKO_ERROR[ERROR_RADIO_NOT_AVAILABLE] = GECKO_ERROR_RADIO_NOT_AVAILABLE; RIL_ERROR_TO_GECKO_ERROR[ERROR_GENERIC_FAILURE] = GECKO_ERROR_GENERIC_FAILURE; @@ -244,343 +244,343 @@ RIL_ERROR_TO_GECKO_ERROR[ERROR_PASSWORD_INCORRECT] = GECKO_ERROR_PASSWORD_INCORR // 3GPP 23.040 clause 9.2.3.6 TP-Message-Reference(TP-MR): // The number of times the MS automatically repeats the SMS-SUBMIT shall be in // the range 1 to 3 but the precise number is an implementation matter. -this.SMS_RETRY_MAX = 3; +const SMS_RETRY_MAX = 3; -this.RADIO_STATE_OFF = 0; -this.RADIO_STATE_UNAVAILABLE = 1; -this.RADIO_STATE_ON = 2; +const RADIO_STATE_OFF = 0; +const RADIO_STATE_UNAVAILABLE = 1; +const RADIO_STATE_ON = 2; // RIL v5 legacy constants: -this.RADIO_STATE_SIM_NOT_READY = 2; -this.RADIO_STATE_SIM_LOCKED_OR_ABSENT = 3; -this.RADIO_STATE_SIM_READY = 4; -this.RADIO_STATE_RUIM_NOT_READY = 5; -this.RADIO_STATE_RUIM_READY = 6; -this.RADIO_STATE_RUIM_LOCKED_OR_ABSENT = 7; -this.RADIO_STATE_NV_NOT_READY = 8; -this.RADIO_STATE_NV_READY = 9; +const RADIO_STATE_SIM_NOT_READY = 2; +const RADIO_STATE_SIM_LOCKED_OR_ABSENT = 3; +const RADIO_STATE_SIM_READY = 4; +const RADIO_STATE_RUIM_NOT_READY = 5; +const RADIO_STATE_RUIM_READY = 6; +const RADIO_STATE_RUIM_LOCKED_OR_ABSENT = 7; +const RADIO_STATE_NV_NOT_READY = 8; +const RADIO_STATE_NV_READY = 9; -this.CARD_STATE_ABSENT = 0; -this.CARD_STATE_PRESENT = 1; -this.CARD_STATE_ERROR = 2; +const CARD_STATE_ABSENT = 0; +const CARD_STATE_PRESENT = 1; +const CARD_STATE_ERROR = 2; -this.CARD_PERSOSUBSTATE_UNKNOWN = 0; -this.CARD_PERSOSUBSTATE_IN_PROGRESS = 1; -this.CARD_PERSOSUBSTATE_READY = 2; -this.CARD_PERSOSUBSTATE_SIM_NETWORK = 3; -this.CARD_PERSOSUBSTATE_SIM_NETWORK_SUBSET = 4; -this.CARD_PERSOSUBSTATE_SIM_CORPORATE = 5; -this.CARD_PERSOSUBSTATE_SIM_SERVICE_PROVIDER = 6; -this.CARD_PERSOSUBSTATE_SIM_SIM = 7; -this.CARD_PERSOSUBSTATE_SIM_NETWORK_PUK = 8; -this.CARD_PERSOSUBSTATE_SIM_NETWORK_SUBSET_PUK = 9; -this.CARD_PERSOSUBSTATE_SIM_CORPORATE_PUK = 10; -this.CARD_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK = 11; -this.CARD_PERSOSUBSTATE_SIM_SIM_PUK = 12; -this.CARD_PERSOSUBSTATE_RUIM_NETWORK1 = 13; -this.CARD_PERSOSUBSTATE_RUIM_NETWORK2 = 14; -this.CARD_PERSOSUBSTATE_RUIM_HRPD = 15; -this.CARD_PERSOSUBSTATE_RUIM_CORPORATE = 16; -this.CARD_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER = 17; -this.CARD_PERSOSUBSTATE_RUIM_RUIM = 18; -this.CARD_PERSOSUBSTATE_RUIM_NETWORK1_PUK = 19; -this.CARD_PERSOSUBSTATE_RUIM_NETWORK2_PUK = 20; -this.CARD_PERSOSUBSTATE_RUIM_HRPD_PUK = 21; -this.CARD_PERSOSUBSTATE_RUIM_CORPORATE_PUK = 22; -this.CARD_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER_PUK = 23; -this.CARD_PERSOSUBSTATE_RUIM_RUIM_PUK = 24; +const CARD_PERSOSUBSTATE_UNKNOWN = 0; +const CARD_PERSOSUBSTATE_IN_PROGRESS = 1; +const CARD_PERSOSUBSTATE_READY = 2; +const CARD_PERSOSUBSTATE_SIM_NETWORK = 3; +const CARD_PERSOSUBSTATE_SIM_NETWORK_SUBSET = 4; +const CARD_PERSOSUBSTATE_SIM_CORPORATE = 5; +const CARD_PERSOSUBSTATE_SIM_SERVICE_PROVIDER = 6; +const CARD_PERSOSUBSTATE_SIM_SIM = 7; +const CARD_PERSOSUBSTATE_SIM_NETWORK_PUK = 8; +const CARD_PERSOSUBSTATE_SIM_NETWORK_SUBSET_PUK = 9; +const CARD_PERSOSUBSTATE_SIM_CORPORATE_PUK = 10; +const CARD_PERSOSUBSTATE_SIM_SERVICE_PROVIDER_PUK = 11; +const CARD_PERSOSUBSTATE_SIM_SIM_PUK = 12; +const CARD_PERSOSUBSTATE_RUIM_NETWORK1 = 13; +const CARD_PERSOSUBSTATE_RUIM_NETWORK2 = 14; +const CARD_PERSOSUBSTATE_RUIM_HRPD = 15; +const CARD_PERSOSUBSTATE_RUIM_CORPORATE = 16; +const CARD_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER = 17; +const CARD_PERSOSUBSTATE_RUIM_RUIM = 18; +const CARD_PERSOSUBSTATE_RUIM_NETWORK1_PUK = 19; +const CARD_PERSOSUBSTATE_RUIM_NETWORK2_PUK = 20; +const CARD_PERSOSUBSTATE_RUIM_HRPD_PUK = 21; +const CARD_PERSOSUBSTATE_RUIM_CORPORATE_PUK = 22; +const CARD_PERSOSUBSTATE_RUIM_SERVICE_PROVIDER_PUK = 23; +const CARD_PERSOSUBSTATE_RUIM_RUIM_PUK = 24; -this.CARD_APPSTATE_ILLEGAL = -1; -this.CARD_APPSTATE_UNKNOWN = 0; -this.CARD_APPSTATE_DETECTED = 1; -this.CARD_APPSTATE_PIN = 2; // If PIN1 or UPin is required. -this.CARD_APPSTATE_PUK = 3; // If PUK1 or Puk for UPin is required. -this.CARD_APPSTATE_SUBSCRIPTION_PERSO = 4; // perso_substate should be looked +const CARD_APPSTATE_ILLEGAL = -1; +const CARD_APPSTATE_UNKNOWN = 0; +const CARD_APPSTATE_DETECTED = 1; +const CARD_APPSTATE_PIN = 2; // If PIN1 or UPin is required. +const CARD_APPSTATE_PUK = 3; // If PUK1 or Puk for UPin is required. +const CARD_APPSTATE_SUBSCRIPTION_PERSO = 4; // perso_substate should be looked // at when app_state is assigned // to this value. -this.CARD_APPSTATE_READY = 5; +const CARD_APPSTATE_READY = 5; -this.CARD_PINSTATE_UNKNOWN = 0; -this.CARD_PINSTATE_ENABLED_NOT_VERIFIED = 1; -this.CARD_PINSTATE_ENABLED_VERIFIED = 2; -this.CARD_PINSTATE_DISABLED = 3; -this.CARD_PINSTATE_ENABLED_BLOCKED = 4; -this.CARD_PINSTATE_ENABLED_PERM_BLOCKED = 5; +const CARD_PINSTATE_UNKNOWN = 0; +const CARD_PINSTATE_ENABLED_NOT_VERIFIED = 1; +const CARD_PINSTATE_ENABLED_VERIFIED = 2; +const CARD_PINSTATE_DISABLED = 3; +const CARD_PINSTATE_ENABLED_BLOCKED = 4; +const CARD_PINSTATE_ENABLED_PERM_BLOCKED = 5; -this.CARD_APPTYPE_UNKNOWN = 0; -this.CARD_APPTYPE_SIM = 1; -this.CARD_APPTYPE_USIM = 2; -this.CARD_APPTYPE_RUIM = 3; -this.CARD_APPTYPE_CSIM = 4; -this.CARD_APPTYPE_ISIM = 5; +const CARD_APPTYPE_UNKNOWN = 0; +const CARD_APPTYPE_SIM = 1; +const CARD_APPTYPE_USIM = 2; +const CARD_APPTYPE_RUIM = 3; +const CARD_APPTYPE_CSIM = 4; +const CARD_APPTYPE_ISIM = 5; -this.CARD_MAX_APPS = 8; +const CARD_MAX_APPS = 8; -this.NETWORK_STATE_UNKNOWN = "unknown"; -this.NETWORK_STATE_AVAILABLE = "available"; -this.NETWORK_STATE_CONNECTED = "connected"; -this.NETWORK_STATE_FORBIDDEN = "forbidden"; +const NETWORK_STATE_UNKNOWN = "unknown"; +const NETWORK_STATE_AVAILABLE = "available"; +const NETWORK_STATE_CONNECTED = "connected"; +const NETWORK_STATE_FORBIDDEN = "forbidden"; -this.NETWORK_SELECTION_MODE_AUTOMATIC = 0; -this.NETWORK_SELECTION_MODE_MANUAL = 1; +const NETWORK_SELECTION_MODE_AUTOMATIC = 0; +const NETWORK_SELECTION_MODE_MANUAL = 1; -this.NETWORK_INFO_VOICE_REGISTRATION_STATE = "voiceRegistrationState"; -this.NETWORK_INFO_DATA_REGISTRATION_STATE = "dataRegistrationState"; -this.NETWORK_INFO_OPERATOR = "operator"; -this.NETWORK_INFO_NETWORK_SELECTION_MODE = "networkSelectionMode"; -this.NETWORK_INFO_MESSAGE_TYPES = [ +const NETWORK_INFO_VOICE_REGISTRATION_STATE = "voiceRegistrationState"; +const NETWORK_INFO_DATA_REGISTRATION_STATE = "dataRegistrationState"; +const NETWORK_INFO_OPERATOR = "operator"; +const NETWORK_INFO_NETWORK_SELECTION_MODE = "networkSelectionMode"; +const NETWORK_INFO_MESSAGE_TYPES = [ NETWORK_INFO_VOICE_REGISTRATION_STATE, NETWORK_INFO_DATA_REGISTRATION_STATE, NETWORK_INFO_OPERATOR, NETWORK_INFO_NETWORK_SELECTION_MODE ]; -this.GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM = "wcdma/gsm"; -this.GECKO_PREFERRED_NETWORK_TYPE_GSM_ONLY = "gsm"; -this.GECKO_PREFERRED_NETWORK_TYPE_WCDMA_ONLY = "wcdma"; -this.GECKO_PREFERRED_NETWORK_TYPE_DEFAULT = GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM; -this.RIL_PREFERRED_NETWORK_TYPE_TO_GECKO = [ +const GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM = "wcdma/gsm"; +const GECKO_PREFERRED_NETWORK_TYPE_GSM_ONLY = "gsm"; +const GECKO_PREFERRED_NETWORK_TYPE_WCDMA_ONLY = "wcdma"; +const GECKO_PREFERRED_NETWORK_TYPE_DEFAULT = GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM; +const RIL_PREFERRED_NETWORK_TYPE_TO_GECKO = [ GECKO_PREFERRED_NETWORK_TYPE_WCDMA_GSM, GECKO_PREFERRED_NETWORK_TYPE_GSM_ONLY, GECKO_PREFERRED_NETWORK_TYPE_WCDMA_ONLY ]; // Network registration states. See TS 27.007 7.2 -this.NETWORK_CREG_STATE_NOT_SEARCHING = 0; -this.NETWORK_CREG_STATE_REGISTERED_HOME = 1; -this.NETWORK_CREG_STATE_SEARCHING = 2; -this.NETWORK_CREG_STATE_DENIED = 3; -this.NETWORK_CREG_STATE_UNKNOWN = 4; -this.NETWORK_CREG_STATE_REGISTERED_ROAMING = 5; -this.NETWORK_CREG_STATE_NOT_SEARCHING_EMERGENCY_CALLS = 10; -this.NETWORK_CREG_STATE_SEARCHING_EMERGENCY_CALLS = 12; -this.NETWORK_CREG_STATE_DENIED_EMERGENCY_CALLS = 13; -this.NETWORK_CREG_STATE_UNKNOWN_EMERGENCY_CALLS = 14; +const NETWORK_CREG_STATE_NOT_SEARCHING = 0; +const NETWORK_CREG_STATE_REGISTERED_HOME = 1; +const NETWORK_CREG_STATE_SEARCHING = 2; +const NETWORK_CREG_STATE_DENIED = 3; +const NETWORK_CREG_STATE_UNKNOWN = 4; +const NETWORK_CREG_STATE_REGISTERED_ROAMING = 5; +const NETWORK_CREG_STATE_NOT_SEARCHING_EMERGENCY_CALLS = 10; +const NETWORK_CREG_STATE_SEARCHING_EMERGENCY_CALLS = 12; +const NETWORK_CREG_STATE_DENIED_EMERGENCY_CALLS = 13; +const NETWORK_CREG_STATE_UNKNOWN_EMERGENCY_CALLS = 14; -this.NETWORK_CREG_TECH_UNKNOWN = 0; -this.NETWORK_CREG_TECH_GPRS = 1; -this.NETWORK_CREG_TECH_EDGE = 2; -this.NETWORK_CREG_TECH_UMTS = 3; -this.NETWORK_CREG_TECH_IS95A = 4; -this.NETWORK_CREG_TECH_IS95B = 5; -this.NETWORK_CREG_TECH_1XRTT = 6; -this.NETWORK_CREG_TECH_EVDO0 = 7; -this.NETWORK_CREG_TECH_EVDOA = 8; -this.NETWORK_CREG_TECH_HSDPA = 9; -this.NETWORK_CREG_TECH_HSUPA = 10; -this.NETWORK_CREG_TECH_HSPA = 11; -this.NETWORK_CREG_TECH_EVDOB = 12; -this.NETWORK_CREG_TECH_EHRPD = 13; -this.NETWORK_CREG_TECH_LTE = 14; -this.NETWORK_CREG_TECH_HSPAP = 15; +const NETWORK_CREG_TECH_UNKNOWN = 0; +const NETWORK_CREG_TECH_GPRS = 1; +const NETWORK_CREG_TECH_EDGE = 2; +const NETWORK_CREG_TECH_UMTS = 3; +const NETWORK_CREG_TECH_IS95A = 4; +const NETWORK_CREG_TECH_IS95B = 5; +const NETWORK_CREG_TECH_1XRTT = 6; +const NETWORK_CREG_TECH_EVDO0 = 7; +const NETWORK_CREG_TECH_EVDOA = 8; +const NETWORK_CREG_TECH_HSDPA = 9; +const NETWORK_CREG_TECH_HSUPA = 10; +const NETWORK_CREG_TECH_HSPA = 11; +const NETWORK_CREG_TECH_EVDOB = 12; +const NETWORK_CREG_TECH_EHRPD = 13; +const NETWORK_CREG_TECH_LTE = 14; +const NETWORK_CREG_TECH_HSPAP = 15; -this.CALL_STATE_ACTIVE = 0; -this.CALL_STATE_HOLDING = 1; -this.CALL_STATE_DIALING = 2; -this.CALL_STATE_ALERTING = 3; -this.CALL_STATE_INCOMING = 4; -this.CALL_STATE_WAITING = 5; -this.CALL_STATE_BUSY = 6; +const CALL_STATE_ACTIVE = 0; +const CALL_STATE_HOLDING = 1; +const CALL_STATE_DIALING = 2; +const CALL_STATE_ALERTING = 3; +const CALL_STATE_INCOMING = 4; +const CALL_STATE_WAITING = 5; +const CALL_STATE_BUSY = 6; -this.TOA_INTERNATIONAL = 0x91; -this.TOA_UNKNOWN = 0x81; +const TOA_INTERNATIONAL = 0x91; +const TOA_UNKNOWN = 0x81; -this.CALL_PRESENTATION_ALLOWED = 0; -this.CALL_PRESENTATION_RESTRICTED = 1; -this.CALL_PRESENTATION_UNKNOWN = 2; -this.CALL_PRESENTATION_PAYPHONE = 3; +const CALL_PRESENTATION_ALLOWED = 0; +const CALL_PRESENTATION_RESTRICTED = 1; +const CALL_PRESENTATION_UNKNOWN = 2; +const CALL_PRESENTATION_PAYPHONE = 3; // ICC commands, see TS 27.007 +CRSM commands -this.ICC_COMMAND_SEEK = 0xa2; -this.ICC_COMMAND_READ_BINARY = 0xb0; -this.ICC_COMMAND_READ_RECORD = 0xb2; -this.ICC_COMMAND_GET_RESPONSE = 0xc0; -this.ICC_COMMAND_UPDATE_BINARY = 0xd6; -this.ICC_COMMAND_UPDATE_RECORD = 0xdc; +const ICC_COMMAND_SEEK = 0xa2; +const ICC_COMMAND_READ_BINARY = 0xb0; +const ICC_COMMAND_READ_RECORD = 0xb2; +const ICC_COMMAND_GET_RESPONSE = 0xc0; +const ICC_COMMAND_UPDATE_BINARY = 0xd6; +const ICC_COMMAND_UPDATE_RECORD = 0xdc; // ICC constants, GSM SIM file ids from TS 51.011 -this.ICC_EF_ICCID = 0x2fe2; -this.ICC_EF_IMG = 0x4f20; -this.ICC_EF_PBR = 0x4f30; -this.ICC_EF_SST = 0x6f38; -this.ICC_EF_UST = 0x6f38; // For USIM -this.ICC_EF_ADN = 0x6f3a; -this.ICC_EF_FDN = 0x6f3b; -this.ICC_EF_SMS = 0x6f3c; -this.ICC_EF_MSISDN = 0x6f40; -this.ICC_EF_SPN = 0x6f46; -this.ICC_EF_SDN = 0x6f49; -this.ICC_EF_EXT1 = 0x6f4a; -this.ICC_EF_EXT2 = 0x6f4b; -this.ICC_EF_EXT3 = 0x6f4c; -this.ICC_EF_AD = 0x6fad; -this.ICC_EF_PNN = 0x6fc5; -this.ICC_EF_MBDN = 0x6fc7; -this.ICC_EF_EXT6 = 0x6fc8; // Ext record for EF[MBDN] -this.ICC_EF_MBI = 0x6fc9; -this.ICC_EF_MWIS = 0x6fca; -this.ICC_EF_CFIS = 0x6fcb; -this.ICC_EF_SPDI = 0x6fcd; +const ICC_EF_ICCID = 0x2fe2; +const ICC_EF_IMG = 0x4f20; +const ICC_EF_PBR = 0x4f30; +const ICC_EF_SST = 0x6f38; +const ICC_EF_UST = 0x6f38; // For USIM +const ICC_EF_ADN = 0x6f3a; +const ICC_EF_FDN = 0x6f3b; +const ICC_EF_SMS = 0x6f3c; +const ICC_EF_MSISDN = 0x6f40; +const ICC_EF_SPN = 0x6f46; +const ICC_EF_SDN = 0x6f49; +const ICC_EF_EXT1 = 0x6f4a; +const ICC_EF_EXT2 = 0x6f4b; +const ICC_EF_EXT3 = 0x6f4c; +const ICC_EF_AD = 0x6fad; +const ICC_EF_PNN = 0x6fc5; +const ICC_EF_MBDN = 0x6fc7; +const ICC_EF_EXT6 = 0x6fc8; // Ext record for EF[MBDN] +const ICC_EF_MBI = 0x6fc9; +const ICC_EF_MWIS = 0x6fca; +const ICC_EF_CFIS = 0x6fcb; +const ICC_EF_SPDI = 0x6fcd; // Types of files TS 11.11 9.3 -this.TYPE_RFU = 0; -this.TYPE_MF = 1; -this.TYPE_DF = 2; -this.TYPE_EF = 4; +const TYPE_RFU = 0; +const TYPE_MF = 1; +const TYPE_DF = 2; +const TYPE_EF = 4; -this.RESPONSE_DATA_FILE_SIZE = 2; -this.RESPONSE_DATA_FILE_ID_1 = 4; -this.RESPONSE_DATA_FILE_ID_2 = 5; -this.RESPONSE_DATA_FILE_TYPE = 6; -this.RESPONSE_DATA_RFU_3 = 7; -this.RESPONSE_DATA_ACCESS_CONDITION_1 = 8; -this.RESPONSE_DATA_ACCESS_CONDITION_2 = 9; -this.RESPONSE_DATA_ACCESS_CONDITION_3 = 10; -this.RESPONSE_DATA_FILE_STATUS = 11; -this.RESPONSE_DATA_LENGTH = 12; -this.RESPONSE_DATA_STRUCTURE = 13; -this.RESPONSE_DATA_RECORD_LENGTH = 14; +const RESPONSE_DATA_FILE_SIZE = 2; +const RESPONSE_DATA_FILE_ID_1 = 4; +const RESPONSE_DATA_FILE_ID_2 = 5; +const RESPONSE_DATA_FILE_TYPE = 6; +const RESPONSE_DATA_RFU_3 = 7; +const RESPONSE_DATA_ACCESS_CONDITION_1 = 8; +const RESPONSE_DATA_ACCESS_CONDITION_2 = 9; +const RESPONSE_DATA_ACCESS_CONDITION_3 = 10; +const RESPONSE_DATA_FILE_STATUS = 11; +const RESPONSE_DATA_LENGTH = 12; +const RESPONSE_DATA_STRUCTURE = 13; +const RESPONSE_DATA_RECORD_LENGTH = 14; // Types of files TS 11.11 9.3 -this.EF_TYPE_TRANSPARENT = 0; -this.EF_TYPE_LINEAR_FIXED = 1; -this.EF_TYPE_CYCLIC = 3; +const EF_TYPE_TRANSPARENT = 0; +const EF_TYPE_LINEAR_FIXED = 1; +const EF_TYPE_CYCLIC = 3; // Status code of EFsms // see 3GPP TS 51.011 clause 10.5.3 -this.EFSMS_STATUS_FREE = 0x00; -this.EFSMS_STATUS_READ = 0x01; -this.EFSMS_STATUS_TO_BE_READ = 0x03; -this.EFSMS_STATUS_TO_BE_SENT = 0x07; +const EFSMS_STATUS_FREE = 0x00; +const EFSMS_STATUS_READ = 0x01; +const EFSMS_STATUS_TO_BE_READ = 0x03; +const EFSMS_STATUS_TO_BE_SENT = 0x07; // For retrieving MSISDN, TS 151.011 clause 10.5.5 -this.MSISDN_FOOTER_SIZE_BYTES = 14; -this.MSISDN_MAX_NUMBER_SIZE_BYTES = 10; +const MSISDN_FOOTER_SIZE_BYTES = 14; +const MSISDN_MAX_NUMBER_SIZE_BYTES = 10; // READ_RECORD mode, TS 102.221 -this.READ_RECORD_ABSOLUTE_MODE = 4; +const READ_RECORD_ABSOLUTE_MODE = 4; // GET_RESPONSE mandatory response size for EF, see TS 51.011 clause 9, // 'Response data in case of an EF.' -this.GET_RESPONSE_EF_SIZE_BYTES = 15; +const GET_RESPONSE_EF_SIZE_BYTES = 15; // EF path -this.EF_PATH_MF_SIM = "3f00"; -this.EF_PATH_DF_PHONEBOOK = "5f3a"; -this.EF_PATH_DF_TELECOM = "7f10"; -this.EF_PATH_DF_GSM = "7f20"; -this.EF_PATH_ADF_USIM = "7fff"; +const EF_PATH_MF_SIM = "3f00"; +const EF_PATH_DF_PHONEBOOK = "5f3a"; +const EF_PATH_DF_TELECOM = "7f10"; +const EF_PATH_DF_GSM = "7f20"; +const EF_PATH_ADF_USIM = "7fff"; // Status code of sw1 for ICC I/O, // see GSM11.11 and TS 51.011 clause 9.4, and ISO 7816-4 -this.ICC_STATUS_NORMAL_ENDING = 0x90; -this.ICC_STATUS_NORMAL_ENDING_WITH_EXTRA = 0x91; -this.ICC_STATUS_SAT_BUSY = 0x93; -this.ICC_STATUS_WITH_SIM_DATA = 0x9e; -this.ICC_STATUS_WITH_RESPONSE_DATA = 0x9f; -this.ICC_STATUS_ERROR_WRONG_LENGTH = 0x67; -this.ICC_STATUS_ERROR_COMMAND_NOT_ALLOWED = 0x69; -this.ICC_STATUS_ERROR_WRONG_PARAMETERS = 0x6a; +const ICC_STATUS_NORMAL_ENDING = 0x90; +const ICC_STATUS_NORMAL_ENDING_WITH_EXTRA = 0x91; +const ICC_STATUS_SAT_BUSY = 0x93; +const ICC_STATUS_WITH_SIM_DATA = 0x9e; +const ICC_STATUS_WITH_RESPONSE_DATA = 0x9f; +const ICC_STATUS_ERROR_WRONG_LENGTH = 0x67; +const ICC_STATUS_ERROR_COMMAND_NOT_ALLOWED = 0x69; +const ICC_STATUS_ERROR_WRONG_PARAMETERS = 0x6a; // ICC call barring facility. // TS 27.007, clause 7.4, +CLCK -this.ICC_CB_FACILITY_SIM = "SC"; +const ICC_CB_FACILITY_SIM = "SC"; // ICC service class // TS 27.007, clause 7.4, +CLCK -this.ICC_SERVICE_CLASS_NONE = 0; // no user input -this.ICC_SERVICE_CLASS_VOICE = (1 << 0); -this.ICC_SERVICE_CLASS_DATA = (1 << 1); -this.ICC_SERVICE_CLASS_FAX = (1 << 2); -this.ICC_SERVICE_CLASS_SMS = (1 << 3); -this.ICC_SERVICE_CLASS_DATA_SYNC = (1 << 4); -this.ICC_SERVICE_CLASS_DATA_ASYNC = (1 << 5); -this.ICC_SERVICE_CLASS_PACKET = (1 << 6); -this.ICC_SERVICE_CLASS_PAD = (1 << 7); -this.ICC_SERVICE_CLASS_MAX = (1 << 7); // Max ICC_SERVICE_CLASS value +const ICC_SERVICE_CLASS_NONE = 0; // no user input +const ICC_SERVICE_CLASS_VOICE = (1 << 0); +const ICC_SERVICE_CLASS_DATA = (1 << 1); +const ICC_SERVICE_CLASS_FAX = (1 << 2); +const ICC_SERVICE_CLASS_SMS = (1 << 3); +const ICC_SERVICE_CLASS_DATA_SYNC = (1 << 4); +const ICC_SERVICE_CLASS_DATA_ASYNC = (1 << 5); +const ICC_SERVICE_CLASS_PACKET = (1 << 6); +const ICC_SERVICE_CLASS_PAD = (1 << 7); +const ICC_SERVICE_CLASS_MAX = (1 << 7); // Max ICC_SERVICE_CLASS value -this.ICC_USIM_TYPE1_TAG = 0xa8; -this.ICC_USIM_TYPE2_TAG = 0xa9; -this.ICC_USIM_TYPE3_TAG = 0xaa; -this.ICC_USIM_EFADN_TAG = 0xc0; -this.ICC_USIM_EFIAP_TAG = 0xc1; -this.ICC_USIM_EFEXT1_TAG = 0xc2; -this.ICC_USIM_EFSNE_TAG = 0xc3; -this.ICC_USIM_EFANR_TAG = 0xc4; -this.ICC_USIM_EFPBC_TAG = 0xc5; -this.ICC_USIM_EFGRP_TAG = 0xc6; -this.ICC_USIM_EFAAS_TAG = 0xc7; -this.ICC_USIM_EFGSD_TAG = 0xc8; -this.ICC_USIM_EFUID_TAG = 0xc9; -this.ICC_USIM_EFEMAIL_TAG = 0xca; -this.ICC_USIM_EFCCP1_TAG = 0xcb; +const ICC_USIM_TYPE1_TAG = 0xa8; +const ICC_USIM_TYPE2_TAG = 0xa9; +const ICC_USIM_TYPE3_TAG = 0xaa; +const ICC_USIM_EFADN_TAG = 0xc0; +const ICC_USIM_EFIAP_TAG = 0xc1; +const ICC_USIM_EFEXT1_TAG = 0xc2; +const ICC_USIM_EFSNE_TAG = 0xc3; +const ICC_USIM_EFANR_TAG = 0xc4; +const ICC_USIM_EFPBC_TAG = 0xc5; +const ICC_USIM_EFGRP_TAG = 0xc6; +const ICC_USIM_EFAAS_TAG = 0xc7; +const ICC_USIM_EFGSD_TAG = 0xc8; +const ICC_USIM_EFUID_TAG = 0xc9; +const ICC_USIM_EFEMAIL_TAG = 0xca; +const ICC_USIM_EFCCP1_TAG = 0xcb; /** * STK constants. */ // Tags for Ber Tlv. -this.BER_UNKNOWN_TAG = 0x00; -this.BER_PROACTIVE_COMMAND_TAG = 0xd0; -this.BER_SMS_PP_DOWNLOAD_TAG = 0xd1; -this.BER_MENU_SELECTION_TAG = 0xd3; -this.BER_EVENT_DOWNLOAD_TAG = 0xd6; +const BER_UNKNOWN_TAG = 0x00; +const BER_PROACTIVE_COMMAND_TAG = 0xd0; +const BER_SMS_PP_DOWNLOAD_TAG = 0xd1; +const BER_MENU_SELECTION_TAG = 0xd3; +const BER_EVENT_DOWNLOAD_TAG = 0xd6; // Flags in Comprehension TLV. -this.COMPREHENSIONTLV_FLAG_CR = 0x80; // Comprehension required. +const COMPREHENSIONTLV_FLAG_CR = 0x80; // Comprehension required. // Tags for Comprehension TLV. -this.COMPREHENSIONTLV_TAG_COMMAND_DETAILS = 0x01; -this.COMPREHENSIONTLV_TAG_DEVICE_ID = 0x02; -this.COMPREHENSIONTLV_TAG_RESULT = 0x03; -this.COMPREHENSIONTLV_TAG_DURATION = 0x04; -this.COMPREHENSIONTLV_TAG_ALPHA_ID = 0x05; -this.COMPREHENSIONTLV_TAG_ADDRESS = 0x06; -this.COMPREHENSIONTLV_TAG_SUBADDRESS = 0x08; -this.COMPREHENSIONTLV_TAG_SMS_TPDU = 0x0b; -this.COMPREHENSIONTLV_TAG_TEXT_STRING = 0x0d; -this.COMPREHENSIONTLV_TAG_TONE = 0x0e; -this.COMPREHENSIONTLV_TAG_ITEM = 0x0f; -this.COMPREHENSIONTLV_TAG_ITEM_ID = 0x10; -this.COMPREHENSIONTLV_TAG_RESPONSE_LENGTH = 0x11; -this.COMPREHENSIONTLV_TAG_FILE_LIST = 0x12; -this.COMPREHENSIONTLV_TAG_LOCATION_INFO = 0x13; -this.COMPREHENSIONTLV_TAG_HELP_REQUEST = 0x15; -this.COMPREHENSIONTLV_TAG_DEFAULT_TEXT = 0x17; -this.COMPREHENSIONTLV_TAG_CAUSE = 0x1a; -this.COMPREHENSIONTLV_TAG_LOCATION_STATUS = 0x1b; -this.COMPREHENSIONTLV_TAG_TRANSACTION_ID = 0x1c; -this.COMPREHENSIONTLV_TAG_EVENT_LIST = 0x19; -this.COMPREHENSIONTLV_TAG_ICON_ID = 0x1e; -this.COMPREHENSIONTLV_TAG_ICON_ID_LIST = 0x1f; -this.COMPREHENSIONTLV_TAG_IMMEDIATE_RESPONSE = 0x2b; -this.COMPREHENSIONTLV_TAG_URL = 0x31; +const COMPREHENSIONTLV_TAG_COMMAND_DETAILS = 0x01; +const COMPREHENSIONTLV_TAG_DEVICE_ID = 0x02; +const COMPREHENSIONTLV_TAG_RESULT = 0x03; +const COMPREHENSIONTLV_TAG_DURATION = 0x04; +const COMPREHENSIONTLV_TAG_ALPHA_ID = 0x05; +const COMPREHENSIONTLV_TAG_ADDRESS = 0x06; +const COMPREHENSIONTLV_TAG_SUBADDRESS = 0x08; +const COMPREHENSIONTLV_TAG_SMS_TPDU = 0x0b; +const COMPREHENSIONTLV_TAG_TEXT_STRING = 0x0d; +const COMPREHENSIONTLV_TAG_TONE = 0x0e; +const COMPREHENSIONTLV_TAG_ITEM = 0x0f; +const COMPREHENSIONTLV_TAG_ITEM_ID = 0x10; +const COMPREHENSIONTLV_TAG_RESPONSE_LENGTH = 0x11; +const COMPREHENSIONTLV_TAG_FILE_LIST = 0x12; +const COMPREHENSIONTLV_TAG_LOCATION_INFO = 0x13; +const COMPREHENSIONTLV_TAG_HELP_REQUEST = 0x15; +const COMPREHENSIONTLV_TAG_DEFAULT_TEXT = 0x17; +const COMPREHENSIONTLV_TAG_CAUSE = 0x1a; +const COMPREHENSIONTLV_TAG_LOCATION_STATUS = 0x1b; +const COMPREHENSIONTLV_TAG_TRANSACTION_ID = 0x1c; +const COMPREHENSIONTLV_TAG_EVENT_LIST = 0x19; +const COMPREHENSIONTLV_TAG_ICON_ID = 0x1e; +const COMPREHENSIONTLV_TAG_ICON_ID_LIST = 0x1f; +const COMPREHENSIONTLV_TAG_IMMEDIATE_RESPONSE = 0x2b; +const COMPREHENSIONTLV_TAG_URL = 0x31; // Device identifiers, see TS 11.14, clause 12.7 -this.STK_DEVICE_ID_KEYPAD = 0x01; -this.STK_DEVICE_ID_DISPLAY = 0x02; -this.STK_DEVICE_ID_EARPIECE = 0x03; -this.STK_DEVICE_ID_SIM = 0x81; -this.STK_DEVICE_ID_ME = 0x82; -this.STK_DEVICE_ID_NETWORK = 0x83; +const STK_DEVICE_ID_KEYPAD = 0x01; +const STK_DEVICE_ID_DISPLAY = 0x02; +const STK_DEVICE_ID_EARPIECE = 0x03; +const STK_DEVICE_ID_SIM = 0x81; +const STK_DEVICE_ID_ME = 0x82; +const STK_DEVICE_ID_NETWORK = 0x83; // STK Proactive commands. -this.STK_CMD_REFRESH = 0x01; -this.STK_CMD_POLL_INTERVAL = 0x03; -this.STK_CMD_POLL_OFF = 0x04; -this.STK_CMD_SET_UP_EVENT_LIST = 0x05; -this.STK_CMD_SET_UP_CALL = 0x10; -this.STK_CMD_SEND_SS = 0x11; -this.STK_CMD_SEND_USSD = 0x12; -this.STK_CMD_SEND_SMS = 0x13; -this.STK_CMD_SEND_DTMF = 0x14; -this.STK_CMD_LAUNCH_BROWSER = 0x15; -this.STK_CMD_PLAY_TONE = 0x20; -this.STK_CMD_DISPLAY_TEXT = 0x21; -this.STK_CMD_GET_INKEY = 0x22; -this.STK_CMD_GET_INPUT = 0x23; -this.STK_CMD_SELECT_ITEM = 0x24; -this.STK_CMD_SET_UP_MENU = 0x25; -this.STK_CMD_SET_UP_IDLE_MODE_TEXT = 0x28; +const STK_CMD_REFRESH = 0x01; +const STK_CMD_POLL_INTERVAL = 0x03; +const STK_CMD_POLL_OFF = 0x04; +const STK_CMD_SET_UP_EVENT_LIST = 0x05; +const STK_CMD_SET_UP_CALL = 0x10; +const STK_CMD_SEND_SS = 0x11; +const STK_CMD_SEND_USSD = 0x12; +const STK_CMD_SEND_SMS = 0x13; +const STK_CMD_SEND_DTMF = 0x14; +const STK_CMD_LAUNCH_BROWSER = 0x15; +const STK_CMD_PLAY_TONE = 0x20; +const STK_CMD_DISPLAY_TEXT = 0x21; +const STK_CMD_GET_INKEY = 0x22; +const STK_CMD_GET_INPUT = 0x23; +const STK_CMD_SELECT_ITEM = 0x24; +const STK_CMD_SET_UP_MENU = 0x25; +const STK_CMD_SET_UP_IDLE_MODE_TEXT = 0x28; // STK Result code. // TS 11.14, clause 12.12 @@ -588,189 +588,189 @@ this.STK_CMD_SET_UP_IDLE_MODE_TEXT = 0x28; // Results '0X' and '1X' indicate that the command has been performed. // Command performed successfully. -this.STK_RESULT_OK = 0x00; +const STK_RESULT_OK = 0x00; // Command performed with partial comprehension. -this.STK_RESULT_PRFRMD_WITH_PARTIAL_COMPREHENSION = 0x01; +const STK_RESULT_PRFRMD_WITH_PARTIAL_COMPREHENSION = 0x01; // Command performed, with missing information. -this.STK_RESULT_PRFRMD_WITH_MISSING_INFO = 0x02; +const STK_RESULT_PRFRMD_WITH_MISSING_INFO = 0x02; // REFRESH performed with additional EFs read. -this.STK_RESULT_PRFRMD_WITH_ADDITIONAL_EFS_READ = 0x03; +const STK_RESULT_PRFRMD_WITH_ADDITIONAL_EFS_READ = 0x03; // Command performed successfully, but requested icon could not be // displayed. -this.STK_RESULT_PRFRMD_ICON_NOT_DISPLAYED = 0x04; +const STK_RESULT_PRFRMD_ICON_NOT_DISPLAYED = 0x04; // Command performed, but modified by call control by NAA. -this.STK_RESULT_PRFRMD_MODIFIED_BY_NAA = 0x05; +const STK_RESULT_PRFRMD_MODIFIED_BY_NAA = 0x05; // Command performed successfully, limited service. -this.STK_RESULT_PRFRMD_LIMITED_SERVICE = 0x06; +const STK_RESULT_PRFRMD_LIMITED_SERVICE = 0x06; // Command performed with modification. -this.STK_RESULT_PRFRMD_WITH_MODIFICATION = 0x07; +const STK_RESULT_PRFRMD_WITH_MODIFICATION = 0x07; // REFRESH performed but indicated NAA was not active. -this.STK_RESULT_PRFRMD_NAA_NOT_ACTIVE = 0x08; +const STK_RESULT_PRFRMD_NAA_NOT_ACTIVE = 0x08; // Command performed successfully; tone not played. -this.STK_RESULT_PRFRMD_TONE_NOT_PLAYED = 0x09; +const STK_RESULT_PRFRMD_TONE_NOT_PLAYED = 0x09; // Proactive UICC session terminated by the user. -this.STK_RESULT_UICC_SESSION_TERM_BY_USER = 0x10; +const STK_RESULT_UICC_SESSION_TERM_BY_USER = 0x10; // Backward move in the proactive UICC session requested by the user. -this.STK_RESULT_BACKWARD_MOVE_BY_USER = 0x11; +const STK_RESULT_BACKWARD_MOVE_BY_USER = 0x11; // No response from user. -this.STK_RESULT_NO_RESPONSE_FROM_USER = 0x12; +const STK_RESULT_NO_RESPONSE_FROM_USER = 0x12; // Help information required by the user. -this.STK_RESULT_HELP_INFO_REQUIRED = 0x13; +const STK_RESULT_HELP_INFO_REQUIRED = 0x13; // USSD or SS transaction terminated by the user. -this.STK_RESULT_USSD_SS_SESSION_TERM_BY_USER = 0x14; +const STK_RESULT_USSD_SS_SESSION_TERM_BY_USER = 0x14; // Results '2X' indicate to the UICC that it may be worth re-trying the // command at a later opportunity. // Terminal currently unable to process command. -this.STK_RESULT_TERMINAL_CRNTLY_UNABLE_TO_PROCESS = 0x20; +const STK_RESULT_TERMINAL_CRNTLY_UNABLE_TO_PROCESS = 0x20; // Network currently unable to process command. -this.STK_RESULT_NETWORK_CRNTLY_UNABLE_TO_PROCESS = 0x21; +const STK_RESULT_NETWORK_CRNTLY_UNABLE_TO_PROCESS = 0x21; // User did not accept the proactive command. -this.STK_RESULT_USER_NOT_ACCEPT = 0x22; +const STK_RESULT_USER_NOT_ACCEPT = 0x22; // User cleared down call before connection or network release. -this.STK_RESULT_USER_CLEAR_DOWN_CALL = 0x23; +const STK_RESULT_USER_CLEAR_DOWN_CALL = 0x23; // Action in contradiction with the current timer state. -this.STK_RESULT_CONTRADICTION_WITH_TIMER = 0x24; +const STK_RESULT_CONTRADICTION_WITH_TIMER = 0x24; // Interaction with call control by NAA; temporary problem. -this.STK_RESULT_NAA_CALL_CONTROL_TEMPORARY = 0x25; +const STK_RESULT_NAA_CALL_CONTROL_TEMPORARY = 0x25; // Launch browser generic error code. -this.STK_RESULT_LAUNCH_BROWSER_ERROR = 0x26; +const STK_RESULT_LAUNCH_BROWSER_ERROR = 0x26; // MMS temporary problem. -this.STK_RESULT_MMS_TEMPORARY = 0x27; +const STK_RESULT_MMS_TEMPORARY = 0x27; // Results '3X' indicate that it is not worth the UICC re-trying with an // identical command; as it will only get the same response. However, the // decision to retry lies with the application. // Command beyond terminal's capabilities. -this.STK_RESULT_BEYOND_TERMINAL_CAPABILITY = 0x30; +const STK_RESULT_BEYOND_TERMINAL_CAPABILITY = 0x30; // Command type not understood by terminal. -this.STK_RESULT_CMD_TYPE_NOT_UNDERSTOOD = 0x31; +const STK_RESULT_CMD_TYPE_NOT_UNDERSTOOD = 0x31; // Command data not understood by terminal. -this.STK_RESULT_CMD_DATA_NOT_UNDERSTOOD = 0x32; +const STK_RESULT_CMD_DATA_NOT_UNDERSTOOD = 0x32; // Command number not known by terminal. -this.STK_RESULT_CMD_NUM_NOT_KNOWN = 0x33; +const STK_RESULT_CMD_NUM_NOT_KNOWN = 0x33; // SS Return Error. -this.STK_RESULT_SS_RETURN_ERROR = 0x34; +const STK_RESULT_SS_RETURN_ERROR = 0x34; // SMS RP-ERROR. -this.STK_RESULT_SMS_RP_ERROR = 0x35; +const STK_RESULT_SMS_RP_ERROR = 0x35; // Error, required values are missing. -this.STK_RESULT_REQUIRED_VALUES_MISSING = 0x36; +const STK_RESULT_REQUIRED_VALUES_MISSING = 0x36; // USSD Return Error. -this.STK_RESULT_USSD_RETURN_ERROR = 0x37; +const STK_RESULT_USSD_RETURN_ERROR = 0x37; // MultipleCard commands error. -this.STK_RESULT_MULTI_CARDS_CMD_ERROR = 0x38; +const STK_RESULT_MULTI_CARDS_CMD_ERROR = 0x38; // Interaction with call control by USIM or MO short message control by // USIM; permanent problem. -this.STK_RESULT_USIM_CALL_CONTROL_PERMANENT = 0x39; +const STK_RESULT_USIM_CALL_CONTROL_PERMANENT = 0x39; // Bearer Independent Protocol error. -this.STK_RESULT_BIP_ERROR = 0x3a; +const STK_RESULT_BIP_ERROR = 0x3a; // Access Technology unable to process command. -this.STK_RESULT_ACCESS_TECH_UNABLE_TO_PROCESS = 0x3b; +const STK_RESULT_ACCESS_TECH_UNABLE_TO_PROCESS = 0x3b; // Frames error. -this.STK_RESULT_FRAMES_ERROR = 0x3c; +const STK_RESULT_FRAMES_ERROR = 0x3c; // MMS Error. -this.STK_RESULT_MMS_ERROR = 0x3d; +const STK_RESULT_MMS_ERROR = 0x3d; // STK presentation types, TS 11.14, clause 12.6, Command Qualifier: Select Item -this.STK_PRESENTATION_TYPE_NOT_SPECIFIED = 0x00; // Bit 1 is 0. -this.STK_PRESENTATION_TYPE_DATA_VALUES = 0x01; // Bit 1 is 1, bit 2 is 0. -this.STK_PRESENTATION_TYPE_NAVIGATION_OPTIONS = 0x03; // Bit 1 is 1, bit 2 is 1. +const STK_PRESENTATION_TYPE_NOT_SPECIFIED = 0x00; // Bit 1 is 0. +const STK_PRESENTATION_TYPE_DATA_VALUES = 0x01; // Bit 1 is 1, bit 2 is 0. +const STK_PRESENTATION_TYPE_NAVIGATION_OPTIONS = 0x03; // Bit 1 is 1, bit 2 is 1. // STK Coding Scheme. -this.STK_TEXT_CODING_GSM_7BIT_PACKED = 0x00; -this.STK_TEXT_CODING_GSM_8BIT = 0x04; -this.STK_TEXT_CODING_UCS2 = 0x08; +const STK_TEXT_CODING_GSM_7BIT_PACKED = 0x00; +const STK_TEXT_CODING_GSM_8BIT = 0x04; +const STK_TEXT_CODING_UCS2 = 0x08; // STK Event List. -this.STK_EVENT_TYPE_MT_CALL = 0x00; -this.STK_EVENT_TYPE_CALL_CONNECTED = 0x01; -this.STK_EVENT_TYPE_CALL_DISCONNECTED = 0x02; -this.STK_EVENT_TYPE_LOCATION_STATUS = 0x03; -this.STK_EVENT_TYPE_USER_ACTIVITY = 0x04; -this.STK_EVENT_TYPE_IDLE_SCREEN_AVAILABLE = 0x05; -this.STK_EVENT_TYPE_CARD_READER_STATUS = 0x06; -this.STK_EVENT_TYPE_LANGUAGE_SELECTION = 0x07; -this.STK_EVENT_TYPE_BROWSER_TERMINATION = 0x08; -this.STK_EVENT_TYPE_DATA_AVAILABLE = 0x09; -this.STK_EVENT_TYPE_CHANNEL_STATUS = 0x0a; -this.STK_EVENT_TYPE_SINGLE_ACCESS_TECHNOLOGY_CHANGED = 0x0b; -this.STK_EVENT_TYPE_DISPLAY_PARAMETER_CHANGED = 0x0c; -this.STK_EVENT_TYPE_LOCAL_CONNECTION = 0x0d; -this.STK_EVENT_TYPE_NETWORK_SEARCH_MODE_CHANGED = 0x0e; -this.STK_EVENT_TYPE_BROWSING_STATUS = 0x0f; +const STK_EVENT_TYPE_MT_CALL = 0x00; +const STK_EVENT_TYPE_CALL_CONNECTED = 0x01; +const STK_EVENT_TYPE_CALL_DISCONNECTED = 0x02; +const STK_EVENT_TYPE_LOCATION_STATUS = 0x03; +const STK_EVENT_TYPE_USER_ACTIVITY = 0x04; +const STK_EVENT_TYPE_IDLE_SCREEN_AVAILABLE = 0x05; +const STK_EVENT_TYPE_CARD_READER_STATUS = 0x06; +const STK_EVENT_TYPE_LANGUAGE_SELECTION = 0x07; +const STK_EVENT_TYPE_BROWSER_TERMINATION = 0x08; +const STK_EVENT_TYPE_DATA_AVAILABLE = 0x09; +const STK_EVENT_TYPE_CHANNEL_STATUS = 0x0a; +const STK_EVENT_TYPE_SINGLE_ACCESS_TECHNOLOGY_CHANGED = 0x0b; +const STK_EVENT_TYPE_DISPLAY_PARAMETER_CHANGED = 0x0c; +const STK_EVENT_TYPE_LOCAL_CONNECTION = 0x0d; +const STK_EVENT_TYPE_NETWORK_SEARCH_MODE_CHANGED = 0x0e; +const STK_EVENT_TYPE_BROWSING_STATUS = 0x0f; // STK Service state of Location Status. -this.STK_SERVICE_STATE_NORMAL = 0x00; -this.STK_SERVICE_STATE_LIMITED = 0x01; -this.STK_SERVICE_STATE_UNAVAILABLE = 0x02; +const STK_SERVICE_STATE_NORMAL = 0x00; +const STK_SERVICE_STATE_LIMITED = 0x01; +const STK_SERVICE_STATE_UNAVAILABLE = 0x02; // Refresh mode. -this.STK_REFRESH_NAA_INIT_AND_FULL_FILE_CHANGE = 0x00; -this.STK_REFRESH_FILE_CHANGE = 0x01; -this.STK_REFRESH_NAA_INIT_AND_FILE_CHANGE = 0x02; -this.STK_REFRESH_NAA_INIT = 0x03; -this.STK_REFRESH_UICC_RESET = 0x04; +const STK_REFRESH_NAA_INIT_AND_FULL_FILE_CHANGE = 0x00; +const STK_REFRESH_FILE_CHANGE = 0x01; +const STK_REFRESH_NAA_INIT_AND_FILE_CHANGE = 0x02; +const STK_REFRESH_NAA_INIT = 0x03; +const STK_REFRESH_UICC_RESET = 0x04; // Tone type. -this.STK_TONE_TYPE_DIAL_TONE = 0x01; -this.STK_TONE_TYPE_CALLED_SUBSCRIBER_BUSY = 0x02; -this.STK_TONE_TYPE_CONGESTION = 0x03; -this.STK_TONE_TYPE_RADIO_PATH_ACK = 0x04; -this.STK_TONE_TYPE_RADIO_PATH_NOT_AVAILABLE = 0x05; -this.STK_TONE_TYPE_ERROR = 0x06; -this.STK_TONE_TYPE_CALL_WAITING_TONE = 0x07; -this.STK_TONE_TYPE_RINGING_TONE = 0x08; -this.STK_TONE_TYPE_GENERAL_BEEP = 0x10; -this.STK_TONE_TYPE_POSITIVE_ACK_TONE = 0x11; -this.STK_TONE_TYPE_NEGATIVE_ACK_TONE = 0x12; +const STK_TONE_TYPE_DIAL_TONE = 0x01; +const STK_TONE_TYPE_CALLED_SUBSCRIBER_BUSY = 0x02; +const STK_TONE_TYPE_CONGESTION = 0x03; +const STK_TONE_TYPE_RADIO_PATH_ACK = 0x04; +const STK_TONE_TYPE_RADIO_PATH_NOT_AVAILABLE = 0x05; +const STK_TONE_TYPE_ERROR = 0x06; +const STK_TONE_TYPE_CALL_WAITING_TONE = 0x07; +const STK_TONE_TYPE_RINGING_TONE = 0x08; +const STK_TONE_TYPE_GENERAL_BEEP = 0x10; +const STK_TONE_TYPE_POSITIVE_ACK_TONE = 0x11; +const STK_TONE_TYPE_NEGATIVE_ACK_TONE = 0x12; // Time unit. -this.STK_TIME_UNIT_MINUTE = 0x00; -this.STK_TIME_UNIT_SECOND = 0x01; -this.STK_TIME_UNIT_TENTH_SECOND = 0x02; +const STK_TIME_UNIT_MINUTE = 0x00; +const STK_TIME_UNIT_SECOND = 0x01; +const STK_TIME_UNIT_TENTH_SECOND = 0x02; /** * (U)SIM Services. * * @see 3GPP TS 51.011 10.3.7 (SIM) and 3GPP TS 31.102 4.2.8 (USIM). */ -this.GECKO_ICC_SERVICES = { +const GECKO_ICC_SERVICES = { sim: { ADN: 2, FDN: 3, @@ -791,28 +791,28 @@ this.GECKO_ICC_SERVICES = { */ // PDU TYPE-OF-ADDRESS -this.PDU_TOA_UNKNOWN = 0x80; // Unknown. This is used when the user or +const PDU_TOA_UNKNOWN = 0x80; // Unknown. This is used when the user or // network has no a priori information // about the numbering plan. -this.PDU_TOA_ISDN = 0x81; // ISDN/Telephone numbering -this.PDU_TOA_DATA_NUM = 0x83; // Data numbering plan -this.PDU_TOA_TELEX_NUM = 0x84; // Telex numbering plan -this.PDU_TOA_NATIONAL_NUM = 0x88; // National numbering plan -this.PDU_TOA_PRIVATE_NUM = 0x89; // Private numbering plan -this.PDU_TOA_ERMES_NUM = 0x8A; // Ermes numbering plan -this.PDU_TOA_INTERNATIONAL = 0x90; // International number -this.PDU_TOA_NATIONAL = 0xA0; // National number. Prefix or escape digits +const PDU_TOA_ISDN = 0x81; // ISDN/Telephone numbering +const PDU_TOA_DATA_NUM = 0x83; // Data numbering plan +const PDU_TOA_TELEX_NUM = 0x84; // Telex numbering plan +const PDU_TOA_NATIONAL_NUM = 0x88; // National numbering plan +const PDU_TOA_PRIVATE_NUM = 0x89; // Private numbering plan +const PDU_TOA_ERMES_NUM = 0x8A; // Ermes numbering plan +const PDU_TOA_INTERNATIONAL = 0x90; // International number +const PDU_TOA_NATIONAL = 0xA0; // National number. Prefix or escape digits // shall not be included -this.PDU_TOA_NETWORK_SPEC = 0xB0; // Network specific number This is used to +const PDU_TOA_NETWORK_SPEC = 0xB0; // Network specific number This is used to // indicate administration/service number // specific to the serving network -this.PDU_TOA_SUBSCRIBER = 0xC0; // Subscriber number. This is used when a +const PDU_TOA_SUBSCRIBER = 0xC0; // Subscriber number. This is used when a // specific short number representation is // stored in one or more SCs as part of a // higher layer application -this.PDU_TOA_ALPHANUMERIC = 0xD0; // Alphanumeric, (coded according to GSM TS +const PDU_TOA_ALPHANUMERIC = 0xD0; // Alphanumeric, (coded according to GSM TS // 03.38 7-bit default alphabet) -this.PDU_TOA_ABBREVIATED = 0xE0; // Abbreviated number +const PDU_TOA_ABBREVIATED = 0xE0; // Abbreviated number /** * First octet of the SMS-DELIVER PDU @@ -843,220 +843,220 @@ this.PDU_TOA_ABBREVIATED = 0xE0; // Abbreviated number * 1 0 SMS-COMMAND (MS ==> SMSC) * 1 1 Reserved */ -this.PDU_RP = 0x80; // Reply path. Parameter indicating that +const PDU_RP = 0x80; // Reply path. Parameter indicating that // reply path exists. -this.PDU_UDHI = 0x40; // User data header indicator. This bit is +const PDU_UDHI = 0x40; // User data header indicator. This bit is // set to 1 if the User Data field starts // with a header -this.PDU_SRI_SRR = 0x20; // Status report indication (SMS-DELIVER) +const PDU_SRI_SRR = 0x20; // Status report indication (SMS-DELIVER) // or request (SMS-SUBMIT) -this.PDU_VPF_ABSOLUTE = 0x18;// Validity period aboslute format +const PDU_VPF_ABSOLUTE = 0x18;// Validity period aboslute format // (SMS-SUBMIT only) -this.PDU_VPF_RELATIVE = 0x10;// Validity period relative format +const PDU_VPF_RELATIVE = 0x10;// Validity period relative format // (SMS-SUBMIT only) -this.PDU_VPF_ENHANCED = 0x8; // Validity period enhance format +const PDU_VPF_ENHANCED = 0x8; // Validity period enhance format // (SMS-SUBMIT only) -this.PDU_MMS_RD = 0x04;// More messages to send. (SMS-DELIVER only) or +const PDU_MMS_RD = 0x04;// More messages to send. (SMS-DELIVER only) or // Reject duplicates (SMS-SUBMIT only) // MTI - Message Type Indicator -this.PDU_MTI_SMS_RESERVED = 0x03; -this.PDU_MTI_SMS_STATUS_REPORT = 0x02; -this.PDU_MTI_SMS_COMMAND = 0x02; -this.PDU_MTI_SMS_SUBMIT = 0x01; -this.PDU_MTI_SMS_DELIVER = 0x00; +const PDU_MTI_SMS_RESERVED = 0x03; +const PDU_MTI_SMS_STATUS_REPORT = 0x02; +const PDU_MTI_SMS_COMMAND = 0x02; +const PDU_MTI_SMS_SUBMIT = 0x01; +const PDU_MTI_SMS_DELIVER = 0x00; // PI - Parameter Indicator -this.PDU_PI_EXTENSION = 0x80; -this.PDU_PI_USER_DATA_LENGTH = 0x04; -this.PDU_PI_DATA_CODING_SCHEME = 0x02; -this.PDU_PI_PROTOCOL_IDENTIFIER = 0x01; -this.PDU_PI_RESERVED = 0x78; +const PDU_PI_EXTENSION = 0x80; +const PDU_PI_USER_DATA_LENGTH = 0x04; +const PDU_PI_DATA_CODING_SCHEME = 0x02; +const PDU_PI_PROTOCOL_IDENTIFIER = 0x01; +const PDU_PI_RESERVED = 0x78; // FCS - Failure Cause // 0...127 see 3GPP TS 24.011 clause E.2 // 128...255 see 3GPP TS 23.040 clause 9.2.3.22 // others see 3GPP TS 27.005 clause 3.2.5 -this.PDU_FCS_OK = 0x00; -this.PDU_FCS_PROTOCOL_ERROR = 0x6F; -this.PDU_FCS_MEMORY_CAPACITY_EXCEEDED = 0XD3; -this.PDU_FCS_USAT_BUSY = 0XD4; -this.PDU_FCS_USIM_DATA_DOWNLOAD_ERROR = 0xD5; -this.PDU_FCS_RESERVED = 0xE0; -this.PDU_FCS_UNSPECIFIED = 0xFF; +const PDU_FCS_OK = 0x00; +const PDU_FCS_PROTOCOL_ERROR = 0x6F; +const PDU_FCS_MEMORY_CAPACITY_EXCEEDED = 0XD3; +const PDU_FCS_USAT_BUSY = 0XD4; +const PDU_FCS_USIM_DATA_DOWNLOAD_ERROR = 0xD5; +const PDU_FCS_RESERVED = 0xE0; +const PDU_FCS_UNSPECIFIED = 0xFF; // ST - Status // Bit 7..0 = 000xxxxx, short message transaction completed -this.PDU_ST_0_RECEIVED = 0x00; -this.PDU_ST_0_FORWARDED_NO_CONFIRM = 0x01; -this.PDU_ST_0_REPLACED_BY_SC = 0x02; -this.PDU_ST_0_RESERVED_BEGIN = 0x03; -this.PDU_ST_0_SC_SPECIFIC_BEGIN = 0x10; -this.PDU_ST_0_SC_SPECIFIC_END = 0x1F; +const PDU_ST_0_RECEIVED = 0x00; +const PDU_ST_0_FORWARDED_NO_CONFIRM = 0x01; +const PDU_ST_0_REPLACED_BY_SC = 0x02; +const PDU_ST_0_RESERVED_BEGIN = 0x03; +const PDU_ST_0_SC_SPECIFIC_BEGIN = 0x10; +const PDU_ST_0_SC_SPECIFIC_END = 0x1F; // Bit 7..0 = 001xxxxx, temporary error, SC still trying to transfer SM -this.PDU_ST_1_CONGESTION = 0x20; -this.PDU_ST_1_SME_BUSY = 0x21; -this.PDU_ST_1_SME_NO_RESPONSE = 0x22; -this.PDU_ST_1_SERVICE_REJECTED = 0x23; -this.PDU_ST_1_QOS_UNAVAILABLE = 0x24; -this.PDU_ST_1_SME_ERROR = 0x25; -this.PDU_ST_1_RESERVED_BEGIN = 0x26; -this.PDU_ST_1_SC_SPECIFIC_BEGIN = 0x30; -this.PDU_ST_1_SC_SPECIFIC_END = 0x3F; +const PDU_ST_1_CONGESTION = 0x20; +const PDU_ST_1_SME_BUSY = 0x21; +const PDU_ST_1_SME_NO_RESPONSE = 0x22; +const PDU_ST_1_SERVICE_REJECTED = 0x23; +const PDU_ST_1_QOS_UNAVAILABLE = 0x24; +const PDU_ST_1_SME_ERROR = 0x25; +const PDU_ST_1_RESERVED_BEGIN = 0x26; +const PDU_ST_1_SC_SPECIFIC_BEGIN = 0x30; +const PDU_ST_1_SC_SPECIFIC_END = 0x3F; // Bit 7..0 = 010xxxxx, permanent error, SC is not making any more transfer // attempts -this.PDU_ST_2_RPC_ERROR = 0x40; -this.PDU_ST_2_DEST_INCOMPATIBLE = 0x41; -this.PDU_ST_2_CONNECTION_REJECTED = 0x42; -this.PDU_ST_2_NOT_OBTAINABLE = 0x43; -this.PDU_ST_2_QOS_UNAVAILABLE = 0x44; -this.PDU_ST_2_INTERWORKING_UNAVALIABLE = 0x45; -this.PDU_ST_2_VALIDITY_EXPIRED = 0x46; -this.PDU_ST_2_DELETED_BY_SME = 0x47; -this.PDU_ST_2_DELETED_BY_SC = 0x48; -this.PDU_ST_2_SM_MISSING = 0x49; -this.PDU_ST_2_RESERVED_BEGIN = 0x4A; -this.PDU_ST_2_SC_SPECIFIC_BEGIN = 0x50; -this.PDU_ST_2_SC_SPECIFIC_END = 0x5F; +const PDU_ST_2_RPC_ERROR = 0x40; +const PDU_ST_2_DEST_INCOMPATIBLE = 0x41; +const PDU_ST_2_CONNECTION_REJECTED = 0x42; +const PDU_ST_2_NOT_OBTAINABLE = 0x43; +const PDU_ST_2_QOS_UNAVAILABLE = 0x44; +const PDU_ST_2_INTERWORKING_UNAVALIABLE = 0x45; +const PDU_ST_2_VALIDITY_EXPIRED = 0x46; +const PDU_ST_2_DELETED_BY_SME = 0x47; +const PDU_ST_2_DELETED_BY_SC = 0x48; +const PDU_ST_2_SM_MISSING = 0x49; +const PDU_ST_2_RESERVED_BEGIN = 0x4A; +const PDU_ST_2_SC_SPECIFIC_BEGIN = 0x50; +const PDU_ST_2_SC_SPECIFIC_END = 0x5F; // Bit 7..0 = 011xxxxx, temporary error, SC is not making any more transfer // attempts -this.PDU_ST_3_CONGESTION = 0x60; -this.PDU_ST_3_SME_BUSY = 0x61; -this.PDU_ST_3_SME_NO_RESPONSE = 0x62; -this.PDU_ST_3_SERVICE_REJECTED = 0x63; -this.PDU_ST_3_QOS_UNAVAILABLE = 0x64; -this.PDU_ST_3_SME_ERROR = 0x65; -this.PDU_ST_3_RESERVED_BEGIN = 0x66; -this.PDU_ST_3_SC_SPECIFIC_BEGIN = 0x70; -this.PDU_ST_3_SC_SPECIFIC_END = 0x7F; +const PDU_ST_3_CONGESTION = 0x60; +const PDU_ST_3_SME_BUSY = 0x61; +const PDU_ST_3_SME_NO_RESPONSE = 0x62; +const PDU_ST_3_SERVICE_REJECTED = 0x63; +const PDU_ST_3_QOS_UNAVAILABLE = 0x64; +const PDU_ST_3_SME_ERROR = 0x65; +const PDU_ST_3_RESERVED_BEGIN = 0x66; +const PDU_ST_3_SC_SPECIFIC_BEGIN = 0x70; +const PDU_ST_3_SC_SPECIFIC_END = 0x7F; -this.GECKO_SMS_DELIVERY_STATUS_NOT_APPLICABLE = "not-applicable"; -this.GECKO_SMS_DELIVERY_STATUS_SUCCESS = "success"; -this.GECKO_SMS_DELIVERY_STATUS_PENDING = "pending"; -this.GECKO_SMS_DELIVERY_STATUS_ERROR = "error"; +const GECKO_SMS_DELIVERY_STATUS_NOT_APPLICABLE = "not-applicable"; +const GECKO_SMS_DELIVERY_STATUS_SUCCESS = "success"; +const GECKO_SMS_DELIVERY_STATUS_PENDING = "pending"; +const GECKO_SMS_DELIVERY_STATUS_ERROR = "error"; // User Data max length in septets -this.PDU_MAX_USER_DATA_7BIT = 160; +const PDU_MAX_USER_DATA_7BIT = 160; // User Data max length in octets -this.PDU_MAX_USER_DATA_8BIT = 140; +const PDU_MAX_USER_DATA_8BIT = 140; // User Data max length in chars -this.PDU_MAX_USER_DATA_UCS2 = 70; +const PDU_MAX_USER_DATA_UCS2 = 70; // PID - Protocol Indicator -this.PDU_PID_DEFAULT = 0x00; -this.PDU_PID_TELEMATIC_INTERWORKING = 0x20; -this.PDU_PID_SHORT_MESSAGE_TYPE_0 = 0x40; -this.PDU_PID_REPLACE_SHORT_MESSAGE_TYPE_1 = 0x41; -this.PDU_PID_REPLACE_SHORT_MESSAGE_TYPE_2 = 0x42; -this.PDU_PID_REPLACE_SHORT_MESSAGE_TYPE_3 = 0x43; -this.PDU_PID_REPLACE_SHORT_MESSAGE_TYPE_4 = 0x44; -this.PDU_PID_REPLACE_SHORT_MESSAGE_TYPE_5 = 0x45; -this.PDU_PID_REPLACE_SHORT_MESSAGE_TYPE_6 = 0x46; -this.PDU_PID_REPLACE_SHORT_MESSAGE_TYPE_7 = 0x47; -this.PDU_PID_ENHANDED_MESSAGE_SERVICE = 0x5E; -this.PDU_PID_RETURN_CALL_MESSAGE = 0x5F -this.PDU_PID_ANSI_136_R_DATA = 0x7C; -this.PDU_PID_ME_DATA_DOWNLOAD = 0x7D; -this.PDU_PID_ME_DEPERSONALIZATION = 0x7E; -this.PDU_PID_USIM_DATA_DOWNLOAD = 0x7F; +const PDU_PID_DEFAULT = 0x00; +const PDU_PID_TELEMATIC_INTERWORKING = 0x20; +const PDU_PID_SHORT_MESSAGE_TYPE_0 = 0x40; +const PDU_PID_REPLACE_SHORT_MESSAGE_TYPE_1 = 0x41; +const PDU_PID_REPLACE_SHORT_MESSAGE_TYPE_2 = 0x42; +const PDU_PID_REPLACE_SHORT_MESSAGE_TYPE_3 = 0x43; +const PDU_PID_REPLACE_SHORT_MESSAGE_TYPE_4 = 0x44; +const PDU_PID_REPLACE_SHORT_MESSAGE_TYPE_5 = 0x45; +const PDU_PID_REPLACE_SHORT_MESSAGE_TYPE_6 = 0x46; +const PDU_PID_REPLACE_SHORT_MESSAGE_TYPE_7 = 0x47; +const PDU_PID_ENHANDED_MESSAGE_SERVICE = 0x5E; +const PDU_PID_RETURN_CALL_MESSAGE = 0x5F +const PDU_PID_ANSI_136_R_DATA = 0x7C; +const PDU_PID_ME_DATA_DOWNLOAD = 0x7D; +const PDU_PID_ME_DEPERSONALIZATION = 0x7E; +const PDU_PID_USIM_DATA_DOWNLOAD = 0x7F; // DCS - Data Coding Scheme -this.PDU_DCS_MSG_CODING_7BITS_ALPHABET = 0x00; -this.PDU_DCS_MSG_CODING_8BITS_ALPHABET = 0x04; -this.PDU_DCS_MSG_CODING_16BITS_ALPHABET = 0x08; -this.PDU_DCS_MSG_CLASS_UNKNOWN = 0xFF; -this.PDU_DCS_MSG_CLASS_0 = 0x00; -this.PDU_DCS_MSG_CLASS_ME_SPECIFIC = 0x01; -this.PDU_DCS_MSG_CLASS_SIM_SPECIFIC = 0x02; -this.PDU_DCS_MSG_CLASS_TE_SPECIFIC = 0x03; -this.PDU_DCS_CODING_GROUP_BITS = 0xF0; -this.PDU_DCS_MSG_CLASS_BITS = 0x03; -this.PDU_DCS_MWI_ACTIVE_BITS = 0x08; -this.PDU_DCS_MWI_ACTIVE_VALUE = 0x08; -this.PDU_DCS_MWI_TYPE_BITS = 0x03; -this.PDU_DCS_MWI_TYPE_VOICEMAIL = 0x00; -this.PDU_DCS_MWI_TYPE_FAX = 0x01; -this.PDU_DCS_MWI_TYPE_EMAIL = 0x02; -this.PDU_DCS_MWI_TYPE_OTHER = 0x03; +const PDU_DCS_MSG_CODING_7BITS_ALPHABET = 0x00; +const PDU_DCS_MSG_CODING_8BITS_ALPHABET = 0x04; +const PDU_DCS_MSG_CODING_16BITS_ALPHABET = 0x08; +const PDU_DCS_MSG_CLASS_UNKNOWN = 0xFF; +const PDU_DCS_MSG_CLASS_0 = 0x00; +const PDU_DCS_MSG_CLASS_ME_SPECIFIC = 0x01; +const PDU_DCS_MSG_CLASS_SIM_SPECIFIC = 0x02; +const PDU_DCS_MSG_CLASS_TE_SPECIFIC = 0x03; +const PDU_DCS_CODING_GROUP_BITS = 0xF0; +const PDU_DCS_MSG_CLASS_BITS = 0x03; +const PDU_DCS_MWI_ACTIVE_BITS = 0x08; +const PDU_DCS_MWI_ACTIVE_VALUE = 0x08; +const PDU_DCS_MWI_TYPE_BITS = 0x03; +const PDU_DCS_MWI_TYPE_VOICEMAIL = 0x00; +const PDU_DCS_MWI_TYPE_FAX = 0x01; +const PDU_DCS_MWI_TYPE_EMAIL = 0x02; +const PDU_DCS_MWI_TYPE_OTHER = 0x03; // Because service center timestamp omit the century. Yay. -this.PDU_TIMESTAMP_YEAR_OFFSET = 2000; +const PDU_TIMESTAMP_YEAR_OFFSET = 2000; // See 9.2.3.24 TP‑User Data (TP‑UD) -this.PDU_IEI_CONCATENATED_SHORT_MESSAGES_8BIT = 0x00; -this.PDU_IEI_SPECIAL_SMS_MESSAGE_INDICATION = 0x01; -this.PDU_IEI_APPLICATION_PORT_ADDRESSING_SCHEME_8BIT = 0x04; -this.PDU_IEI_APPLICATION_PORT_ADDRESSING_SCHEME_16BIT = 0x05; -this.PDU_IEI_SMSC_CONTROL_PARAMS = 0x06; -this.PDU_IEI_UDH_SOURCE_INDICATOR = 0x07; -this.PDU_IEI_CONCATENATED_SHORT_MESSAGES_16BIT = 0x08; -this.PDU_IEI_WIRELESS_CONTROL_MESSAGE_PROTOCOL = 0x09; -this.PDU_IEI_TEXT_FORMATING = 0x0A; -this.PDU_IEI_PREDEFINED_SOUND = 0x0B; -this.PDU_IEI_USER_DATA_SOUND = 0x0C; -this.PDU_IEI_PREDEFINED_ANIMATION = 0x0D; -this.PDU_IEI_LARGE_ANIMATION = 0x0E; -this.PDU_IEI_SMALL_ANIMATION = 0x0F; -this.PDU_IEI_LARGE_PICTURE = 0x10; -this.PDU_IEI_SMALL_PICTURE = 0x11; -this.PDU_IEI_VARIABLE_PICTURE = 0x12; -this.PDU_IEI_USER_PROMPT_INDICATOR = 0x13; -this.PDU_IEI_EXTENDED_OBJECT = 0x14; -this.PDU_IEI_REUSED_EXTENDED_OBJECT = 0x15; -this.PDU_IEI_COMPRESS_CONTROL = 0x16; -this.PDU_IEI_OBJECT_DISTRIBUTION_INDICATOR = 0x17; -this.PDU_IEI_STANDARD_WVG_OBJECT = 0x18; -this.PDU_IEI_CHARACTER_SIZE_WVG_OBJECT = 0x19; -this.PDU_IEI_EXTENDED_OBJECT_DATA_REQUEST_COMMAND = 0x1A; -this.PDU_IEI_RFC822_EMAIL_HEADER = 0x20; -this.PDU_IEI_HYPERLINK_FORMAT_ELEMENT = 0x21; -this.PDU_IEI_REPLY_ADDRESS_ELEMENT = 0x22; -this.PDU_IEI_ENHANCED_VOICE_MAIL_INFORMATION = 0x23; -this.PDU_IEI_NATIONAL_LANGUAGE_SINGLE_SHIFT = 0x24; -this.PDU_IEI_NATIONAL_LANGUAGE_LOCKING_SHIFT = 0x25; +const PDU_IEI_CONCATENATED_SHORT_MESSAGES_8BIT = 0x00; +const PDU_IEI_SPECIAL_SMS_MESSAGE_INDICATION = 0x01; +const PDU_IEI_APPLICATION_PORT_ADDRESSING_SCHEME_8BIT = 0x04; +const PDU_IEI_APPLICATION_PORT_ADDRESSING_SCHEME_16BIT = 0x05; +const PDU_IEI_SMSC_CONTROL_PARAMS = 0x06; +const PDU_IEI_UDH_SOURCE_INDICATOR = 0x07; +const PDU_IEI_CONCATENATED_SHORT_MESSAGES_16BIT = 0x08; +const PDU_IEI_WIRELESS_CONTROL_MESSAGE_PROTOCOL = 0x09; +const PDU_IEI_TEXT_FORMATING = 0x0A; +const PDU_IEI_PREDEFINED_SOUND = 0x0B; +const PDU_IEI_USER_DATA_SOUND = 0x0C; +const PDU_IEI_PREDEFINED_ANIMATION = 0x0D; +const PDU_IEI_LARGE_ANIMATION = 0x0E; +const PDU_IEI_SMALL_ANIMATION = 0x0F; +const PDU_IEI_LARGE_PICTURE = 0x10; +const PDU_IEI_SMALL_PICTURE = 0x11; +const PDU_IEI_VARIABLE_PICTURE = 0x12; +const PDU_IEI_USER_PROMPT_INDICATOR = 0x13; +const PDU_IEI_EXTENDED_OBJECT = 0x14; +const PDU_IEI_REUSED_EXTENDED_OBJECT = 0x15; +const PDU_IEI_COMPRESS_CONTROL = 0x16; +const PDU_IEI_OBJECT_DISTRIBUTION_INDICATOR = 0x17; +const PDU_IEI_STANDARD_WVG_OBJECT = 0x18; +const PDU_IEI_CHARACTER_SIZE_WVG_OBJECT = 0x19; +const PDU_IEI_EXTENDED_OBJECT_DATA_REQUEST_COMMAND = 0x1A; +const PDU_IEI_RFC822_EMAIL_HEADER = 0x20; +const PDU_IEI_HYPERLINK_FORMAT_ELEMENT = 0x21; +const PDU_IEI_REPLY_ADDRESS_ELEMENT = 0x22; +const PDU_IEI_ENHANCED_VOICE_MAIL_INFORMATION = 0x23; +const PDU_IEI_NATIONAL_LANGUAGE_SINGLE_SHIFT = 0x24; +const PDU_IEI_NATIONAL_LANGUAGE_LOCKING_SHIFT = 0x25; // Application Port Addressing, see 3GPP TS 23.040 9.2.3.24.3 -this.PDU_APA_RESERVED_8BIT_PORTS = 240; -this.PDU_APA_VALID_16BIT_PORTS = 49152; +const PDU_APA_RESERVED_8BIT_PORTS = 240; +const PDU_APA_VALID_16BIT_PORTS = 49152; // 7bit alphabet escape character. The encoded value of this code point is left // undefined in official spec. Its code value is internally assigned to \uffff, // in Unicode basic multilingual plane. -this.PDU_NL_EXTENDED_ESCAPE = 0x1B; +const PDU_NL_EXTENDED_ESCAPE = 0x1B; // , , are only defined in locking shift tables. -this.PDU_NL_SPACE = 0x20; -this.PDU_NL_LINE_FEED = 0x0A; -this.PDU_NL_CARRIAGE_RETURN = 0x0D; +const PDU_NL_SPACE = 0x20; +const PDU_NL_LINE_FEED = 0x0A; +const PDU_NL_CARRIAGE_RETURN = 0x0D; // 7bit alphabet page break character, only defined in single shift tables. // The encoded value of this code point is left undefined in official spec, but // the code point itself maybe be used for example in compressed CBS messages. // Its code value is internally assigned to \u000c, ASCII form feed, or new page. -this.PDU_NL_PAGE_BREAK = 0x0A; +const PDU_NL_PAGE_BREAK = 0x0A; // 7bit alphabet reserved control character, only defined in single shift // tables. The encoded value of this code point is left undefined in official // spec. Its code value is internally assigned to \ufffe, // in Unicode basic multilingual plane. -this.PDU_NL_RESERVED_CONTROL = 0x0D; +const PDU_NL_RESERVED_CONTROL = 0x0D; -this.PDU_NL_IDENTIFIER_DEFAULT = 0; -this.PDU_NL_IDENTIFIER_TURKISH = 1; -this.PDU_NL_IDENTIFIER_SPANISH = 2; -this.PDU_NL_IDENTIFIER_PORTUGUESE = 3; -this.PDU_NL_IDENTIFIER_BENGALI = 4; -this.PDU_NL_IDENTIFIER_GUJARATI = 5; -this.PDU_NL_IDENTIFIER_HINDI = 6; -this.PDU_NL_IDENTIFIER_KANNADA = 7; -this.PDU_NL_IDENTIFIER_MALAYALAM = 8; -this.PDU_NL_IDENTIFIER_ORIYA = 9; -this.PDU_NL_IDENTIFIER_PUNJABI = 10; -this.PDU_NL_IDENTIFIER_TAMIL = 11; -this.PDU_NL_IDENTIFIER_TELUGU = 12; -this.PDU_NL_IDENTIFIER_URDU = 13; +const PDU_NL_IDENTIFIER_DEFAULT = 0; +const PDU_NL_IDENTIFIER_TURKISH = 1; +const PDU_NL_IDENTIFIER_SPANISH = 2; +const PDU_NL_IDENTIFIER_PORTUGUESE = 3; +const PDU_NL_IDENTIFIER_BENGALI = 4; +const PDU_NL_IDENTIFIER_GUJARATI = 5; +const PDU_NL_IDENTIFIER_HINDI = 6; +const PDU_NL_IDENTIFIER_KANNADA = 7; +const PDU_NL_IDENTIFIER_MALAYALAM = 8; +const PDU_NL_IDENTIFIER_ORIYA = 9; +const PDU_NL_IDENTIFIER_PUNJABI = 10; +const PDU_NL_IDENTIFIER_TAMIL = 11; +const PDU_NL_IDENTIFIER_TELUGU = 12; +const PDU_NL_IDENTIFIER_URDU = 13; // National Language Locking Shift Tables, see 3GPP TS 23.038 -this.PDU_NL_LOCKING_SHIFT_TABLES = [ +const PDU_NL_LOCKING_SHIFT_TABLES = [ /** * National Language Identifier: 0x00 * 6.2.1 GSM 7 bit Default Alphabet @@ -1353,7 +1353,7 @@ this.PDU_NL_LOCKING_SHIFT_TABLES = [ ]; // National Language Single Shift Tables, see 3GPP TS 23.038 -this.PDU_NL_SINGLE_SHIFT_TABLES = [ +const PDU_NL_SINGLE_SHIFT_TABLES = [ /** * National Language Identifier: 0x00 * 6.2.1.1 GSM 7 bit default alphabet extension table @@ -1650,11 +1650,11 @@ this.PDU_NL_SINGLE_SHIFT_TABLES = [ ]; // Special SMS Message Indication constants -this.PDU_MWI_STORE_TYPE_BIT = 0x80; -this.PDU_MWI_STORE_TYPE_DISCARD = 0x00; -this.PDU_MWI_STORE_TYPE_STORE = 0x80; +const PDU_MWI_STORE_TYPE_BIT = 0x80; +const PDU_MWI_STORE_TYPE_DISCARD = 0x00; +const PDU_MWI_STORE_TYPE_STORE = 0x80; -this.GSM_SMS_STRICT_7BIT_CHARMAP = { +const GSM_SMS_STRICT_7BIT_CHARMAP = { "\u00C1": "\u0041", // Á(\u00C1) => A(\u0041) "\u00E1": "\u0061", // á(\u00E1) => a(\u0061) "\u00CD": "\u0049", // Í(\u00CD) => I(\u0049) @@ -1666,108 +1666,108 @@ this.GSM_SMS_STRICT_7BIT_CHARMAP = { "\u00E7": "\u00C7" // ç(\u00E7) => Ç(\u00C7) }; -this.RADIOTECH_FAMILY_3GPP = 1; // GSM, WCDMA, LTE -this.RADIOTECH_FAMILY_3GPP2 = 2; // CDMA, EVDO +const RADIOTECH_FAMILY_3GPP = 1; // GSM, WCDMA, LTE +const RADIOTECH_FAMILY_3GPP2 = 2; // CDMA, EVDO -this.DATACALL_RADIOTECHNOLOGY_CDMA = 0; -this.DATACALL_RADIOTECHNOLOGY_GSM = 1; +const DATACALL_RADIOTECHNOLOGY_CDMA = 0; +const DATACALL_RADIOTECHNOLOGY_GSM = 1; -this.DATACALL_AUTH_NONE = 0; -this.DATACALL_AUTH_PAP = 1; -this.DATACALL_AUTH_CHAP = 2; -this.DATACALL_AUTH_PAP_OR_CHAP = 3; +const DATACALL_AUTH_NONE = 0; +const DATACALL_AUTH_PAP = 1; +const DATACALL_AUTH_CHAP = 2; +const DATACALL_AUTH_PAP_OR_CHAP = 3; -this.DATACALL_PROFILE_DEFAULT = 0; -this.DATACALL_PROFILE_TETHERED = 1; -this.DATACALL_PROFILE_OEM_BASE = 1000; +const DATACALL_PROFILE_DEFAULT = 0; +const DATACALL_PROFILE_TETHERED = 1; +const DATACALL_PROFILE_OEM_BASE = 1000; -this.DATACALL_DEACTIVATE_NO_REASON = 0; -this.DATACALL_DEACTIVATE_RADIO_SHUTDOWN = 1; +const DATACALL_DEACTIVATE_NO_REASON = 0; +const DATACALL_DEACTIVATE_RADIO_SHUTDOWN = 1; -this.DATACALL_ACTIVE_UNKNOWN = -1; -this.DATACALL_INACTIVE = 0; -this.DATACALL_ACTIVE_DOWN = 1; -this.DATACALL_ACTIVE_UP = 2; +const DATACALL_ACTIVE_UNKNOWN = -1; +const DATACALL_INACTIVE = 0; +const DATACALL_ACTIVE_DOWN = 1; +const DATACALL_ACTIVE_UP = 2; -this.DATACALL_FAIL_NONE = 0; -this.DATACALL_FAIL_OPERATOR_BARRED = 0x08; -this.DATACALL_FAIL_INSUFFICIENT_RESOURCES = 0x1A; -this.DATACALL_FAIL_MISSING_UKNOWN_APN = 0x1B; -this.DATACALL_FAIL_UNKNOWN_PDP_ADDRESS_TYPE = 0x1C; -this.DATACALL_FAIL_USER_AUTHENTICATION = 0x1D; -this.DATACALL_FAIL_ACTIVATION_REJECT_GGSN = 0x1E; -this.DATACALL_FAIL_ACTIVATION_REJECT_UNSPECIFIED = 0x1F; -this.DATACALL_FAIL_SERVICE_OPTION_NOT_SUPPORTED = 0x20; -this.DATACALL_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED = 0x21; -this.DATACALL_FAIL_SERVICE_OPTION_OUT_OF_ORDER = 0x22; -this.DATACALL_FAIL_NSAPI_IN_USE = 0x23; -this.DATACALL_FAIL_ONLY_IPV4_ALLOWED = 0x32; -this.DATACALL_FAIL_ONLY_IPV6_ALLOWED = 0x33; -this.DATACALL_FAIL_ONLY_SINGLE_BEARER_ALLOWED = 0x34; -this.DATACALL_FAIL_PROTOCOL_ERRORS = 0x6F; -this.DATACALL_FAIL_VOICE_REGISTRATION_FAIL = -1; -this.DATACALL_FAIL_DATA_REGISTRATION_FAIL = -2; -this.DATACALL_FAIL_SIGNAL_LOST = -3; -this.DATACALL_FAIL_PREF_RADIO_TECH_CHANGED = -4; -this.DATACALL_FAIL_RADIO_POWER_OFF = -5; -this.DATACALL_FAIL_TETHERED_CALL_ACTIVE = -6; -this.DATACALL_FAIL_ERROR_UNSPECIFIED = 0xffff; +const DATACALL_FAIL_NONE = 0; +const DATACALL_FAIL_OPERATOR_BARRED = 0x08; +const DATACALL_FAIL_INSUFFICIENT_RESOURCES = 0x1A; +const DATACALL_FAIL_MISSING_UKNOWN_APN = 0x1B; +const DATACALL_FAIL_UNKNOWN_PDP_ADDRESS_TYPE = 0x1C; +const DATACALL_FAIL_USER_AUTHENTICATION = 0x1D; +const DATACALL_FAIL_ACTIVATION_REJECT_GGSN = 0x1E; +const DATACALL_FAIL_ACTIVATION_REJECT_UNSPECIFIED = 0x1F; +const DATACALL_FAIL_SERVICE_OPTION_NOT_SUPPORTED = 0x20; +const DATACALL_FAIL_SERVICE_OPTION_NOT_SUBSCRIBED = 0x21; +const DATACALL_FAIL_SERVICE_OPTION_OUT_OF_ORDER = 0x22; +const DATACALL_FAIL_NSAPI_IN_USE = 0x23; +const DATACALL_FAIL_ONLY_IPV4_ALLOWED = 0x32; +const DATACALL_FAIL_ONLY_IPV6_ALLOWED = 0x33; +const DATACALL_FAIL_ONLY_SINGLE_BEARER_ALLOWED = 0x34; +const DATACALL_FAIL_PROTOCOL_ERRORS = 0x6F; +const DATACALL_FAIL_VOICE_REGISTRATION_FAIL = -1; +const DATACALL_FAIL_DATA_REGISTRATION_FAIL = -2; +const DATACALL_FAIL_SIGNAL_LOST = -3; +const DATACALL_FAIL_PREF_RADIO_TECH_CHANGED = -4; +const DATACALL_FAIL_RADIO_POWER_OFF = -5; +const DATACALL_FAIL_TETHERED_CALL_ACTIVE = -6; +const DATACALL_FAIL_ERROR_UNSPECIFIED = 0xffff; // Keep consistent with nsINetworkManager.NETWORK_STATE_*. -this.GECKO_NETWORK_STATE_UNKNOWN = -1; -this.GECKO_NETWORK_STATE_CONNECTING = 0; -this.GECKO_NETWORK_STATE_CONNECTED = 1; -this.GECKO_NETWORK_STATE_DISCONNECTING = 2; -this.GECKO_NETWORK_STATE_DISCONNECTED = 3; +const GECKO_NETWORK_STATE_UNKNOWN = -1; +const GECKO_NETWORK_STATE_CONNECTING = 0; +const GECKO_NETWORK_STATE_CONNECTED = 1; +const GECKO_NETWORK_STATE_DISCONNECTING = 2; +const GECKO_NETWORK_STATE_DISCONNECTED = 3; // Used for QUERY_AVAILABLE_NETWORKS status of "unknown" -this.GECKO_QAN_STATE_UNKNOWN = null; +const GECKO_QAN_STATE_UNKNOWN = null; -this.CALL_FAIL_UNOBTAINABLE_NUMBER = 1; -this.CALL_FAIL_NORMAL = 16; -this.CALL_FAIL_BUSY = 17; -this.CALL_FAIL_NO_USER_RESPONDING = 18; -this.CALL_FAIL_USER_ALERTING = 19; -this.CALL_FAIL_CALL_REJECTED = 21; -this.CALL_FAIL_NUMBER_CHANGED = 22; -this.CALL_FAIL_CALL_PRE_EMPTION = 25; -this.CALL_FAIL_DEST_OUT_OF_ORDER = 27; -this.CALL_FAIL_INVALID_FORMAT = 28; -this.CALL_FAIL_FACILITY_REJECTED = 29; -this.CALL_FAIL_CONGESTION = 34; -this.CALL_FAIL_NETWORK_OUT_OF_ORDER = 38; -this.CALL_FAIL_NETWORK_TEMP_FAILURE = 41; -this.CALL_FAIL_ACM_LIMIT_EXCEEDED = 68; -this.CALL_FAIL_CALL_BARRED = 240; -this.CALL_FAIL_FDN_BLOCKED = 241; -this.CALL_FAIL_IMSI_UNKNOWN_IN_VLR = 242; -this.CALL_FAIL_IMEI_NOT_ACCEPTED = 243; -this.CALL_FAIL_ERROR_UNSPECIFIED = 0xffff; +const CALL_FAIL_UNOBTAINABLE_NUMBER = 1; +const CALL_FAIL_NORMAL = 16; +const CALL_FAIL_BUSY = 17; +const CALL_FAIL_NO_USER_RESPONDING = 18; +const CALL_FAIL_USER_ALERTING = 19; +const CALL_FAIL_CALL_REJECTED = 21; +const CALL_FAIL_NUMBER_CHANGED = 22; +const CALL_FAIL_CALL_PRE_EMPTION = 25; +const CALL_FAIL_DEST_OUT_OF_ORDER = 27; +const CALL_FAIL_INVALID_FORMAT = 28; +const CALL_FAIL_FACILITY_REJECTED = 29; +const CALL_FAIL_CONGESTION = 34; +const CALL_FAIL_NETWORK_OUT_OF_ORDER = 38; +const CALL_FAIL_NETWORK_TEMP_FAILURE = 41; +const CALL_FAIL_ACM_LIMIT_EXCEEDED = 68; +const CALL_FAIL_CALL_BARRED = 240; +const CALL_FAIL_FDN_BLOCKED = 241; +const CALL_FAIL_IMSI_UNKNOWN_IN_VLR = 242; +const CALL_FAIL_IMEI_NOT_ACCEPTED = 243; +const CALL_FAIL_ERROR_UNSPECIFIED = 0xffff; // Other Gecko-specific constants -this.GECKO_RADIOSTATE_UNAVAILABLE = null; -this.GECKO_RADIOSTATE_OFF = "off"; -this.GECKO_RADIOSTATE_READY = "ready"; +const GECKO_RADIOSTATE_UNAVAILABLE = null; +const GECKO_RADIOSTATE_OFF = "off"; +const GECKO_RADIOSTATE_READY = "ready"; -this.GECKO_CARDSTATE_UNAVAILABLE = null; -this.GECKO_CARDSTATE_ABSENT = "absent"; -this.GECKO_CARDSTATE_PIN_REQUIRED = "pinRequired"; -this.GECKO_CARDSTATE_PUK_REQUIRED = "pukRequired"; -this.GECKO_CARDSTATE_NETWORK_LOCKED = "networkLocked"; -this.GECKO_CARDSTATE_NOT_READY = null; -this.GECKO_CARDSTATE_READY = "ready"; +const GECKO_CARDSTATE_UNAVAILABLE = null; +const GECKO_CARDSTATE_ABSENT = "absent"; +const GECKO_CARDSTATE_PIN_REQUIRED = "pinRequired"; +const GECKO_CARDSTATE_PUK_REQUIRED = "pukRequired"; +const GECKO_CARDSTATE_NETWORK_LOCKED = "networkLocked"; +const GECKO_CARDSTATE_NOT_READY = null; +const GECKO_CARDSTATE_READY = "ready"; -this.GECKO_NETWORK_SELECTION_UNKNOWN = null; -this.GECKO_NETWORK_SELECTION_AUTOMATIC = "automatic"; -this.GECKO_NETWORK_SELECTION_MANUAL = "manual"; +const GECKO_NETWORK_SELECTION_UNKNOWN = null; +const GECKO_NETWORK_SELECTION_AUTOMATIC = "automatic"; +const GECKO_NETWORK_SELECTION_MANUAL = "manual"; -this.GECKO_MOBILE_CONNECTION_STATE_UNKNOWN = null; -this.GECKO_MOBILE_CONNECTION_STATE_NOTSEARCHING = "notSearching"; -this.GECKO_MOBILE_CONNECTION_STATE_SEARCHING = "searching"; -this.GECKO_MOBILE_CONNECTION_STATE_REGISTERED = "registered"; -this.GECKO_MOBILE_CONNECTION_STATE_DENIED = "denied"; +const GECKO_MOBILE_CONNECTION_STATE_UNKNOWN = null; +const GECKO_MOBILE_CONNECTION_STATE_NOTSEARCHING = "notSearching"; +const GECKO_MOBILE_CONNECTION_STATE_SEARCHING = "searching"; +const GECKO_MOBILE_CONNECTION_STATE_REGISTERED = "registered"; +const GECKO_MOBILE_CONNECTION_STATE_DENIED = "denied"; -this.NETWORK_CREG_TO_GECKO_MOBILE_CONNECTION_STATE = {}; +const NETWORK_CREG_TO_GECKO_MOBILE_CONNECTION_STATE = {}; NETWORK_CREG_TO_GECKO_MOBILE_CONNECTION_STATE[NETWORK_CREG_STATE_NOT_SEARCHING] = GECKO_MOBILE_CONNECTION_STATE_NOTSEARCHING; NETWORK_CREG_TO_GECKO_MOBILE_CONNECTION_STATE[NETWORK_CREG_STATE_REGISTERED_HOME] = GECKO_MOBILE_CONNECTION_STATE_REGISTERED; NETWORK_CREG_TO_GECKO_MOBILE_CONNECTION_STATE[NETWORK_CREG_STATE_SEARCHING] = GECKO_MOBILE_CONNECTION_STATE_REGISTERED; @@ -1780,28 +1780,28 @@ NETWORK_CREG_TO_GECKO_MOBILE_CONNECTION_STATE[NETWORK_CREG_STATE_DENIED_EMERGENC NETWORK_CREG_TO_GECKO_MOBILE_CONNECTION_STATE[NETWORK_CREG_STATE_UNKNOWN_EMERGENCY_CALLS] = GECKO_MOBILE_CONNECTION_STATE_UNKNOWN; -this.GECKO_CALL_ERROR_BAD_NUMBER = "BadNumberError"; -this.GECKO_CALL_ERROR_NORMAL_CALL_CLEARING = "NormalCallClearingError"; -this.GECKO_CALL_ERROR_BUSY = "BusyError"; -this.GECKO_CALL_ERROR_NO_USER_RESPONDING = "NoUserRespondingError"; -this.GECKO_CALL_ERROR_USER_ALERTING = "UserAlertingNoAnswerError"; -this.GECKO_CALL_ERROR_REJECTED = "CallRejectedError"; -this.GECKO_CALL_ERROR_NUMBER_CHANGED = "NumberChangedError"; -this.GECKO_CALL_ERROR_PRE_EMPTION = "PreEmptionError"; -this.GECKO_CALL_ERROR_DEST_OUT_OF_ORDER = "DestinationOutOfOrderError"; -this.GECKO_CALL_ERROR_INVALID_NUMBER_FORMAT = "InvalidNumberFormatError"; -this.GECKO_CALL_ERROR_FACILITY_REJECTED = "FacilityRejectedError"; -this.GECKO_CALL_ERROR_CONGESTION = "CongestionError"; -this.GECKO_CALL_ERROR_NETWORK_OUT_OF_ORDER = "NetworkOutOfOrderError"; -this.GECKO_CALL_ERROR_NETWORK_TEMP_FAILURE = "NetworkTempFailureError"; -this.GECKO_CALL_ERROR_INCOMING_CALL_EXCEEDED = "IncomingCallExceededError"; -this.GECKO_CALL_ERROR_BARRED = "BarredError"; -this.GECKO_CALL_ERROR_FDN_BLOCKED = "FDNBlockedError"; -this.GECKO_CALL_ERROR_SUBSCRIBER_UNKNOWN = "SubscriberUnknownError"; -this.GECKO_CALL_ERROR_DEVICE_NOT_ACCEPTED = "DeviceNotAcceptedError"; -this.GECKO_CALL_ERROR_UNSPECIFIED = "UnspecifiedError"; +const GECKO_CALL_ERROR_BAD_NUMBER = "BadNumberError"; +const GECKO_CALL_ERROR_NORMAL_CALL_CLEARING = "NormalCallClearingError"; +const GECKO_CALL_ERROR_BUSY = "BusyError"; +const GECKO_CALL_ERROR_NO_USER_RESPONDING = "NoUserRespondingError"; +const GECKO_CALL_ERROR_USER_ALERTING = "UserAlertingNoAnswerError"; +const GECKO_CALL_ERROR_REJECTED = "CallRejectedError"; +const GECKO_CALL_ERROR_NUMBER_CHANGED = "NumberChangedError"; +const GECKO_CALL_ERROR_PRE_EMPTION = "PreEmptionError"; +const GECKO_CALL_ERROR_DEST_OUT_OF_ORDER = "DestinationOutOfOrderError"; +const GECKO_CALL_ERROR_INVALID_NUMBER_FORMAT = "InvalidNumberFormatError"; +const GECKO_CALL_ERROR_FACILITY_REJECTED = "FacilityRejectedError"; +const GECKO_CALL_ERROR_CONGESTION = "CongestionError"; +const GECKO_CALL_ERROR_NETWORK_OUT_OF_ORDER = "NetworkOutOfOrderError"; +const GECKO_CALL_ERROR_NETWORK_TEMP_FAILURE = "NetworkTempFailureError"; +const GECKO_CALL_ERROR_INCOMING_CALL_EXCEEDED = "IncomingCallExceededError"; +const GECKO_CALL_ERROR_BARRED = "BarredError"; +const GECKO_CALL_ERROR_FDN_BLOCKED = "FDNBlockedError"; +const GECKO_CALL_ERROR_SUBSCRIBER_UNKNOWN = "SubscriberUnknownError"; +const GECKO_CALL_ERROR_DEVICE_NOT_ACCEPTED = "DeviceNotAcceptedError"; +const GECKO_CALL_ERROR_UNSPECIFIED = "UnspecifiedError"; -this.RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR = {}; +const RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR = {}; RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR[CALL_FAIL_UNOBTAINABLE_NUMBER] = GECKO_CALL_ERROR_BAD_NUMBER; RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR[CALL_FAIL_NORMAL] = GECKO_CALL_ERROR_NORMAL_CALL_CLEARING; RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR[CALL_FAIL_BUSY] = GECKO_CALL_ERROR_BUSY; @@ -1823,30 +1823,30 @@ RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR[CALL_FAIL_IMSI_UNKNOWN_IN_VLR] = GECKO_CA RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR[CALL_FAIL_IMEI_NOT_ACCEPTED] = GECKO_CALL_ERROR_DEVICE_NOT_ACCEPTED; RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR[CALL_FAIL_ERROR_UNSPECIFIED] = GECKO_CALL_ERROR_UNSPECIFIED; -this.GECKO_DATACALL_ERROR_OPERATOR_BARRED = "OperatorBarredError"; -this.GECKO_DATACALL_ERROR_INSUFFICIENT_RESOURCES = "InsufficientResourcesError"; -this.GECKO_DATACALL_ERROR_MISSING_UKNOWN_APN = "MissingUnknownAPNError"; -this.GECKO_DATACALL_ERROR_UNKNOWN_PDP_ADDRESS_TYPE = "UnknownPDPAddressTypeError"; -this.GECKO_DATACALL_ERROR_USER_AUTHENTICATION = "UserAuthenticationError"; -this.GECKO_DATACALL_ERROR_ACTIVATION_REJECT_GGSN = "ActivationRejectGGSNError"; -this.GECKO_DATACALL_ERROR_ACTIVATION_REJECT_UNSPECIFIED = "ActivationRejectUnspecifiedError"; -this.GECKO_DATACALL_ERROR_SERVICE_OPTION_NOT_SUPPORTED = "ServiceOptionNotSupportedError"; -this.GECKO_DATACALL_ERROR_SERVICE_OPTION_NOT_SUBSCRIBED = "ServiceOptionNotSubscribedError"; -this.GECKO_DATACALL_ERROR_SERVICE_OPTION_OUT_OF_ORDER = "ServiceOptionOutOfOrderError"; -this.GECKO_DATACALL_ERROR_NSAPI_IN_USE = "NSAPIInUseError"; -this.GECKO_DATACALL_ERROR_ONLY_IPV4_ALLOWED = "OnlyIPv4Error"; -this.GECKO_DATACALL_ERROR_ONLY_IPV6_ALLOWED = "OnlyIPv6Error"; -this.GECKO_DATACALL_ERROR_ONLY_SINGLE_BEARER_ALLOWED = "OnlySingleBearerAllowedError"; -this.GECKO_DATACALL_ERROR_PROTOCOL_ERRORS = "ProtocolErrorsError"; -this.GECKO_DATACALL_ERROR_VOICE_REGISTRATION_FAIL = "VoiceRegistrationFailError"; -this.GECKO_DATACALL_ERROR_DATA_REGISTRATION_FAIL = "DataRegistrationFailError"; -this.GECKO_DATACALL_ERROR_SIGNAL_LOST = "SignalLostError"; -this.GECKO_DATACALL_ERROR_PREF_RADIO_TECH_CHANGED = "PrefRadioTechChangedError"; -this.GECKO_DATACALL_ERROR_RADIO_POWER_OFF = "RadioPowerOffError"; -this.GECKO_DATACALL_ERROR_TETHERED_CALL_ACTIVE = "TetheredCallActiveError"; -this.GECKO_DATACALL_ERROR_UNSPECIFIED = "UnspecifiedError"; +const GECKO_DATACALL_ERROR_OPERATOR_BARRED = "OperatorBarredError"; +const GECKO_DATACALL_ERROR_INSUFFICIENT_RESOURCES = "InsufficientResourcesError"; +const GECKO_DATACALL_ERROR_MISSING_UKNOWN_APN = "MissingUnknownAPNError"; +const GECKO_DATACALL_ERROR_UNKNOWN_PDP_ADDRESS_TYPE = "UnknownPDPAddressTypeError"; +const GECKO_DATACALL_ERROR_USER_AUTHENTICATION = "UserAuthenticationError"; +const GECKO_DATACALL_ERROR_ACTIVATION_REJECT_GGSN = "ActivationRejectGGSNError"; +const GECKO_DATACALL_ERROR_ACTIVATION_REJECT_UNSPECIFIED = "ActivationRejectUnspecifiedError"; +const GECKO_DATACALL_ERROR_SERVICE_OPTION_NOT_SUPPORTED = "ServiceOptionNotSupportedError"; +const GECKO_DATACALL_ERROR_SERVICE_OPTION_NOT_SUBSCRIBED = "ServiceOptionNotSubscribedError"; +const GECKO_DATACALL_ERROR_SERVICE_OPTION_OUT_OF_ORDER = "ServiceOptionOutOfOrderError"; +const GECKO_DATACALL_ERROR_NSAPI_IN_USE = "NSAPIInUseError"; +const GECKO_DATACALL_ERROR_ONLY_IPV4_ALLOWED = "OnlyIPv4Error"; +const GECKO_DATACALL_ERROR_ONLY_IPV6_ALLOWED = "OnlyIPv6Error"; +const GECKO_DATACALL_ERROR_ONLY_SINGLE_BEARER_ALLOWED = "OnlySingleBearerAllowedError"; +const GECKO_DATACALL_ERROR_PROTOCOL_ERRORS = "ProtocolErrorsError"; +const GECKO_DATACALL_ERROR_VOICE_REGISTRATION_FAIL = "VoiceRegistrationFailError"; +const GECKO_DATACALL_ERROR_DATA_REGISTRATION_FAIL = "DataRegistrationFailError"; +const GECKO_DATACALL_ERROR_SIGNAL_LOST = "SignalLostError"; +const GECKO_DATACALL_ERROR_PREF_RADIO_TECH_CHANGED = "PrefRadioTechChangedError"; +const GECKO_DATACALL_ERROR_RADIO_POWER_OFF = "RadioPowerOffError"; +const GECKO_DATACALL_ERROR_TETHERED_CALL_ACTIVE = "TetheredCallActiveError"; +const GECKO_DATACALL_ERROR_UNSPECIFIED = "UnspecifiedError"; -this.RIL_DATACALL_FAILCAUSE_TO_GECKO_DATACALL_ERROR = {}; +const RIL_DATACALL_FAILCAUSE_TO_GECKO_DATACALL_ERROR = {}; RIL_DATACALL_FAILCAUSE_TO_GECKO_DATACALL_ERROR[DATACALL_FAIL_OPERATOR_BARRED] = GECKO_DATACALL_ERROR_OPERATOR_BARRED; RIL_DATACALL_FAILCAUSE_TO_GECKO_DATACALL_ERROR[DATACALL_FAIL_INSUFFICIENT_RESOURCES] = GECKO_DATACALL_ERROR_INSUFFICIENT_RESOURCES; RIL_DATACALL_FAILCAUSE_TO_GECKO_DATACALL_ERROR[DATACALL_FAIL_MISSING_UKNOWN_APN] = GECKO_DATACALL_ERROR_MISSING_UKNOWN_APN; @@ -1870,7 +1870,7 @@ RIL_DATACALL_FAILCAUSE_TO_GECKO_DATACALL_ERROR[DATACALL_FAIL_RADIO_POWER_OFF] RIL_DATACALL_FAILCAUSE_TO_GECKO_DATACALL_ERROR[DATACALL_FAIL_TETHERED_CALL_ACTIVE] = GECKO_DATACALL_ERROR_TETHERED_CALL_ACTIVE; RIL_DATACALL_FAILCAUSE_TO_GECKO_DATACALL_ERROR[DATACALL_FAIL_ERROR_UNSPECIFIED] = GECKO_DATACALL_ERROR_UNSPECIFIED; -this.GECKO_RADIO_TECH = [ +const GECKO_RADIO_TECH = [ null, "gprs", "edge", @@ -1889,49 +1889,49 @@ this.GECKO_RADIO_TECH = [ "hspa+", ]; -this.GECKO_VOICEMAIL_MESSAGE_COUNT_UNKNOWN = -1; +const GECKO_VOICEMAIL_MESSAGE_COUNT_UNKNOWN = -1; // MMI procedure as defined in TS.22.030 6.5.2 -this.MMI_PROCEDURE_ACTIVATION = "*"; -this.MMI_PROCEDURE_DEACTIVATION = "#"; -this.MMI_PROCEDURE_INTERROGATION = "*#"; -this.MMI_PROCEDURE_REGISTRATION = "**"; -this.MMI_PROCEDURE_ERASURE = "##"; +const MMI_PROCEDURE_ACTIVATION = "*"; +const MMI_PROCEDURE_DEACTIVATION = "#"; +const MMI_PROCEDURE_INTERROGATION = "*#"; +const MMI_PROCEDURE_REGISTRATION = "**"; +const MMI_PROCEDURE_ERASURE = "##"; // MMI call forwarding service codes as defined in TS.22.030 Annex B -this.MMI_SC_CFU = "21"; -this.MMI_SC_CF_BUSY = "67"; -this.MMI_SC_CF_NO_REPLY = "61"; -this.MMI_SC_CF_NOT_REACHABLE = "62"; -this.MMI_SC_CF_ALL = "002"; -this.MMI_SC_CF_ALL_CONDITIONAL = "004"; +const MMI_SC_CFU = "21"; +const MMI_SC_CF_BUSY = "67"; +const MMI_SC_CF_NO_REPLY = "61"; +const MMI_SC_CF_NOT_REACHABLE = "62"; +const MMI_SC_CF_ALL = "002"; +const MMI_SC_CF_ALL_CONDITIONAL = "004"; // MMI service codes for PIN/PIN2/PUK/PUK2 management as defined in TS.22.030 // sec 6.6 -this.MMI_SC_PIN = "04"; -this.MMI_SC_PIN2 = "042"; -this.MMI_SC_PUK = "05"; -this.MMI_SC_PUK2 = "052"; +const MMI_SC_PIN = "04"; +const MMI_SC_PIN2 = "042"; +const MMI_SC_PUK = "05"; +const MMI_SC_PUK2 = "052"; // MMI service code for IMEI presentation as defined in TS.22.030 sec 6.7 -this.MMI_SC_IMEI = "06"; +const MMI_SC_IMEI = "06"; // MMI called line presentation service codes -this.MMI_SC_CLIP = "30"; -this.MMI_SC_CLIR = "31"; +const MMI_SC_CLIP = "30"; +const MMI_SC_CLIR = "31"; // MMI call waiting service code -this.MMI_SC_CALL_WAITING = "43"; +const MMI_SC_CALL_WAITING = "43"; // MMI call barring service codes -this.MMI_SC_BAOC = "33"; -this.MMI_SC_BAOIC = "331"; -this.MMI_SC_BAOICxH = "332"; -this.MMI_SC_BAIC = "35"; -this.MMI_SC_BAICr = "351"; -this.MMI_SC_BA_ALL = "330"; -this.MMI_SC_BA_MO = "333"; -this.MMI_SC_BA_MT = "353"; +const MMI_SC_BAOC = "33"; +const MMI_SC_BAOIC = "331"; +const MMI_SC_BAOICxH = "332"; +const MMI_SC_BAIC = "35"; +const MMI_SC_BAICr = "351"; +const MMI_SC_BA_ALL = "330"; +const MMI_SC_BA_MO = "333"; +const MMI_SC_BA_MT = "353"; // Allow this file to be imported via Components.utils.import(). -this.EXPORTED_SYMBOLS = Object.keys(this); +const EXPORTED_SYMBOLS = Object.keys(this); diff --git a/dom/system/gonk/systemlibs.js b/dom/system/gonk/systemlibs.js index 9c42da0a37e..8ba723dbd8f 100644 --- a/dom/system/gonk/systemlibs.js +++ b/dom/system/gonk/systemlibs.js @@ -13,9 +13,10 @@ * limitations under the License. */ +let EXPORTED_SYMBOLS; if (!this.ctypes) { // We're likely being loaded as a JSM. - this.EXPORTED_SYMBOLS = [ "libcutils", "libnetutils", "netHelpers" ]; + EXPORTED_SYMBOLS = [ "libcutils", "libnetutils", "netHelpers" ]; Components.utils.import("resource://gre/modules/ctypes.jsm"); } @@ -30,7 +31,7 @@ let DEBUG; /** * Expose some system-level functions. */ -this.libcutils = (function() { +let libcutils = (function() { let lib; try { lib = ctypes.open("libcutils.so"); @@ -105,7 +106,7 @@ this.libcutils = (function() { /** * Network-related functions from libnetutils. */ -this.libnetutils = (function () { +let libnetutils = (function () { let library; try { library = ctypes.open("libnetutils.so"); @@ -328,7 +329,7 @@ this.libnetutils = (function () { /** * Helpers for conversions. */ -this.netHelpers = { +let netHelpers = { /** * Swap byte orders for 32-bit value diff --git a/dom/wifi/DOMWifiManager.js b/dom/wifi/DOMWifiManager.js index c46481dc697..666d6a66f25 100644 --- a/dom/wifi/DOMWifiManager.js +++ b/dom/wifi/DOMWifiManager.js @@ -393,7 +393,7 @@ DOMWifiManager.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DOMWifiManager]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([DOMWifiManager]); let debug; if (DEBUG) { diff --git a/dom/wifi/WifiWorker.js b/dom/wifi/WifiWorker.js index 50752f6297d..1787dcbd32b 100644 --- a/dom/wifi/WifiWorker.js +++ b/dom/wifi/WifiWorker.js @@ -2598,7 +2598,7 @@ WifiWorker.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WifiWorker]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([WifiWorker]); let debug; if (DEBUG) { diff --git a/dom/workers/test/WorkerTest.jsm b/dom/workers/test/WorkerTest.jsm index 86431b7f892..b639ab1fee5 100644 --- a/dom/workers/test/WorkerTest.jsm +++ b/dom/workers/test/WorkerTest.jsm @@ -2,11 +2,11 @@ * Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ -this.EXPORTED_SYMBOLS = [ +let EXPORTED_SYMBOLS = [ "WorkerTest" ]; -this.WorkerTest = { +const WorkerTest = { go: function(message, messageCallback, errorCallback) { let worker = new ChromeWorker("WorkerTest_worker.js"); worker.onmessage = messageCallback; diff --git a/dom/workers/test/extensions/traditional/WorkerTest.js b/dom/workers/test/extensions/traditional/WorkerTest.js index 5fdd14d9d2c..13a1c33643b 100644 --- a/dom/workers/test/extensions/traditional/WorkerTest.js +++ b/dom/workers/test/extensions/traditional/WorkerTest.js @@ -129,4 +129,4 @@ WorkerTest.prototype = { classID: Components.ID("{3b52b935-551f-4606-ba4c-decc18b67bfd}") }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WorkerTest]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([WorkerTest]); diff --git a/extensions/cookie/test/unit/cookieprompt.js b/extensions/cookie/test/unit/cookieprompt.js index fa4257caf9e..b01dd366251 100644 --- a/extensions/cookie/test/unit/cookieprompt.js +++ b/extensions/cookie/test/unit/cookieprompt.js @@ -19,4 +19,4 @@ CookiePromptService.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([CookiePromptService]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([CookiePromptService]); diff --git a/image/decoders/icon/qt/gtkqticonsconverter.js b/image/decoders/icon/qt/gtkqticonsconverter.js index cbaf4260f3a..2317f5201dd 100644 --- a/image/decoders/icon/qt/gtkqticonsconverter.js +++ b/image/decoders/icon/qt/gtkqticonsconverter.js @@ -133,5 +133,5 @@ GtkQtIconsConverter.prototype = { }, } var components = [GtkQtIconsConverter]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/intl/locale/src/PluralForm.jsm b/intl/locale/src/PluralForm.jsm index 36f3471896a..3f864042409 100644 --- a/intl/locale/src/PluralForm.jsm +++ b/intl/locale/src/PluralForm.jsm @@ -2,7 +2,7 @@ * 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 = [ "PluralForm" ]; +var EXPORTED_SYMBOLS = [ "PluralForm" ]; /** * This module provides the PluralForm object which contains a method to figure @@ -72,7 +72,7 @@ let gFunctions = [ [5, function(n) n%10==1&&n%100!=11&&n%100!=71&&n%100!=91?0:n%10==2&&n%100!=12&&n%100!=72&&n%100!=92?1:(n%10==3||n%10==4||n%10==9)&&n%100!=13&&n%100!=14&&n%100!=19&&n%100!=73&&n%100!=74&&n%100!=79&&n%100!=93&&n%100!=94&&n%100!=99?2:n%1000000==0&&n!=0?3:4], ]; -this.PluralForm = { +let PluralForm = { /** * Get the correct plural form of a word based on the number * diff --git a/js/ductwork/debugger/jsdebugger.jsm b/js/ductwork/debugger/jsdebugger.jsm index 10fafdfa795..d7383a2d36c 100644 --- a/js/ductwork/debugger/jsdebugger.jsm +++ b/js/ductwork/debugger/jsdebugger.jsm @@ -3,7 +3,7 @@ * 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 = [ "addDebuggerToGlobal" ]; +let EXPORTED_SYMBOLS = [ "addDebuggerToGlobal" ]; /* * This is the js module for Debugger. Import it like so: @@ -19,6 +19,6 @@ this.EXPORTED_SYMBOLS = [ "addDebuggerToGlobal" ]; */ const init = Components.classes["@mozilla.org/jsdebugger;1"].createInstance(Components.interfaces.IJSDebugger); -this.addDebuggerToGlobal = function addDebuggerToGlobal(global) { +function addDebuggerToGlobal(global) { init.addClass(global); }; diff --git a/js/xpconnect/loader/ISO8601DateUtils.jsm b/js/xpconnect/loader/ISO8601DateUtils.jsm index 534667cefc3..b4140542d3f 100644 --- a/js/xpconnect/loader/ISO8601DateUtils.jsm +++ b/js/xpconnect/loader/ISO8601DateUtils.jsm @@ -9,11 +9,11 @@ const SECONDS_TO_MILLISECONDS = 1000; const MINUTES_TO_MILLISECONDS = MINUTES_TO_SECONDS * SECONDS_TO_MILLISECONDS; const HOURS_TO_MILLISECONDS = HOURS_TO_MINUTES * MINUTES_TO_MILLISECONDS; -this.EXPORTED_SYMBOLS = ["ISO8601DateUtils"]; +var EXPORTED_SYMBOLS = ["ISO8601DateUtils"]; debug("*** loading ISO8601DateUtils\n"); -this.ISO8601DateUtils = { +var ISO8601DateUtils = { /** * XXX Thunderbird's W3C-DTF function diff --git a/js/xpconnect/loader/XPCOMUtils.jsm b/js/xpconnect/loader/XPCOMUtils.jsm index 49a052d568a..bb24ce1ca17 100644 --- a/js/xpconnect/loader/XPCOMUtils.jsm +++ b/js/xpconnect/loader/XPCOMUtils.jsm @@ -84,18 +84,18 @@ * var components = [MyComponent]; * * 3. Define the NSGetFactory entry point: - * this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); + * const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); */ -this.EXPORTED_SYMBOLS = [ "XPCOMUtils" ]; +var EXPORTED_SYMBOLS = [ "XPCOMUtils" ]; const Cc = Components.classes; const Ci = Components.interfaces; const Cr = Components.results; const Cu = Components.utils; -this.XPCOMUtils = { +var XPCOMUtils = { /** * Generate a QueryInterface implementation. The returned function must be * assigned to the 'QueryInterface' property of a JS object. When invoked on diff --git a/js/xpconnect/loader/mozJSComponentLoader.cpp b/js/xpconnect/loader/mozJSComponentLoader.cpp index ceea7c52b5d..334ab453fd2 100644 --- a/js/xpconnect/loader/mozJSComponentLoader.cpp +++ b/js/xpconnect/loader/mozJSComponentLoader.cpp @@ -352,8 +352,7 @@ ReportOnCaller(JSCLContextHelper &helper, mozJSComponentLoader::mozJSComponentLoader() : mRuntime(nullptr), mContext(nullptr), - mInitialized(false), - mReuseLoaderGlobal(false) + mInitialized(false) { NS_ASSERTION(!sSelf, "mozJSComponentLoader should be a singleton"); @@ -389,7 +388,6 @@ mozJSComponentLoader::ReallyInit() { nsresult rv; - mReuseLoaderGlobal = Preferences::GetBool("jsloader.reuseGlobal"); /* * Get the JSRuntime from the runtime svc, if possible. @@ -474,10 +472,15 @@ mozJSComponentLoader::LoadModule(FileLocation &aFile) return mod; nsAutoPtr entry(new ModuleEntry); + if (!entry) + return NULL; - rv = ObjectForLocation(file, uri, &entry->obj, + rv = GlobalForLocation(file, uri, &entry->global, &entry->location, nullptr); if (NS_FAILED(rv)) { +#ifdef DEBUG_shaver + fprintf(stderr, "GlobalForLocation failed!\n"); +#endif return NULL; } @@ -492,11 +495,11 @@ mozJSComponentLoader::LoadModule(FileLocation &aFile) return NULL; JSCLContextHelper cx(this); - JSAutoCompartment ac(cx, entry->obj); + JSAutoCompartment ac(cx, entry->global); JSObject* cm_jsobj; nsCOMPtr cm_holder; - rv = xpc->WrapNative(cx, entry->obj, cm, + rv = xpc->WrapNative(cx, entry->global, cm, NS_GET_IID(nsIComponentManager), getter_AddRefs(cm_holder)); @@ -518,7 +521,7 @@ mozJSComponentLoader::LoadModule(FileLocation &aFile) JSObject* file_jsobj; nsCOMPtr file_holder; - rv = xpc->WrapNative(cx, entry->obj, file, + rv = xpc->WrapNative(cx, entry->global, file, NS_GET_IID(nsIFile), getter_AddRefs(file_holder)); @@ -535,7 +538,7 @@ mozJSComponentLoader::LoadModule(FileLocation &aFile) jsval NSGetFactory_val; - if (!JS_GetProperty(cx, entry->obj, "NSGetFactory", &NSGetFactory_val) || + if (!JS_GetProperty(cx, entry->global, "NSGetFactory", &NSGetFactory_val) || JSVAL_IS_VOID(NSGetFactory_val)) { return NULL; } @@ -570,9 +573,7 @@ mozJSComponentLoader::LoadModule(FileLocation &aFile) // Set the location information for the new global, so that tools like // about:memory may use that information - if (!mReuseLoaderGlobal) { - xpc::SetLocationForGlobal(entry->obj, spec); - } + xpc::SetLocationForGlobal(entry->global, spec); // The hash owns the ModuleEntry now, forget about it return entry.forget(); @@ -608,66 +609,47 @@ class ANSIFileAutoCloser }; #endif -JSObject* -mozJSComponentLoader::PrepareObjectForLocation(JSCLContextHelper& aCx, - nsIFile *aComponentFile, - nsIURI *aURI, - bool aReuseLoaderGlobal, - bool *aRealFile) +nsresult +mozJSComponentLoader::GlobalForLocation(nsIFile *aComponentFile, + nsIURI *aURI, + JSObject **aGlobal, + char **aLocation, + jsval *exception) { - nsCOMPtr holder; - if (aReuseLoaderGlobal) { - holder = mLoaderGlobal; - } + nsresult rv; + + JSCLContextHelper cx(this); + + JS_AbortIfWrongThread(JS_GetRuntime(cx)); + + nsCOMPtr backstagePass; + rv = mRuntimeService->GetBackstagePass(getter_AddRefs(backstagePass)); + NS_ENSURE_SUCCESS(rv, rv); + + JSCLAutoErrorReporterSetter aers(cx, mozJSLoaderErrorReporter); - nsresult rv = NS_OK; nsCOMPtr xpc = do_GetService(kXPConnectServiceContractID, &rv); - NS_ENSURE_SUCCESS(rv, nullptr); + NS_ENSURE_SUCCESS(rv, rv); - if (!mLoaderGlobal) { - nsCOMPtr backstagePass; - rv = mRuntimeService->GetBackstagePass(getter_AddRefs(backstagePass)); - NS_ENSURE_SUCCESS(rv, nullptr); + nsCOMPtr holder; + rv = xpc->InitClassesWithNewWrappedGlobal(cx, backstagePass, + mSystemPrincipal, + 0, + getter_AddRefs(holder)); + NS_ENSURE_SUCCESS(rv, rv); - rv = xpc->InitClassesWithNewWrappedGlobal(aCx, backstagePass, - mSystemPrincipal, - 0, - getter_AddRefs(holder)); - NS_ENSURE_SUCCESS(rv, nullptr); + JSObject *global; + rv = holder->GetJSObject(&global); + NS_ENSURE_SUCCESS(rv, rv); - JSObject *global; - rv = holder->GetJSObject(&global); - NS_ENSURE_SUCCESS(rv, nullptr); - - JSAutoCompartment ac(aCx, global); - if (!JS_DefineFunctions(aCx, global, gGlobalFun) || - !JS_DefineProfilingFunctions(aCx, global)) { - return nullptr; - } - - if (aReuseLoaderGlobal) { - mLoaderGlobal = holder; - } + JSAutoCompartment ac(cx, global); + if (!JS_DefineFunctions(cx, global, gGlobalFun) || + !JS_DefineProfilingFunctions(cx, global)) { + return NS_ERROR_FAILURE; } - JSObject* obj; - rv = holder->GetJSObject(&obj); - NS_ENSURE_SUCCESS(rv, nullptr); - - JSAutoCompartment ac(aCx, obj); - - if (aReuseLoaderGlobal) { - // If we're reusing the loader global, we don't actually use the - // global, but rather we use a different object as the 'this' object. - JSObject* newObj = JS_NewObject(aCx, nullptr, nullptr, nullptr); - NS_ENSURE_TRUE(newObj, nullptr); - - obj = newObj; - } - - *aRealFile = false; - + bool realFile = false; // need to be extra careful checking for URIs pointing to files // EnsureFile may not always get called, especially on resource URIs // so we need to call GetFile to make sure this is a valid file @@ -678,67 +660,36 @@ mozJSComponentLoader::PrepareObjectForLocation(JSCLContextHelper& aCx, } if (testFile) { - *aRealFile = true; + realFile = true; nsCOMPtr locationHolder; - rv = xpc->WrapNative(aCx, obj, aComponentFile, + rv = xpc->WrapNative(cx, global, aComponentFile, NS_GET_IID(nsIFile), getter_AddRefs(locationHolder)); - NS_ENSURE_SUCCESS(rv, nullptr); + NS_ENSURE_SUCCESS(rv, rv); JSObject *locationObj; rv = locationHolder->GetJSObject(&locationObj); - NS_ENSURE_SUCCESS(rv, nullptr); + NS_ENSURE_SUCCESS(rv, rv); - if (!JS_DefineProperty(aCx, obj, "__LOCATION__", - OBJECT_TO_JSVAL(locationObj), - nullptr, nullptr, 0)) { - return nullptr; - } + if (!JS_DefineProperty(cx, global, "__LOCATION__", + OBJECT_TO_JSVAL(locationObj), nullptr, nullptr, 0)) + return NS_ERROR_FAILURE; } nsAutoCString nativePath; rv = aURI->GetSpec(nativePath); - NS_ENSURE_SUCCESS(rv, nullptr); + NS_ENSURE_SUCCESS(rv, rv); // Expose the URI from which the script was imported through a special // variable that we insert into the JSM. - JSString *exposedUri = JS_NewStringCopyN(aCx, nativePath.get(), - nativePath.Length()); - if (!JS_DefineProperty(aCx, obj, "__URI__", - STRING_TO_JSVAL(exposedUri), nullptr, nullptr, 0)) { - return nullptr; - } + JSString *exposedUri = JS_NewStringCopyN(cx, nativePath.get(), nativePath.Length()); + if (!JS_DefineProperty(cx, global, "__URI__", + STRING_TO_JSVAL(exposedUri), nullptr, nullptr, 0)) + return NS_ERROR_FAILURE; - return obj; -} - -nsresult -mozJSComponentLoader::ObjectForLocation(nsIFile *aComponentFile, - nsIURI *aURI, - JSObject **aObject, - char **aLocation, - jsval *exception) -{ - JSCLContextHelper cx(this); - - JS_AbortIfWrongThread(JS_GetRuntime(cx)); - - JSCLAutoErrorReporterSetter aers(cx, mozJSLoaderErrorReporter); - - bool realFile = false; - JSObject *obj = PrepareObjectForLocation(cx, aComponentFile, aURI, - mReuseLoaderGlobal, &realFile); - NS_ENSURE_TRUE(obj, NS_ERROR_FAILURE); - - JSAutoCompartment ac(cx, obj); JSScript *script = nullptr; - JSFunction *function = nullptr; - - nsAutoCString nativePath; - nsresult rv = aURI->GetSpec(nativePath); - NS_ENSURE_SUCCESS(rv, rv); // Before compiling the script, first check to see if we have it in // the startupcache. Note: as a rule, startupcache errors are not fatal @@ -752,14 +703,7 @@ mozJSComponentLoader::ObjectForLocation(nsIFile *aComponentFile, NS_ENSURE_SUCCESS(rv, rv); if (cache) { - if (!mReuseLoaderGlobal) { - rv = ReadCachedScript(cache, cachePath, cx, mSystemPrincipal, - &script); - } else { - rv = ReadCachedFunction(cache, cachePath, cx, mSystemPrincipal, - &function); - } - + rv = ReadCachedScript(cache, cachePath, cx, mSystemPrincipal, &script); if (NS_SUCCEEDED(rv)) { LOG(("Successfully loaded %s from startupcache\n", nativePath.get())); } else { @@ -770,7 +714,7 @@ mozJSComponentLoader::ObjectForLocation(nsIFile *aComponentFile, } } - if (!script && !function) { + if (!script) { // The script wasn't in the cache , so compile it now. LOG(("Slow loading %s\n", nativePath.get())); @@ -782,13 +726,11 @@ mozJSComponentLoader::ObjectForLocation(nsIFile *aComponentFile, JS_SetOptions(cx, oldopts | JSOPTION_DONT_REPORT_UNCAUGHT); JS::CompileOptions options(cx); options.setPrincipals(nsJSPrincipals::get(mSystemPrincipal)) - .setNoScriptRval(mReuseLoaderGlobal ? false : true) + .setNoScriptRval(true) .setVersion(JSVERSION_LATEST) .setFileAndLine(nativePath.get(), 1) - .setSourcePolicy(mReuseLoaderGlobal ? - JS::CompileOptions::NO_SOURCE : - JS::CompileOptions::LAZY_SOURCE); - js::RootedObject rootedObject(cx, obj); + .setSourcePolicy(JS::CompileOptions::LAZY_SOURCE); + js::RootedObject rootedGlobal(cx, global); if (realFile) { #ifdef HAVE_PR_MEMMAP @@ -836,14 +778,7 @@ mozJSComponentLoader::ObjectForLocation(nsIFile *aComponentFile, return NS_ERROR_FAILURE; } - if (!mReuseLoaderGlobal) { - script = JS::Compile(cx, rootedObject, options, buf, - fileSize32); - } else { - function = JS::CompileFunction(cx, rootedObject, options, - nullptr, 0, nullptr, - buf, fileSize32); - } + script = JS::Compile(cx, rootedGlobal, options, buf, fileSize32); PR_MemUnmap(buf, fileSize32); @@ -885,15 +820,7 @@ mozJSComponentLoader::ObjectForLocation(nsIFile *aComponentFile, NS_WARNING("Failed to read file"); return NS_ERROR_FAILURE; } - - if (!mReuseLoaderGlobal) { - script = JS::Compile(cx, rootedObject, options, buf, - fileSize32); - } else { - function = JS::CompileFunction(cx, rootedObject, options, - nullptr, 0, nullptr, - buf, fileSize32); - } + script = JS::Compile(cx, rootedGlobal, options, buf, rlen); free(buf); @@ -932,37 +859,33 @@ mozJSComponentLoader::ObjectForLocation(nsIFile *aComponentFile, buf[len] = '\0'; - if (!mReuseLoaderGlobal) { - script = JS::Compile(cx, rootedObject, options, buf, - bytesRead); - } else { - function = JS::CompileFunction(cx, rootedObject, options, - nullptr, 0, nullptr, - buf, bytesRead); - } + script = JS::Compile(cx, rootedGlobal, options, buf, bytesRead); } // Propagate the exception, if one exists. Also, don't leave the stale // exception on this context. JS_SetOptions(cx, oldopts); - if (!script && !function && exception) { + if (!script && exception) { JS_GetPendingException(cx, exception); JS_ClearPendingException(cx); } } - if (!script && !function) { + if (!script) { +#ifdef DEBUG_shaver_off + fprintf(stderr, "mJCL: script compilation of %s FAILED\n", + nativePath.get()); +#endif return NS_ERROR_FAILURE; } +#ifdef DEBUG_shaver_off + fprintf(stderr, "mJCL: compiled JS component %s\n", + nativePath.get()); +#endif + if (writeToCache) { // We successfully compiled the script, so cache it. - if (script) { - rv = WriteCachedScript(cache, cachePath, cx, mSystemPrincipal, - script); - } else { - rv = WriteCachedFunction(cache, cachePath, cx, mSystemPrincipal, - function); - } + rv = WriteCachedScript(cache, cachePath, cx, mSystemPrincipal, script); // Don't treat failure to write as fatal, since we might be working // with a read-only cache. @@ -973,20 +896,14 @@ mozJSComponentLoader::ObjectForLocation(nsIFile *aComponentFile, } } - // Assign aObject here so that it's available to recursive imports. + // Assign aGlobal here so that it's available to recursive imports. // See bug 384168. - *aObject = obj; + *aGlobal = global; uint32_t oldopts = JS_GetOptions(cx); JS_SetOptions(cx, oldopts | (exception ? JSOPTION_DONT_REPORT_UNCAUGHT : 0)); - bool ok = false; - if (script) { - ok = JS_ExecuteScriptVersion(cx, obj, script, NULL, JSVERSION_LATEST); - } else { - jsval rval; - ok = JS_CallFunction(cx, obj, function, 0, nullptr, &rval); - } + bool ok = JS_ExecuteScriptVersion(cx, global, script, NULL, JSVERSION_LATEST); JS_SetOptions(cx, oldopts); if (!ok) { @@ -997,18 +914,18 @@ mozJSComponentLoader::ObjectForLocation(nsIFile *aComponentFile, JS_GetPendingException(cx, exception); JS_ClearPendingException(cx); } - *aObject = nullptr; + *aGlobal = nullptr; return NS_ERROR_FAILURE; } /* Freed when we remove from the table. */ *aLocation = ToNewCString(nativePath); if (!*aLocation) { - *aObject = nullptr; + *aGlobal = nullptr; return NS_ERROR_OUT_OF_MEMORY; } - JS_AddNamedObjectRoot(cx, aObject, *aLocation); + JS_AddNamedObjectRoot(cx, aGlobal, *aLocation); return NS_OK; } @@ -1024,20 +941,6 @@ mozJSComponentLoader::UnloadModules() { mInitialized = false; - if (mLoaderGlobal) { - MOZ_ASSERT(mReuseLoaderGlobal, "How did this happen?"); - - JSObject* global; - if (NS_SUCCEEDED(mLoaderGlobal->GetJSObject(&global))) { - JSAutoRequest ar(mContext); - JS_SetAllNonReservedSlotsToUndefined(mContext, global); - } else { - NS_WARNING("Going to leak!"); - } - - mLoaderGlobal = nullptr; - } - mInProgressImports.Clear(); mImports.Clear(); @@ -1214,7 +1117,7 @@ mozJSComponentLoader::ImportInto(const nsACString & aLocation, mInProgressImports.Put(key, newEntry); JS::Anchor exception(JSVAL_VOID); - rv = ObjectForLocation(sourceLocalFile, resURI, &newEntry->obj, + rv = GlobalForLocation(sourceLocalFile, resURI, &newEntry->global, &newEntry->location, &exception.get()); mInProgressImports.Remove(key); @@ -1237,22 +1140,20 @@ mozJSComponentLoader::ImportInto(const nsACString & aLocation, // Set the location information for the new global, so that tools like // about:memory may use that information - if (!mReuseLoaderGlobal) { - xpc::SetLocationForGlobal(newEntry->obj, aLocation); - } + xpc::SetLocationForGlobal(newEntry->global, aLocation); mod = newEntry; } - NS_ASSERTION(mod->obj, "Import table contains entry with no object"); - *_retval = mod->obj; + NS_ASSERTION(mod->global, "Import table contains entry with no global"); + *_retval = mod->global; if (targetObj) { JSCLContextHelper cxhelper(this); - JSAutoCompartment ac(mContext, mod->obj); + JSAutoCompartment ac(mContext, mod->global); JS::Value symbols; - if (!JS_GetProperty(mContext, mod->obj, + if (!JS_GetProperty(mContext, mod->global, "EXPORTED_SYMBOLS", &symbols)) { return ReportOnCaller(cxhelper, ERROR_NOT_PRESENT, PromiseFlatCString(aLocation).get()); @@ -1289,7 +1190,7 @@ mozJSComponentLoader::ImportInto(const nsACString & aLocation, PromiseFlatCString(aLocation).get(), i); } - if (!JS_GetPropertyById(mContext, mod->obj, symbolId, &val)) { + if (!JS_GetPropertyById(mContext, mod->global, symbolId, &val)) { JSAutoByteString bytes(mContext, JSID_TO_STRING(symbolId)); if (!bytes) return NS_ERROR_FAILURE; diff --git a/js/xpconnect/loader/mozJSComponentLoader.h b/js/xpconnect/loader/mozJSComponentLoader.h index eca351e5040..d42e8703d7a 100644 --- a/js/xpconnect/loader/mozJSComponentLoader.h +++ b/js/xpconnect/loader/mozJSComponentLoader.h @@ -32,8 +32,6 @@ { 0xbb, 0xef, 0xf0, 0xcc, 0xb5, 0xfa, 0x64, 0xb6 }} #define MOZJSCOMPONENTLOADER_CONTRACTID "@mozilla.org/moz/jsloader;1" -class JSCLContextHelper; - class mozJSComponentLoader : public mozilla::ModuleLoader, public xpcIJSModuleLoader, public nsIObserver @@ -56,15 +54,9 @@ class mozJSComponentLoader : public mozilla::ModuleLoader, nsresult ReallyInit(); void UnloadModules(); - JSObject* PrepareObjectForLocation(JSCLContextHelper& aCx, - nsIFile* aComponentFile, - nsIURI *aComponent, - bool aReuseLoaderGlobal, - bool *aRealFile); - - nsresult ObjectForLocation(nsIFile* aComponentFile, + nsresult GlobalForLocation(nsIFile* aComponentFile, nsIURI *aComponent, - JSObject **aObject, + JSObject **aGlobal, char **location, jsval *exception); @@ -77,7 +69,6 @@ class mozJSComponentLoader : public mozilla::ModuleLoader, nsCOMPtr mRuntimeService; nsCOMPtr mContextStack; nsCOMPtr mSystemPrincipal; - nsCOMPtr mLoaderGlobal; JSRuntime *mRuntime; JSContext *mContext; @@ -93,7 +84,7 @@ class mozJSComponentLoader : public mozilla::ModuleLoader, loadProc = NULL; unloadProc = NULL; - obj = nullptr; + global = nullptr; location = nullptr; } @@ -104,19 +95,19 @@ class mozJSComponentLoader : public mozilla::ModuleLoader, void Clear() { getfactoryobj = NULL; - if (obj) { + if (global) { JSAutoRequest ar(sSelf->mContext); - JSAutoCompartment ac(sSelf->mContext, obj); + JSAutoCompartment ac(sSelf->mContext, global); - JS_SetAllNonReservedSlotsToUndefined(sSelf->mContext, obj); - JS_RemoveObjectRoot(sSelf->mContext, &obj); + JS_SetAllNonReservedSlotsToUndefined(sSelf->mContext, global); + JS_RemoveObjectRoot(sSelf->mContext, &global); } if (location) NS_Free(location); - obj = NULL; + global = NULL; location = NULL; } @@ -124,7 +115,7 @@ class mozJSComponentLoader : public mozilla::ModuleLoader, const mozilla::Module::CIDEntry& entry); nsCOMPtr getfactoryobj; - JSObject *obj; + JSObject *global; char *location; }; @@ -138,5 +129,4 @@ class mozJSComponentLoader : public mozilla::ModuleLoader, nsDataHashtable mInProgressImports; bool mInitialized; - bool mReuseLoaderGlobal; }; diff --git a/js/xpconnect/loader/mozJSLoaderUtils.cpp b/js/xpconnect/loader/mozJSLoaderUtils.cpp index 49ef941a1d4..121091b4c69 100644 --- a/js/xpconnect/loader/mozJSLoaderUtils.cpp +++ b/js/xpconnect/loader/mozJSLoaderUtils.cpp @@ -36,27 +36,6 @@ ReadCachedScript(StartupCache* cache, nsACString &uri, JSContext *cx, return NS_OK; } -nsresult -ReadCachedFunction(StartupCache* cache, nsACString &uri, JSContext *cx, - nsIPrincipal *systemPrincipal, JSFunction **functionp) -{ - return NS_ERROR_FAILURE; -/* This doesn't actually work ... - nsAutoArrayPtr buf; - uint32_t len; - nsresult rv = cache->GetBuffer(PromiseFlatCString(uri).get(), - getter_Transfers(buf), &len); - if (NS_FAILED(rv)) - return rv; // don't warn since NOT_AVAILABLE is an ok error - - JSObject *obj = JS_DecodeInterpretedFunction(cx, buf, len, nsJSPrincipals::get(systemPrincipal), nullptr); - if (!obj) - return NS_ERROR_OUT_OF_MEMORY; - JSFunction* function = JS_ValueToFunction(cx, OBJECT_TO_JSVAL(obj)); - *functionp = function; - return NS_OK;*/ -} - nsresult WriteCachedScript(StartupCache* cache, nsACString &uri, JSContext *cx, nsIPrincipal *systemPrincipal, JSScript *script) @@ -74,21 +53,3 @@ WriteCachedScript(StartupCache* cache, nsACString &uri, JSContext *cx, js_free(data); return rv; } - -nsresult -WriteCachedFunction(StartupCache* cache, nsACString &uri, JSContext *cx, - nsIPrincipal *systemPrincipal, JSFunction *function) -{ - return NS_ERROR_FAILURE; -/* This doesn't actually work ... - uint32_t size; - void *data = - JS_EncodeInterpretedFunction(cx, JS_GetFunctionObject(function), &size); - if (!data) - return NS_ERROR_OUT_OF_MEMORY; - - MOZ_ASSERT(size); - nsresult rv = cache->PutBuffer(PromiseFlatCString(uri).get(), static_cast(data), size); - js_free(data); - return rv;*/ -} diff --git a/js/xpconnect/loader/mozJSLoaderUtils.h b/js/xpconnect/loader/mozJSLoaderUtils.h index dfabddbf1c8..e29a1d1467b 100644 --- a/js/xpconnect/loader/mozJSLoaderUtils.h +++ b/js/xpconnect/loader/mozJSLoaderUtils.h @@ -22,18 +22,9 @@ ReadCachedScript(mozilla::scache::StartupCache* cache, nsACString &uri, JSContext *cx, nsIPrincipal *systemPrincipal, JSScript **script); -nsresult -ReadCachedFunction(mozilla::scache::StartupCache* cache, nsACString &uri, - JSContext *cx, nsIPrincipal *systemPrincipal, - JSFunction **function); - nsresult WriteCachedScript(mozilla::scache::StartupCache* cache, nsACString &uri, JSContext *cx, nsIPrincipal *systemPrincipal, JSScript *script); -nsresult -WriteCachedFunction(mozilla::scache::StartupCache* cache, nsACString &uri, - JSContext *cx, nsIPrincipal *systemPrincipal, - JSFunction *function); #endif /* mozJSLoaderUtils_h */ diff --git a/js/xpconnect/tests/chrome/file_expandosharing.jsm b/js/xpconnect/tests/chrome/file_expandosharing.jsm index 2e7ffe5416c..19e18ebdbb4 100644 --- a/js/xpconnect/tests/chrome/file_expandosharing.jsm +++ b/js/xpconnect/tests/chrome/file_expandosharing.jsm @@ -1,6 +1,6 @@ -this.EXPORTED_SYMBOLS = ['checkFromJSM']; +var EXPORTED_SYMBOLS = ['checkFromJSM']; -this.checkFromJSM = function checkFromJSM(target, is_op) { +function checkFromJSM(target, is_op) { is_op(target.numProp, 42, "Number expando works"); is_op(target.strProp, "foo", "String expando works"); // If is_op is todo_is, target.objProp will be undefined. diff --git a/js/xpconnect/tests/components/js/xpctest_attributes.js b/js/xpconnect/tests/components/js/xpctest_attributes.js index 6576f9d558e..204d4f1b151 100644 --- a/js/xpconnect/tests/components/js/xpctest_attributes.js +++ b/js/xpconnect/tests/components/js/xpctest_attributes.js @@ -45,4 +45,4 @@ TestObjectReadOnly.prototype = { }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TestObjectReadWrite, TestObjectReadOnly]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([TestObjectReadWrite, TestObjectReadOnly]); diff --git a/js/xpconnect/tests/components/js/xpctest_interfaces.js b/js/xpconnect/tests/components/js/xpctest_interfaces.js index 7e99c1c7509..124be7fe691 100644 --- a/js/xpconnect/tests/components/js/xpctest_interfaces.js +++ b/js/xpconnect/tests/components/js/xpctest_interfaces.js @@ -28,4 +28,4 @@ TestInterfaceB.prototype = { }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TestInterfaceA, TestInterfaceB]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([TestInterfaceA, TestInterfaceB]); diff --git a/js/xpconnect/tests/components/js/xpctest_params.js b/js/xpconnect/tests/components/js/xpctest_params.js index 5bb09627643..d6bb8db0222 100644 --- a/js/xpconnect/tests/components/js/xpctest_params.js +++ b/js/xpconnect/tests/components/js/xpctest_params.js @@ -75,4 +75,4 @@ TestParams.prototype = { testInterfaceIsArray: f_size_and_iid, }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TestParams]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([TestParams]); diff --git a/js/xpconnect/tests/unit/bogus_element_type.jsm b/js/xpconnect/tests/unit/bogus_element_type.jsm index ba6583bba1d..882ca568094 100644 --- a/js/xpconnect/tests/unit/bogus_element_type.jsm +++ b/js/xpconnect/tests/unit/bogus_element_type.jsm @@ -1 +1 @@ -this.EXPORTED_SYMBOLS = [{}]; +var EXPORTED_SYMBOLS = [{}]; diff --git a/js/xpconnect/tests/unit/bogus_exports_type.jsm b/js/xpconnect/tests/unit/bogus_exports_type.jsm index 4ec23b21537..4b306e4e89d 100644 --- a/js/xpconnect/tests/unit/bogus_exports_type.jsm +++ b/js/xpconnect/tests/unit/bogus_exports_type.jsm @@ -1 +1 @@ -this.EXPORTED_SYMBOLS = "not an array"; +var EXPORTED_SYMBOLS = "not an array"; diff --git a/js/xpconnect/tests/unit/component-file.js b/js/xpconnect/tests/unit/component-file.js index 70321a2d0c2..13eba402f0e 100644 --- a/js/xpconnect/tests/unit/component-file.js +++ b/js/xpconnect/tests/unit/component-file.js @@ -118,4 +118,4 @@ FileComponent.prototype = }; var gComponentsArray = [FileComponent]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(gComponentsArray); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(gComponentsArray); diff --git a/js/xpconnect/tests/unit/component_import.js b/js/xpconnect/tests/unit/component_import.js index 7f79e1d5c8c..63a8d250393 100644 --- a/js/xpconnect/tests/unit/component_import.js +++ b/js/xpconnect/tests/unit/component_import.js @@ -85,4 +85,4 @@ function do_check_true(cond, text) { } var gComponentsArray = [FooComponent, BarComponent]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(gComponentsArray); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(gComponentsArray); diff --git a/js/xpconnect/tests/unit/recursive_importA.jsm b/js/xpconnect/tests/unit/recursive_importA.jsm index ebd9a2ddd9a..d100e67cbf9 100644 --- a/js/xpconnect/tests/unit/recursive_importA.jsm +++ b/js/xpconnect/tests/unit/recursive_importA.jsm @@ -2,7 +2,7 @@ * 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 = ["foo", "bar"]; +var EXPORTED_SYMBOLS = ["foo", "bar"]; function foo() { return "foo"; diff --git a/js/xpconnect/tests/unit/recursive_importB.jsm b/js/xpconnect/tests/unit/recursive_importB.jsm index 6ef2b864470..30b1e3f6d97 100644 --- a/js/xpconnect/tests/unit/recursive_importB.jsm +++ b/js/xpconnect/tests/unit/recursive_importB.jsm @@ -2,7 +2,7 @@ * 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 = ["baz", "qux"]; +var EXPORTED_SYMBOLS = ["baz", "qux"]; function baz() { return "baz"; diff --git a/layout/tools/reftest/reftest-cmdline.js b/layout/tools/reftest/reftest-cmdline.js index af4b7433a6b..ccddd378846 100644 --- a/layout/tools/reftest/reftest-cmdline.js +++ b/layout/tools/reftest/reftest-cmdline.js @@ -108,4 +108,4 @@ RefTestCmdLineHandler.prototype = helpInfo : " -reftest Run layout acceptance tests on given manifest.\n" }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RefTestCmdLineHandler]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([RefTestCmdLineHandler]); diff --git a/layout/tools/reftest/reftest.js b/layout/tools/reftest/reftest.js index f3de4a5a825..42f76d385bd 100644 --- a/layout/tools/reftest/reftest.js +++ b/layout/tools/reftest/reftest.js @@ -5,7 +5,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #if BOOTSTRAP -this.EXPORTED_SYMBOLS = ["OnRefTestLoad"]; +var EXPORTED_SYMBOLS = ["OnRefTestLoad"]; #endif @@ -202,7 +202,7 @@ function IDForEventTarget(event) } } -this.OnRefTestLoad = function OnRefTestLoad(win) +function OnRefTestLoad(win) { gCrashDumpDir = CC[NS_DIRECTORY_SERVICE_CONTRACTID] .getService(CI.nsIProperties) diff --git a/mobile/android/components/AboutRedirector.js b/mobile/android/components/AboutRedirector.js index 60172575a9a..4a0a1f38c34 100644 --- a/mobile/android/components/AboutRedirector.js +++ b/mobile/android/components/AboutRedirector.js @@ -112,4 +112,4 @@ AboutRedirector.prototype = { }; const components = [AboutRedirector]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/mobile/android/components/AddonUpdateService.js b/mobile/android/components/AddonUpdateService.js index 6e7603aa526..be764722462 100644 --- a/mobile/android/components/AddonUpdateService.js +++ b/mobile/android/components/AddonUpdateService.js @@ -197,5 +197,5 @@ var RecommendedSearchResults = { } } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AddonUpdateService]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([AddonUpdateService]); diff --git a/mobile/android/components/AlertsService.js b/mobile/android/components/AlertsService.js index e07e38f5f6a..e4cdd71b4d9 100644 --- a/mobile/android/components/AlertsService.js +++ b/mobile/android/components/AlertsService.js @@ -24,4 +24,4 @@ AlertsService.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AlertsService]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([AlertsService]); diff --git a/mobile/android/components/BlocklistPrompt.js b/mobile/android/components/BlocklistPrompt.js index 81bf52ad7f7..ebf0aada38c 100644 --- a/mobile/android/components/BlocklistPrompt.js +++ b/mobile/android/components/BlocklistPrompt.js @@ -57,5 +57,5 @@ BlocklistPrompt.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIBlocklistPrompt]) }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([BlocklistPrompt]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([BlocklistPrompt]); diff --git a/mobile/android/components/BrowserCLH.js b/mobile/android/components/BrowserCLH.js index 54fab3bf874..1e53ef67db0 100644 --- a/mobile/android/components/BrowserCLH.js +++ b/mobile/android/components/BrowserCLH.js @@ -115,4 +115,4 @@ BrowserCLH.prototype = { }; var components = [ BrowserCLH ]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/mobile/android/components/ContentDispatchChooser.js b/mobile/android/components/ContentDispatchChooser.js index 03e7e28c0a4..4ca500bad1b 100644 --- a/mobile/android/components/ContentDispatchChooser.js +++ b/mobile/android/components/ContentDispatchChooser.js @@ -34,5 +34,5 @@ ContentDispatchChooser.prototype = } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentDispatchChooser]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentDispatchChooser]); diff --git a/mobile/android/components/ContentPermissionPrompt.js b/mobile/android/components/ContentPermissionPrompt.js index c7602dbca3e..8f1067a38ea 100644 --- a/mobile/android/components/ContentPermissionPrompt.js +++ b/mobile/android/components/ContentPermissionPrompt.js @@ -98,4 +98,4 @@ ContentPermissionPrompt.prototype = { //module initialization -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermissionPrompt]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermissionPrompt]); diff --git a/mobile/android/components/DirectoryProvider.js b/mobile/android/components/DirectoryProvider.js index 62b0184e5c4..01430f148b2 100644 --- a/mobile/android/components/DirectoryProvider.js +++ b/mobile/android/components/DirectoryProvider.js @@ -56,5 +56,5 @@ DirectoryProvider.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]); diff --git a/mobile/android/components/DownloadManagerUI.js b/mobile/android/components/DownloadManagerUI.js index befb28d0672..79a4b691e0b 100644 --- a/mobile/android/components/DownloadManagerUI.js +++ b/mobile/android/components/DownloadManagerUI.js @@ -43,4 +43,4 @@ DownloadManagerUI.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIDownloadManagerUI]) }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadManagerUI]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadManagerUI]); diff --git a/mobile/android/components/FormAutoComplete.js b/mobile/android/components/FormAutoComplete.js index eb31d48fc74..d4ab286dedf 100644 --- a/mobile/android/components/FormAutoComplete.js +++ b/mobile/android/components/FormAutoComplete.js @@ -134,4 +134,4 @@ FormAutoComplete.prototype = { }; let components = [FormAutoComplete]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/mobile/android/components/HelperAppDialog.js b/mobile/android/components/HelperAppDialog.js index cfc3d74d40b..3d0c688e5d4 100644 --- a/mobile/android/components/HelperAppDialog.js +++ b/mobile/android/components/HelperAppDialog.js @@ -213,4 +213,4 @@ HelperAppLauncherDialog.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([HelperAppLauncherDialog]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([HelperAppLauncherDialog]); diff --git a/mobile/android/components/LoginManagerPrompter.js b/mobile/android/components/LoginManagerPrompter.js index c16440a1b0c..07c089ac403 100644 --- a/mobile/android/components/LoginManagerPrompter.js +++ b/mobile/android/components/LoginManagerPrompter.js @@ -516,5 +516,5 @@ LoginManagerPrompter.prototype = { var component = [LoginManagerPrompter]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/mobile/android/components/PromptService.js b/mobile/android/components/PromptService.js index c5ce54aaaf2..cd5f29778b1 100644 --- a/mobile/android/components/PromptService.js +++ b/mobile/android/components/PromptService.js @@ -775,4 +775,4 @@ XPCOMUtils.defineLazyGetter(PromptUtils, "bundle", function () { return Services.strings.createBundle("chrome://global/locale/commonDialogs.properties"); }); -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PromptService]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([PromptService]); diff --git a/mobile/android/components/SafeBrowsing.jsm b/mobile/android/components/SafeBrowsing.jsm index 82fca71d77e..9041d548a49 100644 --- a/mobile/android/components/SafeBrowsing.jsm +++ b/mobile/android/components/SafeBrowsing.jsm @@ -2,7 +2,7 @@ * 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 = ["SafeBrowsing"]; +var EXPORTED_SYMBOLS = ["SafeBrowsing"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -24,7 +24,7 @@ function log(...stuff) { dump(msg + "\n"); } -this.SafeBrowsing = { +var SafeBrowsing = { init: function() { if (this.initialized) { diff --git a/mobile/android/components/SessionStore.js b/mobile/android/components/SessionStore.js index ff7677233e6..8f8c18db24c 100644 --- a/mobile/android/components/SessionStore.js +++ b/mobile/android/components/SessionStore.js @@ -1042,4 +1042,4 @@ SessionStore.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStore]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStore]); diff --git a/mobile/android/components/Sidebar.js b/mobile/android/components/Sidebar.js index ef3a7d683a9..c0356e2c446 100644 --- a/mobile/android/components/Sidebar.js +++ b/mobile/android/components/Sidebar.js @@ -146,4 +146,4 @@ Sidebar.prototype = { classID: SIDEBAR_CID, }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([Sidebar]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([Sidebar]); diff --git a/mobile/android/components/XPIDialogService.js b/mobile/android/components/XPIDialogService.js index 88a8821eac8..1f96c3a9c77 100644 --- a/mobile/android/components/XPIDialogService.js +++ b/mobile/android/components/XPIDialogService.js @@ -36,4 +36,4 @@ WebInstallPrompt.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WebInstallPrompt]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([WebInstallPrompt]); diff --git a/mobile/android/modules/JNI.jsm b/mobile/android/modules/JNI.jsm index aca61e9f461..5dbccbc7972 100644 --- a/mobile/android/modules/JNI.jsm +++ b/mobile/android/modules/JNI.jsm @@ -9,12 +9,12 @@ * // close the jni library when you are done * jni.close(); */ -this.EXPORTED_SYMBOLS = ["JNI"]; +let EXPORTED_SYMBOLS = ["JNI"]; Components.utils.import("resource://gre/modules/ctypes.jsm") Components.utils.import("resource://gre/modules/Services.jsm") -this.JNI = function JNI() { } +function JNI() { } JNI.prototype = { get lib() { diff --git a/mobile/android/modules/LocaleRepository.jsm b/mobile/android/modules/LocaleRepository.jsm index 18fa7ec2a3d..41bec43269e 100644 --- a/mobile/android/modules/LocaleRepository.jsm +++ b/mobile/android/modules/LocaleRepository.jsm @@ -2,7 +2,7 @@ * 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 = ["LocaleRepository"]; +let EXPORTED_SYMBOLS = ["LocaleRepository"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -24,7 +24,7 @@ const STRING_KEY_MAP = { strings: "strings" }; -this.LocaleRepository = { +var LocaleRepository = { loggingEnabled: false, log: function(aMessage) { diff --git a/mobile/android/modules/contacts.jsm b/mobile/android/modules/contacts.jsm index 88a61083e22..b3e0ec49964 100644 --- a/mobile/android/modules/contacts.jsm +++ b/mobile/android/modules/contacts.jsm @@ -2,11 +2,11 @@ * 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 = ["Contacts"]; +let EXPORTED_SYMBOLS = ["Contacts"]; const Cu = Components.utils; -this.Contacts = { +let Contacts = { _providers: [], _contacts: [], diff --git a/mobile/android/modules/linuxTypes.jsm b/mobile/android/modules/linuxTypes.jsm index 49b1c55c29d..3719c5cd1fa 100644 --- a/mobile/android/modules/linuxTypes.jsm +++ b/mobile/android/modules/linuxTypes.jsm @@ -2,13 +2,13 @@ * 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 = ["GLib", "EBook"]; +let EXPORTED_SYMBOLS = ["GLib", "EBook"]; const Cu = Components.utils; Cu.import("resource://gre/modules/ctypes.jsm"); -this.GLib = { +let GLib = { lib: null, init: function glib_init() { @@ -31,7 +31,7 @@ this.GLib = { } }; -this.EBook = { +let EBook = { lib: null, E_CONTACT_FULL_NAME: 4, diff --git a/mobile/android/modules/video.jsm b/mobile/android/modules/video.jsm index 10e142b4917..bad67a3e83d 100644 --- a/mobile/android/modules/video.jsm +++ b/mobile/android/modules/video.jsm @@ -2,8 +2,8 @@ * 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 = ["Video"]; +var EXPORTED_SYMBOLS = ["Video"]; -this.Video = { +var Video = { fullScreenSourceElement: null }; diff --git a/mobile/xul/components/AboutRedirector.js b/mobile/xul/components/AboutRedirector.js index eb5222d78fb..9657961001c 100644 --- a/mobile/xul/components/AboutRedirector.js +++ b/mobile/xul/components/AboutRedirector.js @@ -124,4 +124,4 @@ AboutBlocked.prototype = { const components = [AboutEmpty, AboutFennec, AboutRights, AboutCertError, AboutFirefox, AboutHome, AboutBlocked]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/mobile/xul/components/AddonUpdateService.js b/mobile/xul/components/AddonUpdateService.js index 1d1acecef4b..5b77093a1b3 100644 --- a/mobile/xul/components/AddonUpdateService.js +++ b/mobile/xul/components/AddonUpdateService.js @@ -198,5 +198,5 @@ var RecommendedSearchResults = { } } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AddonUpdateService]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([AddonUpdateService]); diff --git a/mobile/xul/components/AlertsService.js b/mobile/xul/components/AlertsService.js index e07e38f5f6a..e4cdd71b4d9 100644 --- a/mobile/xul/components/AlertsService.js +++ b/mobile/xul/components/AlertsService.js @@ -24,4 +24,4 @@ AlertsService.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AlertsService]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([AlertsService]); diff --git a/mobile/xul/components/AutoCompleteCache.js b/mobile/xul/components/AutoCompleteCache.js index 7bc4920bd86..a74dc7f01c1 100644 --- a/mobile/xul/components/AutoCompleteCache.js +++ b/mobile/xul/components/AutoCompleteCache.js @@ -364,4 +364,4 @@ BookmarkObserver.prototype = { }; const components = [AutoCompleteCache, BookmarkObserver]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/mobile/xul/components/BlocklistPrompt.js b/mobile/xul/components/BlocklistPrompt.js index 81bf52ad7f7..ebf0aada38c 100644 --- a/mobile/xul/components/BlocklistPrompt.js +++ b/mobile/xul/components/BlocklistPrompt.js @@ -57,5 +57,5 @@ BlocklistPrompt.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIBlocklistPrompt]) }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([BlocklistPrompt]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([BlocklistPrompt]); diff --git a/mobile/xul/components/BrowserCLH.js b/mobile/xul/components/BrowserCLH.js index f5572cca3d0..f831ce3c007 100644 --- a/mobile/xul/components/BrowserCLH.js +++ b/mobile/xul/components/BrowserCLH.js @@ -271,4 +271,4 @@ BrowserCLH.prototype = { }; var components = [ BrowserCLH ]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/mobile/xul/components/BrowserStartup.js b/mobile/xul/components/BrowserStartup.js index c0a06c662b7..3bb286f56a1 100644 --- a/mobile/xul/components/BrowserStartup.js +++ b/mobile/xul/components/BrowserStartup.js @@ -128,4 +128,4 @@ BrowserStartup.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([BrowserStartup]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([BrowserStartup]); diff --git a/mobile/xul/components/CapturePicker.js b/mobile/xul/components/CapturePicker.js index 8458dfcf454..cd5d392f95c 100644 --- a/mobile/xul/components/CapturePicker.js +++ b/mobile/xul/components/CapturePicker.js @@ -82,4 +82,4 @@ CapturePicker.prototype = { }; var components = [ CapturePicker ]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/mobile/xul/components/ContentDispatchChooser.js b/mobile/xul/components/ContentDispatchChooser.js index 03e7e28c0a4..4ca500bad1b 100644 --- a/mobile/xul/components/ContentDispatchChooser.js +++ b/mobile/xul/components/ContentDispatchChooser.js @@ -34,5 +34,5 @@ ContentDispatchChooser.prototype = } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentDispatchChooser]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentDispatchChooser]); diff --git a/mobile/xul/components/ContentPermissionPrompt.js b/mobile/xul/components/ContentPermissionPrompt.js index 0c66d7bf493..de8d0e941fe 100644 --- a/mobile/xul/components/ContentPermissionPrompt.js +++ b/mobile/xul/components/ContentPermissionPrompt.js @@ -126,4 +126,4 @@ ContentPermissionPrompt.prototype = { //module initialization -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermissionPrompt]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermissionPrompt]); diff --git a/mobile/xul/components/DirectoryProvider.js b/mobile/xul/components/DirectoryProvider.js index b9318b2d360..b36dbeb5676 100644 --- a/mobile/xul/components/DirectoryProvider.js +++ b/mobile/xul/components/DirectoryProvider.js @@ -63,5 +63,5 @@ DirectoryProvider.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]); diff --git a/mobile/xul/components/DownloadManagerUI.js b/mobile/xul/components/DownloadManagerUI.js index befb28d0672..79a4b691e0b 100644 --- a/mobile/xul/components/DownloadManagerUI.js +++ b/mobile/xul/components/DownloadManagerUI.js @@ -43,4 +43,4 @@ DownloadManagerUI.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIDownloadManagerUI]) }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadManagerUI]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadManagerUI]); diff --git a/mobile/xul/components/FormAutoComplete.js b/mobile/xul/components/FormAutoComplete.js index eb31d48fc74..d4ab286dedf 100644 --- a/mobile/xul/components/FormAutoComplete.js +++ b/mobile/xul/components/FormAutoComplete.js @@ -134,4 +134,4 @@ FormAutoComplete.prototype = { }; let components = [FormAutoComplete]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/mobile/xul/components/HelperAppDialog.js b/mobile/xul/components/HelperAppDialog.js index f12fbdc472b..6cf561ce410 100644 --- a/mobile/xul/components/HelperAppDialog.js +++ b/mobile/xul/components/HelperAppDialog.js @@ -217,4 +217,4 @@ HelperAppLauncherDialog.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([HelperAppLauncherDialog]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([HelperAppLauncherDialog]); diff --git a/mobile/xul/components/LoginManager.js b/mobile/xul/components/LoginManager.js index d9ed14d8020..9724c559a5d 100644 --- a/mobile/xul/components/LoginManager.js +++ b/mobile/xul/components/LoginManager.js @@ -683,4 +683,4 @@ UserAutoCompleteResult.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([LoginManager]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([LoginManager]); diff --git a/mobile/xul/components/LoginManagerPrompter.js b/mobile/xul/components/LoginManagerPrompter.js index 35cebc46c80..081bd9d0269 100644 --- a/mobile/xul/components/LoginManagerPrompter.js +++ b/mobile/xul/components/LoginManagerPrompter.js @@ -606,5 +606,5 @@ LoginManagerPrompter.prototype = { var component = [LoginManagerPrompter]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/mobile/xul/components/PromptService.js b/mobile/xul/components/PromptService.js index de780b04be2..b9dcf1fd25e 100644 --- a/mobile/xul/components/PromptService.js +++ b/mobile/xul/components/PromptService.js @@ -912,4 +912,4 @@ XPCOMUtils.defineLazyGetter(PromptUtils, "bundle", function () { return Services.strings.createBundle("chrome://global/locale/commonDialogs.properties"); }); -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PromptService]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([PromptService]); diff --git a/mobile/xul/components/SafeBrowsing.js b/mobile/xul/components/SafeBrowsing.js index d1d31bcf5d5..f1d252c8335 100644 --- a/mobile/xul/components/SafeBrowsing.js +++ b/mobile/xul/components/SafeBrowsing.js @@ -165,4 +165,4 @@ SafeBrowsing.prototype = { } } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SafeBrowsing]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([SafeBrowsing]); diff --git a/mobile/xul/components/SessionStore.js b/mobile/xul/components/SessionStore.js index 3b3839e3c24..d3626b3d202 100644 --- a/mobile/xul/components/SessionStore.js +++ b/mobile/xul/components/SessionStore.js @@ -778,4 +778,4 @@ SessionStore.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStore]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStore]); diff --git a/mobile/xul/components/Sidebar.js b/mobile/xul/components/Sidebar.js index ef3a7d683a9..c0356e2c446 100644 --- a/mobile/xul/components/Sidebar.js +++ b/mobile/xul/components/Sidebar.js @@ -146,4 +146,4 @@ Sidebar.prototype = { classID: SIDEBAR_CID, }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([Sidebar]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([Sidebar]); diff --git a/mobile/xul/components/UpdatePrompt.js b/mobile/xul/components/UpdatePrompt.js index 02fe596ac64..4eb3f73383b 100644 --- a/mobile/xul/components/UpdatePrompt.js +++ b/mobile/xul/components/UpdatePrompt.js @@ -305,4 +305,4 @@ UpdatePrompt.prototype = { }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([UpdatePrompt]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([UpdatePrompt]); diff --git a/mobile/xul/components/XPIDialogService.js b/mobile/xul/components/XPIDialogService.js index f31ecdea5e8..584e238d736 100644 --- a/mobile/xul/components/XPIDialogService.js +++ b/mobile/xul/components/XPIDialogService.js @@ -45,4 +45,4 @@ WebInstallPrompt.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WebInstallPrompt]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([WebInstallPrompt]); diff --git a/mobile/xul/modules/LocaleRepository.jsm b/mobile/xul/modules/LocaleRepository.jsm index 18fa7ec2a3d..41bec43269e 100644 --- a/mobile/xul/modules/LocaleRepository.jsm +++ b/mobile/xul/modules/LocaleRepository.jsm @@ -2,7 +2,7 @@ * 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 = ["LocaleRepository"]; +let EXPORTED_SYMBOLS = ["LocaleRepository"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -24,7 +24,7 @@ const STRING_KEY_MAP = { strings: "strings" }; -this.LocaleRepository = { +var LocaleRepository = { loggingEnabled: false, log: function(aMessage) { diff --git a/mobile/xul/modules/contacts.jsm b/mobile/xul/modules/contacts.jsm index d82746c9486..6e8b274d233 100644 --- a/mobile/xul/modules/contacts.jsm +++ b/mobile/xul/modules/contacts.jsm @@ -2,11 +2,11 @@ * 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 = ["Contacts"]; +let EXPORTED_SYMBOLS = ["Contacts"]; const Cu = Components.utils; -this.Contacts = { +let Contacts = { _providers: [], _contacts: [], diff --git a/mobile/xul/modules/linuxTypes.jsm b/mobile/xul/modules/linuxTypes.jsm index 49b1c55c29d..3719c5cd1fa 100644 --- a/mobile/xul/modules/linuxTypes.jsm +++ b/mobile/xul/modules/linuxTypes.jsm @@ -2,13 +2,13 @@ * 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 = ["GLib", "EBook"]; +let EXPORTED_SYMBOLS = ["GLib", "EBook"]; const Cu = Components.utils; Cu.import("resource://gre/modules/ctypes.jsm"); -this.GLib = { +let GLib = { lib: null, init: function glib_init() { @@ -31,7 +31,7 @@ this.GLib = { } }; -this.EBook = { +let EBook = { lib: null, E_CONTACT_FULL_NAME: 4, diff --git a/mobile/xul/modules/video.jsm b/mobile/xul/modules/video.jsm index 10e142b4917..bad67a3e83d 100644 --- a/mobile/xul/modules/video.jsm +++ b/mobile/xul/modules/video.jsm @@ -2,8 +2,8 @@ * 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 = ["Video"]; +var EXPORTED_SYMBOLS = ["Video"]; -this.Video = { +var Video = { fullScreenSourceElement: null }; diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index 7136fdcb66c..47c17bdda30 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -3818,12 +3818,6 @@ pref("dom.mozApps.maxLocalId", 1000); // a restart is required to enable a new value. pref("network.activity.blipIntervalMilliseconds", 0); -// If true, reuse the same global for everything loaded by the component loader -// (JS components, JSMs, etc). This saves memory, but makes it possible for -// the scripts to interfere with each other. A restart is required for this -// to take effect. -pref("jsloader.reuseGlobal", false); - // When we're asked to take a screenshot, don't wait more than 2000ms for the // event loop to become idle before actually taking the screenshot. pref("dom.browserElement.maxScreenshotDelayMS", 2000); diff --git a/netwerk/base/src/NetUtil.jsm b/netwerk/base/src/NetUtil.jsm index 50dbf07a3b2..1e09a2204a8 100644 --- a/netwerk/base/src/NetUtil.jsm +++ b/netwerk/base/src/NetUtil.jsm @@ -4,7 +4,7 @@ * 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 = [ +let EXPORTED_SYMBOLS = [ "NetUtil", ]; @@ -25,7 +25,7 @@ const PR_UINT32_MAX = 0xffffffff; //////////////////////////////////////////////////////////////////////////////// //// NetUtil Object -this.NetUtil = { +const NetUtil = { /** * Function to perform simple async copying from aSource (an input stream) * to aSink (an output stream). The copy will happen on some background diff --git a/netwerk/protocol/app/AppProtocolHandler.js b/netwerk/protocol/app/AppProtocolHandler.js index 089a549218e..51ad4106305 100644 --- a/netwerk/protocol/app/AppProtocolHandler.js +++ b/netwerk/protocol/app/AppProtocolHandler.js @@ -75,4 +75,4 @@ AppProtocolHandler.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AppProtocolHandler]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([AppProtocolHandler]); diff --git a/netwerk/protocol/http/UserAgentOverrides.jsm b/netwerk/protocol/http/UserAgentOverrides.jsm index 481f5200e88..d7bae185404 100644 --- a/netwerk/protocol/http/UserAgentOverrides.jsm +++ b/netwerk/protocol/http/UserAgentOverrides.jsm @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = [ "UserAgentOverrides" ]; +var EXPORTED_SYMBOLS = [ "UserAgentOverrides" ]; const Ci = Components.interfaces; const Cc = Components.classes; @@ -23,7 +23,7 @@ var gOverrideFunctions = [ function (aHttpChannel) UserAgentOverrides.getOverrideForURI(aHttpChannel.URI) ]; -this.UserAgentOverrides = { +var UserAgentOverrides = { init: function uao_init() { if (gInitialized) return; diff --git a/netwerk/test/httpserver/httpd.js b/netwerk/test/httpserver/httpd.js index 16f1663f801..03ead581747 100644 --- a/netwerk/test/httpserver/httpd.js +++ b/netwerk/test/httpserver/httpd.js @@ -5236,7 +5236,7 @@ Request.prototype = // XPCOM trappings -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsHttpServer]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsHttpServer]); /** * Creates a new HTTP server listening for loopback traffic on the given port, diff --git a/services/aitc/Aitc.js b/services/aitc/Aitc.js index e622d09102e..d90d6f8f460 100644 --- a/services/aitc/Aitc.js +++ b/services/aitc/Aitc.js @@ -101,4 +101,4 @@ AboutApps.prototype = { }; const components = [AitcService, AboutApps]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/services/aitc/modules/browserid.js b/services/aitc/modules/browserid.js index 990474137f6..41d82271ba6 100644 --- a/services/aitc/modules/browserid.js +++ b/services/aitc/modules/browserid.js @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["BrowserID"]; +const EXPORTED_SYMBOLS = ["BrowserID"]; const {classes: Cc, interfaces: Ci, utils: Cu} = Components; diff --git a/services/aitc/modules/client.js b/services/aitc/modules/client.js index fdf4d775ac1..ef630431b03 100644 --- a/services/aitc/modules/client.js +++ b/services/aitc/modules/client.js @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["AitcClient"]; +const EXPORTED_SYMBOLS = ["AitcClient"]; const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; @@ -32,7 +32,7 @@ const DEFAULT_REQUEST_FAILURE_THRESHOLD = 3; * The values should be stored persistently. The Preferences object from * services-common/preferences.js is an example of such an object. */ -this.AitcClient = function AitcClient(token, state) { +function AitcClient(token, state) { this.updateToken(token); this._log = Log4Moz.repository.getLogger("Service.AITC.Client"); diff --git a/services/aitc/modules/main.js b/services/aitc/modules/main.js index 6e0219793da..075a4c79ff8 100644 --- a/services/aitc/modules/main.js +++ b/services/aitc/modules/main.js @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["Aitc"]; +const EXPORTED_SYMBOLS = ["Aitc"]; const {classes: Cc, interfaces: Ci, utils: Cu} = Components; @@ -17,7 +17,7 @@ Cu.import("resource://services-common/utils.js"); Cu.import("resource://services-common/log4moz.js"); Cu.import("resource://services-common/preferences.js"); -this.Aitc = function Aitc() { +function Aitc() { this._log = Log4Moz.repository.getLogger("Service.AITC"); this._log.level = Log4Moz.Level[Preferences.get( "services.aitc.service.log.level" diff --git a/services/aitc/modules/manager.js b/services/aitc/modules/manager.js index 03aff26f135..d13bfb3f732 100644 --- a/services/aitc/modules/manager.js +++ b/services/aitc/modules/manager.js @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["AitcManager"]; +const EXPORTED_SYMBOLS = ["AitcManager"]; const {classes: Cc, interfaces: Ci, utils: Cu} = Components; @@ -33,7 +33,7 @@ const MARKETPLACE_URL = PREFS.get("marketplace.url"); * to bypass BrowserID for xpcshell tests, since the window object in not * available. */ -this.AitcManager = function AitcManager(cb, premadeClient, premadeToken) { +function AitcManager(cb, premadeClient, premadeToken) { this._client = null; this._getTimer = null; this._putTimer = null; diff --git a/services/aitc/modules/storage.js b/services/aitc/modules/storage.js index 566aa3d3b43..bf64a4eb4e9 100644 --- a/services/aitc/modules/storage.js +++ b/services/aitc/modules/storage.js @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["AitcStorage", "AitcQueue"]; +const EXPORTED_SYMBOLS = ["AitcStorage", "AitcQueue"]; const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; @@ -32,7 +32,7 @@ Cu.import("resource://services-common/utils.js"); * will be persisted on disk. * */ -this.AitcQueue = function AitcQueue(filename, cb) { +function AitcQueue(filename, cb) { if (!cb) { throw new Error("AitcQueue constructor called without callback"); } diff --git a/services/common/async.js b/services/common/async.js index e27d14a1162..f2047a31b69 100644 --- a/services/common/async.js +++ b/services/common/async.js @@ -2,7 +2,7 @@ * 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 = ["Async"]; +const EXPORTED_SYMBOLS = ["Async"]; const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components; @@ -18,7 +18,7 @@ Cu.import("resource://gre/modules/Services.jsm"); /* * Helpers for various async operations. */ -this.Async = { +let Async = { /** * Execute an arbitrary number of asynchronous functions one after the diff --git a/services/common/log4moz.js b/services/common/log4moz.js index 5512cb55944..713e7235345 100644 --- a/services/common/log4moz.js +++ b/services/common/log4moz.js @@ -2,7 +2,7 @@ * 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 = ['Log4Moz']; +const EXPORTED_SYMBOLS = ['Log4Moz']; const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components; @@ -16,7 +16,7 @@ const PR_UINT32_MAX = 0xffffffff; Cu.import("resource://gre/modules/NetUtil.jsm"); Cu.import("resource://gre/modules/FileUtils.jsm"); -this.Log4Moz = { +let Log4Moz = { Level: { Fatal: 70, Error: 60, diff --git a/services/common/modules-testing/aitcserver.js b/services/common/modules-testing/aitcserver.js index daa29af3d1d..3fad0b20806 100644 --- a/services/common/modules-testing/aitcserver.js +++ b/services/common/modules-testing/aitcserver.js @@ -6,7 +6,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components; -this.EXPORTED_SYMBOLS = [ +const EXPORTED_SYMBOLS = [ "AITCServer10User", "AITCServer10Server", ]; @@ -22,7 +22,7 @@ Cu.import("resource://services-common/utils.js"); * This type provides convenience APIs for interacting with an individual * user's data. */ -this.AITCServer10User = function AITCServer10User() { +function AITCServer10User() { this._log = Log4Moz.repository.getLogger("Services.Common.AITCServer"); this.apps = {}; } @@ -127,7 +127,7 @@ AITCServer10User.prototype = { * work, set autoCreateUsers to true and am empty user will be * provisioned at request time. */ -this.AITCServer10Server = function AITCServer10Server() { +function AITCServer10Server() { this._log = Log4Moz.repository.getLogger("Services.Common.AITCServer"); this.server = new HttpServer(); diff --git a/services/common/modules-testing/logging.js b/services/common/modules-testing/logging.js index 3ef88e698dc..caba912bf13 100644 --- a/services/common/modules-testing/logging.js +++ b/services/common/modules-testing/logging.js @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = [ +const EXPORTED_SYMBOLS = [ "getTestLogger", "initTestLogging", ]; @@ -13,7 +13,7 @@ const {utils: Cu} = Components; Cu.import("resource://services-common/log4moz.js"); -this.initTestLogging = function initTestLogging(level) { +function initTestLogging(level) { function LogStats() { this.errorsLogged = 0; } @@ -48,7 +48,7 @@ this.initTestLogging = function initTestLogging(level) { return logStats; } -this.getTestLogger = function getTestLogger(component) { +function getTestLogger(component) { return Log4Moz.repository.getLogger("Testing"); } diff --git a/services/common/modules-testing/storageserver.js b/services/common/modules-testing/storageserver.js index 11ae06fff50..42ddcddae2b 100644 --- a/services/common/modules-testing/storageserver.js +++ b/services/common/modules-testing/storageserver.js @@ -10,7 +10,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components; -this.EXPORTED_SYMBOLS = [ +const EXPORTED_SYMBOLS = [ "ServerBSO", "StorageServerCallback", "StorageServerCollection", @@ -65,7 +65,7 @@ function sendMozSvcError(request, response, code) { * (number) Milliseconds since UNIX epoch that the BSO was last * modified. If not defined or null, the current time will be used. */ -this.ServerBSO = function ServerBSO(id, payload, modified) { +function ServerBSO(id, payload, modified) { if (!id) { throw new Error("No ID for ServerBSO!"); } @@ -274,8 +274,7 @@ ServerBSO.prototype = { * An optional timestamp value to initialize the modified time of the * collection. This should be in the format returned by new_timestamp(). */ -this.StorageServerCollection = - function StorageServerCollection(bsos, acceptNew, timestamp=new_timestamp()) { +function StorageServerCollection(bsos, acceptNew, timestamp=new_timestamp()) { this._bsos = bsos || {}; this.acceptNew = acceptNew || false; @@ -849,7 +848,7 @@ StorageServerCollection.prototype = { * find out what it needs without monkeypatching. Use this object as your * prototype, and override as appropriate. */ -this.StorageServerCallback = { +let StorageServerCallback = { onCollectionDeleted: function onCollectionDeleted(user, collection) {}, onItemDeleted: function onItemDeleted(user, collection, bsoID) {}, @@ -866,7 +865,7 @@ this.StorageServerCallback = { * Construct a new test Storage server. Takes a callback object (e.g., * StorageServerCallback) as input. */ -this.StorageServer = function StorageServer(callback) { +function StorageServer(callback) { this.callback = callback || {__proto__: StorageServerCallback}; this.server = new HttpServer(); this.started = false; @@ -1645,8 +1644,7 @@ StorageServer.prototype = { * * Each user is specified by a map of username to password. */ -this.storageServerForUsers = - function storageServerForUsers(users, contents, callback) { +function storageServerForUsers(users, contents, callback) { let server = new StorageServer(callback); for (let [user, pass] in Iterator(users)) { server.registerUser(user, pass); diff --git a/services/common/modules-testing/utils.js b/services/common/modules-testing/utils.js index ee7e56aa57d..a588b78ddff 100644 --- a/services/common/modules-testing/utils.js +++ b/services/common/modules-testing/utils.js @@ -4,11 +4,11 @@ "use strict"; -this.EXPORTED_SYMBOLS = [ +const EXPORTED_SYMBOLS = [ "TestingUtils", ]; -this.TestingUtils = { +let TestingUtils = { /** * Perform a deep copy of an Array or Object. */ diff --git a/services/common/observers.js b/services/common/observers.js index 957d958e098..1bd23d720ba 100644 --- a/services/common/observers.js +++ b/services/common/observers.js @@ -2,7 +2,7 @@ * 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 = ["Observers"]; +let EXPORTED_SYMBOLS = ["Observers"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -17,7 +17,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); * * @version 0.2 */ -this.Observers = { +let Observers = { /** * Register the given callback as an observer of the given topic. * diff --git a/services/common/preferences.js b/services/common/preferences.js index 44477d58ed1..dec58a9bb8f 100644 --- a/services/common/preferences.js +++ b/services/common/preferences.js @@ -2,7 +2,7 @@ * 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 = ["Preferences"]; +let EXPORTED_SYMBOLS = ["Preferences"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -18,8 +18,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); const MAX_INT = Math.pow(2, 31) - 1; const MIN_INT = -MAX_INT; -this.Preferences = - function Preferences(args) { +function Preferences(args) { if (isObject(args)) { if (args.branch) this._prefBranch = args.branch; diff --git a/services/common/rest.js b/services/common/rest.js index 0ceb878ffb6..63110b67b56 100644 --- a/services/common/rest.js +++ b/services/common/rest.js @@ -4,7 +4,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; -this.EXPORTED_SYMBOLS = [ +const EXPORTED_SYMBOLS = [ "RESTRequest", "RESTResponse", "TokenAuthenticatedRESTRequest" @@ -74,7 +74,7 @@ const Prefs = new Preferences("services.common.rest."); * }); * request.get(); */ -this.RESTRequest = function RESTRequest(uri) { +function RESTRequest(uri) { this.status = this.NOT_SENT; // If we don't have an nsIURI object yet, make one. This will throw if @@ -580,7 +580,7 @@ RESTRequest.prototype = { * Response object for a RESTRequest. This will be created automatically by * the RESTRequest. */ -this.RESTResponse = function RESTResponse() { +function RESTResponse() { this._log = Log4Moz.repository.getLogger(this._logName); this._log.level = Log4Moz.Level[Prefs.get("log.logger.rest.response")]; @@ -671,8 +671,7 @@ RESTResponse.prototype = { * nonce, and ext. See CrytoUtils.computeHTTPMACSHA1 for information on * the purpose of these values. */ -this.TokenAuthenticatedRESTRequest = - function TokenAuthenticatedRESTRequest(uri, authToken, extra) { +function TokenAuthenticatedRESTRequest(uri, authToken, extra) { RESTRequest.call(this, uri); this.authToken = authToken; this.extra = extra || {}; diff --git a/services/common/storageservice.js b/services/common/storageservice.js index 89670a31a5d..a1af5ea8e02 100644 --- a/services/common/storageservice.js +++ b/services/common/storageservice.js @@ -25,7 +25,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = [ +const EXPORTED_SYMBOLS = [ "BasicStorageObject", "StorageServiceClient", "StorageServiceRequestError", @@ -70,8 +70,7 @@ const Prefs = new Preferences("services.common.storageservice."); * (string) ID of BSO. Can be null. * (string) Collection BSO belongs to. Can be null; */ -this.BasicStorageObject = - function BasicStorageObject(id=null, collection=null) { +function BasicStorageObject(id=null, collection=null) { this.data = {}; this.id = id; this.collection = collection; @@ -267,7 +266,7 @@ BasicStorageObject.prototype = { * never happen. But, it does. If set, this will be an Error which * describes the error as reported by the server. */ -this.StorageServiceRequestError = function StorageServiceRequestError() { +function StorageServiceRequestError() { this.serverModified = false; this.notFound = false; this.conflict = false; @@ -1520,7 +1519,7 @@ Object.freeze(StorageCollectionBatchedDelete.prototype); * @param baseURI * (string) Base URI for all requests. */ -this.StorageServiceClient = function StorageServiceClient(baseURI) { +function StorageServiceClient(baseURI) { this._log = Log4Moz.repository.getLogger("Services.Common.StorageServiceClient"); this._log.level = Log4Moz.Level[Prefs.get("log.level")]; diff --git a/services/common/stringbundle.js b/services/common/stringbundle.js index 230fd78a612..22fc5446da7 100644 --- a/services/common/stringbundle.js +++ b/services/common/stringbundle.js @@ -2,7 +2,7 @@ * 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 = ["StringBundle"]; +const EXPORTED_SYMBOLS = ["StringBundle"]; const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components; @@ -30,7 +30,7 @@ const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components; * @param url {String} * the URL of the string bundle */ -this.StringBundle = function StringBundle(url) { +function StringBundle(url) { this.url = url; } diff --git a/services/common/tokenserverclient.js b/services/common/tokenserverclient.js index db7f4cf879c..f80eaabf121 100644 --- a/services/common/tokenserverclient.js +++ b/services/common/tokenserverclient.js @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = [ +const EXPORTED_SYMBOLS = [ "TokenServerClient", "TokenServerClientError", "TokenServerClientNetworkError", @@ -28,7 +28,7 @@ const Prefs = new Preferences("services.common.tokenserverclient."); * @param message * (string) Error message. */ -this.TokenServerClientError = function TokenServerClientError(message) { +function TokenServerClientError(message) { this.name = "TokenServerClientError"; this.message = message || "Client error."; } @@ -41,8 +41,7 @@ TokenServerClientError.prototype.constructor = TokenServerClientError; * @param error * The underlying error thrown by the network layer. */ -this.TokenServerClientNetworkError = - function TokenServerClientNetworkError(error) { +function TokenServerClientNetworkError(error) { this.name = "TokenServerClientNetworkError"; this.error = error; } @@ -80,8 +79,7 @@ TokenServerClientNetworkError.prototype.constructor = * @param message * (string) Error message. */ -this.TokenServerClientServerError = - function TokenServerClientServerError(message, cause="general") { +function TokenServerClientServerError(message, cause="general") { this.name = "TokenServerClientServerError"; this.message = message || "Server error."; this.cause = cause; @@ -113,7 +111,7 @@ TokenServerClientServerError.prototype.constructor = * might be helpful if callers had a richer API that communicated who was * at fault (e.g. differentiating a 503 from a 401). */ -this.TokenServerClient = function TokenServerClient() { +function TokenServerClient() { this._log = Log4Moz.repository.getLogger("Common.TokenServerClient"); this._log.level = Log4Moz.Level[Prefs.get("logger.level")]; } diff --git a/services/common/utils.js b/services/common/utils.js index abb64318598..1899469b177 100644 --- a/services/common/utils.js +++ b/services/common/utils.js @@ -4,7 +4,7 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; -this.EXPORTED_SYMBOLS = ["CommonUtils"]; +const EXPORTED_SYMBOLS = ["CommonUtils"]; Cu.import("resource://gre/modules/FileUtils.jsm"); Cu.import("resource://gre/modules/NetUtil.jsm"); @@ -12,7 +12,7 @@ Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://services-common/log4moz.js"); -this.CommonUtils = { +let CommonUtils = { exceptionStr: function exceptionStr(e) { let message = e.message ? e.message : e; return message + " " + CommonUtils.stackTrace(e); diff --git a/services/crypto/modules/WeaveCrypto.js b/services/crypto/modules/WeaveCrypto.js index f7583e4cb3e..771b9102314 100644 --- a/services/crypto/modules/WeaveCrypto.js +++ b/services/crypto/modules/WeaveCrypto.js @@ -2,7 +2,7 @@ * 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 = ["WeaveCrypto"]; +const EXPORTED_SYMBOLS = ["WeaveCrypto"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -26,7 +26,7 @@ const KEYSIZE_AES_256 = 32; const KEY_DERIVATION_ITERATIONS = 4096; // PKCS#5 recommends at least 1000. const INITIAL_BUFFER_SIZE = 1024; -this.WeaveCrypto = function WeaveCrypto() { +function WeaveCrypto() { this.init(); } diff --git a/services/crypto/modules/utils.js b/services/crypto/modules/utils.js index c507813a5f4..dc7185df2fc 100644 --- a/services/crypto/modules/utils.js +++ b/services/crypto/modules/utils.js @@ -4,13 +4,13 @@ const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components; -this.EXPORTED_SYMBOLS = ["CryptoUtils"]; +const EXPORTED_SYMBOLS = ["CryptoUtils"]; Cu.import("resource://services-common/observers.js"); Cu.import("resource://services-common/utils.js"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -this.CryptoUtils = { +let CryptoUtils = { /** * Generate a string of random bytes. */ diff --git a/services/notifications/service.js b/services/notifications/service.js index fc52a515a41..514b0aacc9f 100644 --- a/services/notifications/service.js +++ b/services/notifications/service.js @@ -2,7 +2,7 @@ * 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 = ["Service"]; +const EXPORTED_SYMBOLS = ["Service"]; const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components; @@ -24,5 +24,5 @@ NotificationSvc.prototype = { } }; -this.Service = new NotificationSvc(); +let Service = new NotificationSvc(); Service.onStartup(); diff --git a/services/sync/Weave.js b/services/sync/Weave.js index ae4c348cc21..2af3608db91 100644 --- a/services/sync/Weave.js +++ b/services/sync/Weave.js @@ -70,4 +70,4 @@ AboutWeaveLog.prototype = { }; const components = [WeaveService, AboutWeaveLog]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/services/sync/modules-testing/fakeservices.js b/services/sync/modules-testing/fakeservices.js index b7c17b3d9be..48e4922c88c 100644 --- a/services/sync/modules-testing/fakeservices.js +++ b/services/sync/modules-testing/fakeservices.js @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = [ +const EXPORTED_SYMBOLS = [ "FakeCryptoService", "FakeFilesystemService", "FakeGUIDService", @@ -18,7 +18,7 @@ Cu.import("resource://services-sync/util.js"); let btoa = Cu.import("resource://services-common/log4moz.js").btoa; -this.FakeFilesystemService = function FakeFilesystemService(contents) { +function FakeFilesystemService(contents) { this.fakeContents = contents; let self = this; @@ -38,7 +38,7 @@ this.FakeFilesystemService = function FakeFilesystemService(contents) { }; }; -this.fakeSHA256HMAC = function fakeSHA256HMAC(message) { +function fakeSHA256HMAC(message) { message = message.substr(0, 64); while (message.length < 64) { message += " "; @@ -46,7 +46,7 @@ this.fakeSHA256HMAC = function fakeSHA256HMAC(message) { return message; } -this.FakeGUIDService = function FakeGUIDService() { +function FakeGUIDService() { let latestGUID = 0; Utils.makeGUID = function makeGUID() { @@ -58,7 +58,7 @@ this.FakeGUIDService = function FakeGUIDService() { * Mock implementation of WeaveCrypto. It does not encrypt or * decrypt, merely returning the input verbatim. */ -this.FakeCryptoService = function FakeCryptoService() { +function FakeCryptoService() { this.counter = 0; delete Svc.Crypto; // get rid of the getter first diff --git a/services/sync/modules-testing/rotaryengine.js b/services/sync/modules-testing/rotaryengine.js index d86c1a75e44..1104af9192c 100644 --- a/services/sync/modules-testing/rotaryengine.js +++ b/services/sync/modules-testing/rotaryengine.js @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = [ +const EXPORTED_SYMBOLS = [ "RotaryEngine", "RotaryRecord", "RotaryStore", @@ -24,7 +24,7 @@ Cu.import("resource://services-sync/util.js"); * Complete with record, store, and tracker implementations. */ -this.RotaryRecord = function RotaryRecord(collection, id) { +function RotaryRecord(collection, id) { CryptoWrapper.call(this, collection, id); } RotaryRecord.prototype = { @@ -32,7 +32,7 @@ RotaryRecord.prototype = { }; Utils.deferGetSet(RotaryRecord, "cleartext", ["denomination"]); -this.RotaryStore = function RotaryStore(engine) { +function RotaryStore(engine) { Store.call(this, "Rotary", engine); this.items = {}; } @@ -88,7 +88,7 @@ RotaryStore.prototype = { } }; -this.RotaryTracker = function RotaryTracker(engine) { +function RotaryTracker(engine) { Tracker.call(this, "Rotary", engine); } RotaryTracker.prototype = { @@ -96,7 +96,7 @@ RotaryTracker.prototype = { }; -this.RotaryEngine = function RotaryEngine(service) { +function RotaryEngine(service) { SyncEngine.call(this, "Rotary", service); // Ensure that the engine starts with a clean slate. this.toFetch = []; diff --git a/services/sync/modules-testing/utils.js b/services/sync/modules-testing/utils.js index 33b10ed37a2..8a06e346b74 100644 --- a/services/sync/modules-testing/utils.js +++ b/services/sync/modules-testing/utils.js @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = [ +const EXPORTED_SYMBOLS = [ "TEST_CLUSTER_URL", "TEST_SERVER_URL", "btoa", // It comes from a module import. @@ -21,15 +21,15 @@ Cu.import("resource://services-crypto/utils.js"); Cu.import("resource://testing-common/services-common/logging.js"); Cu.import("resource://testing-common/services/sync/fakeservices.js"); -this.TEST_SERVER_URL = "http://localhost:8080/"; -this.TEST_CLUSTER_URL = TEST_SERVER_URL; +const TEST_SERVER_URL = "http://localhost:8080/"; +const TEST_CLUSTER_URL = TEST_SERVER_URL; /** * First wait >100ms (nsITimers can take up to that much time to fire, so * we can account for the timer in delayedAutoconnect) and then two event * loop ticks (to account for the Utils.nextTick() in autoConnect). */ -this.waitForZeroTimer = function waitForZeroTimer(callback) { +function waitForZeroTimer(callback) { let ticks = 2; function wait() { if (ticks) { @@ -42,8 +42,7 @@ this.waitForZeroTimer = function waitForZeroTimer(callback) { CommonUtils.namedTimer(wait, 150, {}, "timer"); } -this.setBasicCredentials = - function setBasicCredentials(username, password, syncKey) { +function setBasicCredentials(username, password, syncKey) { let ns = {}; Cu.import("resource://services-sync/service.js", ns); @@ -53,8 +52,7 @@ this.setBasicCredentials = auth.syncKey = syncKey; } -this.SyncTestingInfrastructure = - function SyncTestingInfrastructure(username, password, syncKey) { +function SyncTestingInfrastructure(username, password, syncKey) { let ns = {}; Cu.import("resource://services-sync/service.js", ns); @@ -75,7 +73,7 @@ this.SyncTestingInfrastructure = /** * Turn WBO cleartext into fake "encrypted" payload as it goes over the wire. */ -this.encryptPayload = function encryptPayload(cleartext) { +function encryptPayload(cleartext) { if (typeof cleartext == "object") { cleartext = JSON.stringify(cleartext); } diff --git a/services/sync/modules/addonsreconciler.js b/services/sync/modules/addonsreconciler.js index 9308a46fca5..f222540db09 100644 --- a/services/sync/modules/addonsreconciler.js +++ b/services/sync/modules/addonsreconciler.js @@ -25,14 +25,14 @@ Cu.import("resource://gre/modules/AddonManager.jsm"); const DEFAULT_STATE_FILE = "addonsreconciler"; -this.CHANGE_INSTALLED = 1; -this.CHANGE_UNINSTALLED = 2; -this.CHANGE_ENABLED = 3; -this.CHANGE_DISABLED = 4; +const CHANGE_INSTALLED = 1; +const CHANGE_UNINSTALLED = 2; +const CHANGE_ENABLED = 3; +const CHANGE_DISABLED = 4; -this.EXPORTED_SYMBOLS = ["AddonsReconciler", "CHANGE_INSTALLED", - "CHANGE_UNINSTALLED", "CHANGE_ENABLED", - "CHANGE_DISABLED"]; +const EXPORTED_SYMBOLS = ["AddonsReconciler", "CHANGE_INSTALLED", + "CHANGE_UNINSTALLED", "CHANGE_ENABLED", + "CHANGE_DISABLED"]; /** * Maintains state of add-ons. * @@ -113,7 +113,7 @@ this.EXPORTED_SYMBOLS = ["AddonsReconciler", "CHANGE_INSTALLED", * events will occur immediately. However, we still see disabling events and * heed them like they were normal. In the end, the state is proper. */ -this.AddonsReconciler = function AddonsReconciler() { +function AddonsReconciler() { this._log = Log4Moz.repository.getLogger("Sync.AddonsReconciler"); let level = Svc.Prefs.get("log.logger.addonsreconciler", "Debug"); this._log.level = Log4Moz.Level[level]; diff --git a/services/sync/modules/addonutils.js b/services/sync/modules/addonutils.js index fee7649f61b..ea693a20fa6 100644 --- a/services/sync/modules/addonutils.js +++ b/services/sync/modules/addonutils.js @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["AddonUtils"]; +const EXPORTED_SYMBOLS = ["AddonUtils"]; const {interfaces: Ci, utils: Cu} = Components; diff --git a/services/sync/modules/engines.js b/services/sync/modules/engines.js index f0ca10f7e33..256b70626a4 100644 --- a/services/sync/modules/engines.js +++ b/services/sync/modules/engines.js @@ -2,7 +2,7 @@ * 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 = [ +const EXPORTED_SYMBOLS = [ "EngineManager", "Engine", "SyncEngine", @@ -33,7 +33,7 @@ Cu.import("resource://services-sync/util.js"); * want to sync. * */ -this.Tracker = function Tracker(name, engine) { +function Tracker(name, engine) { if (!engine) { throw new Error("Tracker must be associated with an Engine instance."); } @@ -171,7 +171,7 @@ Tracker.prototype = { * and/or applyIncoming function on top of the basic APIs. */ -this.Store = function Store(name, engine) { +function Store(name, engine) { if (!engine) { throw new Error("Store must be associated with an Engine instance."); } @@ -362,7 +362,7 @@ Store.prototype = { } }; -this.EngineManager = function EngineManager(service) { +function EngineManager(service) { this.service = service; this._engines = {}; @@ -449,7 +449,7 @@ EngineManager.prototype = { }, }; -this.Engine = function Engine(name, service) { +function Engine(name, service) { if (!service) { throw new Error("Engine must be associated with a Service instance."); } @@ -527,7 +527,7 @@ Engine.prototype = { } }; -this.SyncEngine = function SyncEngine(name, service) { +function SyncEngine(name, service) { Engine.call(this, name || "SyncEngine", service); this.loadToFetch(); diff --git a/services/sync/modules/engines/addons.js b/services/sync/modules/engines/addons.js index c9299eb0496..b0b7e2c1028 100644 --- a/services/sync/modules/engines/addons.js +++ b/services/sync/modules/engines/addons.js @@ -50,7 +50,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "AddonManager", XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository", "resource://gre/modules/AddonRepository.jsm"); -this.EXPORTED_SYMBOLS = ["AddonsEngine"]; +const EXPORTED_SYMBOLS = ["AddonsEngine"]; // 7 days in milliseconds. const PRUNE_ADDON_CHANGES_THRESHOLD = 60 * 60 * 24 * 7 * 1000; @@ -107,7 +107,7 @@ Utils.deferGetSet(AddonRecord, "cleartext", ["addonID", * The engine instance overrides a handful of functions on the base class. The * rationale for each is documented by that function. */ -this.AddonsEngine = function AddonsEngine(service) { +function AddonsEngine(service) { SyncEngine.call(this, "Addons", service); this._reconciler = new AddonsReconciler(); diff --git a/services/sync/modules/engines/apps.js b/services/sync/modules/engines/apps.js index 58967acad41..ae35c409074 100644 --- a/services/sync/modules/engines/apps.js +++ b/services/sync/modules/engines/apps.js @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ['AppsEngine', 'AppRec']; +const EXPORTED_SYMBOLS = ['AppsEngine', 'AppRec']; const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; @@ -15,7 +15,7 @@ Cu.import("resource://services-sync/constants.js"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Webapps.jsm"); -this.AppRec = function AppRec(collection, id) { +function AppRec(collection, id) { CryptoWrapper.call(this, collection, id); } @@ -123,7 +123,7 @@ AppTracker.prototype = { } } -this.AppsEngine = function AppsEngine(service) { +function AppsEngine(service) { SyncEngine.call(this, "Apps", service); } diff --git a/services/sync/modules/engines/bookmarks.js b/services/sync/modules/engines/bookmarks.js index 460ad2f6f26..ee105ca59c6 100644 --- a/services/sync/modules/engines/bookmarks.js +++ b/services/sync/modules/engines/bookmarks.js @@ -2,9 +2,9 @@ * 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 = ['BookmarksEngine', "PlacesItem", "Bookmark", - "BookmarkFolder", "BookmarkQuery", - "Livemark", "BookmarkSeparator"]; +const EXPORTED_SYMBOLS = ['BookmarksEngine', "PlacesItem", "Bookmark", + "BookmarkFolder", "BookmarkQuery", + "Livemark", "BookmarkSeparator"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -33,7 +33,7 @@ const ANNOS_TO_TRACK = [DESCRIPTION_ANNO, SIDEBAR_ANNO, const SERVICE_NOT_SUPPORTED = "Service not supported on this platform"; const FOLDER_SORTINDEX = 1000000; -this.PlacesItem = function PlacesItem(collection, id, type) { +function PlacesItem(collection, id, type) { CryptoWrapper.call(this, collection, id); this.type = type || "item"; } @@ -76,7 +76,7 @@ Utils.deferGetSet(PlacesItem, "cleartext", ["hasDupe", "parentid", "parentName", "type"]); -this.Bookmark = function Bookmark(collection, id, type) { +function Bookmark(collection, id, type) { PlacesItem.call(this, collection, id, type || "bookmark"); } Bookmark.prototype = { @@ -89,7 +89,7 @@ Utils.deferGetSet(Bookmark, ["title", "bmkUri", "description", "loadInSidebar", "tags", "keyword"]); -this.BookmarkQuery = function BookmarkQuery(collection, id) { +function BookmarkQuery(collection, id) { Bookmark.call(this, collection, id, "query"); } BookmarkQuery.prototype = { @@ -101,7 +101,7 @@ Utils.deferGetSet(BookmarkQuery, "cleartext", ["folderName", "queryId"]); -this.BookmarkFolder = function BookmarkFolder(collection, id, type) { +function BookmarkFolder(collection, id, type) { PlacesItem.call(this, collection, id, type || "folder"); } BookmarkFolder.prototype = { @@ -112,7 +112,7 @@ BookmarkFolder.prototype = { Utils.deferGetSet(BookmarkFolder, "cleartext", ["description", "title", "children"]); -this.Livemark = function Livemark(collection, id) { +function Livemark(collection, id) { BookmarkFolder.call(this, collection, id, "livemark"); } Livemark.prototype = { @@ -122,7 +122,7 @@ Livemark.prototype = { Utils.deferGetSet(Livemark, "cleartext", ["siteUri", "feedUri"]); -this.BookmarkSeparator = function BookmarkSeparator(collection, id) { +function BookmarkSeparator(collection, id) { PlacesItem.call(this, collection, id, "separator"); } BookmarkSeparator.prototype = { @@ -191,7 +191,7 @@ let kSpecialIds = { get mobile() this.findMobileRoot(true), }; -this.BookmarksEngine = function BookmarksEngine(service) { +function BookmarksEngine(service) { SyncEngine.call(this, "Bookmarks", service); } BookmarksEngine.prototype = { diff --git a/services/sync/modules/engines/clients.js b/services/sync/modules/engines/clients.js index 432393c01f9..c515a0ffdbe 100644 --- a/services/sync/modules/engines/clients.js +++ b/services/sync/modules/engines/clients.js @@ -2,7 +2,7 @@ * 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 = [ +const EXPORTED_SYMBOLS = [ "ClientEngine", "ClientsRec" ]; @@ -18,7 +18,7 @@ Cu.import("resource://services-sync/util.js"); const CLIENTS_TTL = 1814400; // 21 days const CLIENTS_TTL_REFRESH = 604800; // 7 days -this.ClientsRec = function ClientsRec(collection, id) { +function ClientsRec(collection, id) { CryptoWrapper.call(this, collection, id); } ClientsRec.prototype = { @@ -30,7 +30,7 @@ ClientsRec.prototype = { Utils.deferGetSet(ClientsRec, "cleartext", ["name", "type", "commands"]); -this.ClientEngine = function ClientEngine(service) { +function ClientEngine(service) { SyncEngine.call(this, "Clients", service); // Reset the client on every startup so that we fetch recent clients diff --git a/services/sync/modules/engines/forms.js b/services/sync/modules/engines/forms.js index fbbafac87b2..713c256f4ce 100644 --- a/services/sync/modules/engines/forms.js +++ b/services/sync/modules/engines/forms.js @@ -2,7 +2,7 @@ * 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 = ['FormEngine', 'FormRec']; +const EXPORTED_SYMBOLS = ['FormEngine', 'FormRec']; const Cc = Components.classes; const Ci = Components.interfaces; @@ -18,7 +18,7 @@ Cu.import("resource://services-common/log4moz.js"); const FORMS_TTL = 5184000; // 60 days -this.FormRec = function FormRec(collection, id) { +function FormRec(collection, id) { CryptoWrapper.call(this, collection, id); } FormRec.prototype = { @@ -151,7 +151,7 @@ let FormWrapper = { }; -this.FormEngine = function FormEngine(service) { +function FormEngine(service) { SyncEngine.call(this, "Forms", service); } FormEngine.prototype = { diff --git a/services/sync/modules/engines/history.js b/services/sync/modules/engines/history.js index a97515733c7..6559947e461 100644 --- a/services/sync/modules/engines/history.js +++ b/services/sync/modules/engines/history.js @@ -2,7 +2,7 @@ * 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 = ['HistoryEngine', 'HistoryRec']; +const EXPORTED_SYMBOLS = ['HistoryEngine', 'HistoryRec']; const Cc = Components.classes; const Ci = Components.interfaces; @@ -19,7 +19,7 @@ Cu.import("resource://services-sync/engines.js"); Cu.import("resource://services-sync/record.js"); Cu.import("resource://services-sync/util.js"); -this.HistoryRec = function HistoryRec(collection, id) { +function HistoryRec(collection, id) { CryptoWrapper.call(this, collection, id); } HistoryRec.prototype = { @@ -31,7 +31,7 @@ HistoryRec.prototype = { Utils.deferGetSet(HistoryRec, "cleartext", ["histUri", "title", "visits"]); -this.HistoryEngine = function HistoryEngine(service) { +function HistoryEngine(service) { SyncEngine.call(this, "History", service); } HistoryEngine.prototype = { diff --git a/services/sync/modules/engines/passwords.js b/services/sync/modules/engines/passwords.js index 5952b01f380..cd045c092cd 100644 --- a/services/sync/modules/engines/passwords.js +++ b/services/sync/modules/engines/passwords.js @@ -2,7 +2,7 @@ * 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 = ['PasswordEngine', 'LoginRec']; +const EXPORTED_SYMBOLS = ['PasswordEngine', 'LoginRec']; const Cu = Components.utils; const Cc = Components.classes; @@ -14,7 +14,7 @@ Cu.import("resource://services-sync/constants.js"); Cu.import("resource://services-sync/engines.js"); Cu.import("resource://services-sync/util.js"); -this.LoginRec = function LoginRec(collection, id) { +function LoginRec(collection, id) { CryptoWrapper.call(this, collection, id); } LoginRec.prototype = { @@ -26,7 +26,7 @@ Utils.deferGetSet(LoginRec, "cleartext", ["hostname", "formSubmitURL", "httpRealm", "username", "password", "usernameField", "passwordField"]); -this.PasswordEngine = function PasswordEngine(service) { +function PasswordEngine(service) { SyncEngine.call(this, "Passwords", service); } PasswordEngine.prototype = { diff --git a/services/sync/modules/engines/prefs.js b/services/sync/modules/engines/prefs.js index d6363c6f9e7..b5277691cfc 100644 --- a/services/sync/modules/engines/prefs.js +++ b/services/sync/modules/engines/prefs.js @@ -2,7 +2,7 @@ * 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 = ['PrefsEngine', 'PrefRec']; +const EXPORTED_SYMBOLS = ['PrefsEngine', 'PrefRec']; const Cc = Components.classes; const Ci = Components.interfaces; @@ -20,7 +20,7 @@ Cu.import("resource://gre/modules/LightweightThemeManager.jsm"); const PREFS_GUID = CommonUtils.encodeBase64URL(Services.appinfo.ID); -this.PrefRec = function PrefRec(collection, id) { +function PrefRec(collection, id) { CryptoWrapper.call(this, collection, id); } PrefRec.prototype = { @@ -31,7 +31,7 @@ PrefRec.prototype = { Utils.deferGetSet(PrefRec, "cleartext", ["value"]); -this.PrefsEngine = function PrefsEngine(service) { +function PrefsEngine(service) { SyncEngine.call(this, "Prefs", service); } PrefsEngine.prototype = { diff --git a/services/sync/modules/engines/tabs.js b/services/sync/modules/engines/tabs.js index 3b5a0bf4893..b7d63fe410f 100644 --- a/services/sync/modules/engines/tabs.js +++ b/services/sync/modules/engines/tabs.js @@ -2,7 +2,7 @@ * 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 = ['TabEngine', 'TabSetRecord']; +const EXPORTED_SYMBOLS = ['TabEngine', 'TabSetRecord']; const Cc = Components.classes; const Ci = Components.interfaces; @@ -26,7 +26,7 @@ Cu.import("resource://services-common/preferences.js"); const PBPrefs = new Preferences("browser.privatebrowsing."); -this.TabSetRecord = function TabSetRecord(collection, id) { +function TabSetRecord(collection, id) { CryptoWrapper.call(this, collection, id); } TabSetRecord.prototype = { @@ -38,7 +38,7 @@ TabSetRecord.prototype = { Utils.deferGetSet(TabSetRecord, "cleartext", ["clientName", "tabs"]); -this.TabEngine = function TabEngine(service) { +function TabEngine(service) { SyncEngine.call(this, "Tabs", service); // Reset the client on every startup so that we fetch recent tabs diff --git a/services/sync/modules/identity.js b/services/sync/modules/identity.js index ca4a1614651..918a6119d5f 100644 --- a/services/sync/modules/identity.js +++ b/services/sync/modules/identity.js @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["IdentityManager"]; +const EXPORTED_SYMBOLS = ["IdentityManager"]; const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components; @@ -49,7 +49,7 @@ Cu.import("resource://services-sync/util.js"); * authentication mechanisms, you'll probably want to redefine currentAuthState * and any other function that involves the built-in functionality. */ -this.IdentityManager = function IdentityManager() { +function IdentityManager() { this._log = Log4Moz.repository.getLogger("Sync.Identity"); this._log.Level = Log4Moz.Level[Svc.Prefs.get("log.logger.identity")]; diff --git a/services/sync/modules/jpakeclient.js b/services/sync/modules/jpakeclient.js index a8e3435437b..f65705bb434 100644 --- a/services/sync/modules/jpakeclient.js +++ b/services/sync/modules/jpakeclient.js @@ -2,7 +2,7 @@ * 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 = ["JPAKEClient", "SendCredentialsController"]; +const EXPORTED_SYMBOLS = ["JPAKEClient", "SendCredentialsController"]; const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components; @@ -111,7 +111,7 @@ const JPAKE_VERIFY_VALUE = "0123456789ABCDEF"; * Note that after completion or abort, the 'client' instance may not be reused. * You will have to create a new one in case you'd like to restart the process. */ -this.JPAKEClient = function JPAKEClient(controller) { +function JPAKEClient(controller) { this.controller = controller; this._log = Log4Moz.repository.getLogger("Sync.JPAKEClient"); @@ -698,8 +698,7 @@ JPAKEClient.prototype = { * service); * */ -this.SendCredentialsController = - function SendCredentialsController(jpakeclient, service) { +function SendCredentialsController(jpakeclient, service) { this._log = Log4Moz.repository.getLogger("Sync.SendCredentialsController"); this._log.level = Log4Moz.Level[Svc.Prefs.get("log.logger.service.main")]; diff --git a/services/sync/modules/keys.js b/services/sync/modules/keys.js index e228db31f4c..1f775235063 100644 --- a/services/sync/modules/keys.js +++ b/services/sync/modules/keys.js @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = [ +const EXPORTED_SYMBOLS = [ "BulkKeyBundle", "SyncKeyBundle" ]; @@ -119,7 +119,7 @@ KeyBundle.prototype = { * * This is just a KeyBundle with a collection attached. */ -this.BulkKeyBundle = function BulkKeyBundle(collection) { +function BulkKeyBundle(collection) { let log = Log4Moz.repository.getLogger("Sync.BulkKeyBundle"); log.info("BulkKeyBundle being created for " + collection); KeyBundle.call(this); @@ -176,7 +176,7 @@ BulkKeyBundle.prototype = { * * If the username or Sync Key is invalid, an Error will be thrown. */ -this.SyncKeyBundle = function SyncKeyBundle(username, syncKey) { +function SyncKeyBundle(username, syncKey) { let log = Log4Moz.repository.getLogger("Sync.SyncKeyBundle"); log.info("SyncKeyBundle being created."); KeyBundle.call(this); diff --git a/services/sync/modules/main.js b/services/sync/modules/main.js index df3868e20ea..8cb02173335 100644 --- a/services/sync/modules/main.js +++ b/services/sync/modules/main.js @@ -2,9 +2,9 @@ * 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 = ['Weave']; +const EXPORTED_SYMBOLS = ['Weave']; -this.Weave = {}; +let Weave = {}; Components.utils.import("resource://services-sync/constants.js", Weave); let lazies = { "jpakeclient.js": ["JPAKEClient", "SendCredentialsController"], diff --git a/services/sync/modules/notifications.js b/services/sync/modules/notifications.js index 18955aa45ab..15b1587ef52 100644 --- a/services/sync/modules/notifications.js +++ b/services/sync/modules/notifications.js @@ -2,7 +2,7 @@ * 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 = ["Notifications", "Notification", "NotificationButton"]; +const EXPORTED_SYMBOLS = ["Notifications", "Notification", "NotificationButton"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -13,7 +13,7 @@ Cu.import("resource://services-common/observers.js"); Cu.import("resource://services-common/log4moz.js"); Cu.import("resource://services-sync/util.js"); -this.Notifications = { +let Notifications = { // Match the referenced values in toolkit/content/widgets/notification.xml. get PRIORITY_INFO() 1, // PRIORITY_INFO_LOW get PRIORITY_WARNING() 4, // PRIORITY_WARNING_LOW @@ -83,8 +83,7 @@ this.Notifications = { /** * A basic notification. Subclass this to create more complex notifications. */ -this.Notification = - function Notification(title, description, iconURL, priority, buttons) { +function Notification(title, description, iconURL, priority, buttons) { this.title = title; this.description = description; @@ -109,8 +108,7 @@ Notification.prototype.buttons = []; /** * A button to display in a notification. */ -this.NotificationButton = - function NotificationButton(label, accessKey, callback) { +function NotificationButton(label, accessKey, callback) { function callbackWrapper() { try { callback.apply(this, arguments); diff --git a/services/sync/modules/policies.js b/services/sync/modules/policies.js index 058505ec03e..e90671392b7 100644 --- a/services/sync/modules/policies.js +++ b/services/sync/modules/policies.js @@ -2,7 +2,7 @@ * 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 = [ +const EXPORTED_SYMBOLS = [ "ErrorHandler", "SyncScheduler", ]; @@ -15,7 +15,7 @@ Cu.import("resource://services-sync/engines.js"); Cu.import("resource://services-sync/status.js"); Cu.import("resource://services-sync/util.js"); -this.SyncScheduler = function SyncScheduler(service) { +function SyncScheduler(service) { this.service = service; this.init(); } @@ -467,7 +467,7 @@ SyncScheduler.prototype = { const LOG_PREFIX_SUCCESS = "success-"; const LOG_PREFIX_ERROR = "error-"; -this.ErrorHandler = function ErrorHandler(service) { +function ErrorHandler(service) { this.service = service; this.init(); } diff --git a/services/sync/modules/record.js b/services/sync/modules/record.js index b1194bea6b7..4f34ae26acd 100644 --- a/services/sync/modules/record.js +++ b/services/sync/modules/record.js @@ -2,7 +2,7 @@ * 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 = [ +const EXPORTED_SYMBOLS = [ "WBORecord", "RecordManager", "CryptoWrapper", @@ -24,7 +24,7 @@ Cu.import("resource://services-sync/keys.js"); Cu.import("resource://services-sync/resource.js"); Cu.import("resource://services-sync/util.js"); -this.WBORecord = function WBORecord(collection, id) { +function WBORecord(collection, id) { this.data = {}; this.payload = {}; this.collection = collection; // Optional. @@ -108,7 +108,7 @@ Utils.deferGetSet(WBORecord, "data", ["id", "modified", "sortindex", "payload"]) /** * An interface and caching layer for records. */ -this.RecordManager = function RecordManager(service) { +function RecordManager(service) { this.service = service; this._log = Log4Moz.repository.getLogger(this._logName); @@ -167,7 +167,7 @@ RecordManager.prototype = { } }; -this.CryptoWrapper = function CryptoWrapper(collection, id) { +function CryptoWrapper(collection, id) { this.cleartext = {}; WBORecord.call(this, collection, id); this.ciphertext = null; @@ -276,7 +276,7 @@ Utils.deferGetSet(CryptoWrapper, "cleartext", "deleted"); * You can update this thing simply by giving it /info/collections. It'll * use the last modified time to bring itself up to date. */ -this.CollectionKeyManager = function CollectionKeyManager() { +function CollectionKeyManager() { this.lastModified = 0; this._collections = {}; this._default = null; @@ -505,7 +505,7 @@ CollectionKeyManager.prototype = { } } -this.Collection = function Collection(uri, recordObj, service) { +function Collection(uri, recordObj, service) { if (!service) { throw new Error("Collection constructor requires a service."); } diff --git a/services/sync/modules/resource.js b/services/sync/modules/resource.js index 457b92e35da..422680a9e25 100644 --- a/services/sync/modules/resource.js +++ b/services/sync/modules/resource.js @@ -2,7 +2,7 @@ * 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 = [ +const EXPORTED_SYMBOLS = [ "AsyncResource", "Resource" ]; @@ -48,7 +48,7 @@ const DEFAULT_LOAD_FLAGS = * passed (=undefined) when an error occurs. Note that this is independent of * the status of the HTTP response. */ -this.AsyncResource = function AsyncResource(uri) { +function AsyncResource(uri) { this._log = Log4Moz.repository.getLogger(this._logName); this._log.level = Log4Moz.Level[Svc.Prefs.get("log.logger.network.resources")]; @@ -350,7 +350,7 @@ AsyncResource.prototype = { * 'Resource' is not recommended for new code. Use the asynchronous API of * 'AsyncResource' instead. */ -this.Resource = function Resource(uri) { +function Resource(uri) { AsyncResource.call(this, uri); } Resource.prototype = { diff --git a/services/sync/modules/rest.js b/services/sync/modules/rest.js index 15e83a24f86..d3770a3b88f 100644 --- a/services/sync/modules/rest.js +++ b/services/sync/modules/rest.js @@ -9,14 +9,14 @@ Cu.import("resource://services-common/rest.js"); Cu.import("resource://services-sync/util.js"); Cu.import("resource://services-sync/constants.js"); -this.EXPORTED_SYMBOLS = ["SyncStorageRequest"]; +const EXPORTED_SYMBOLS = ["SyncStorageRequest"]; const STORAGE_REQUEST_TIMEOUT = 5 * 60; // 5 minutes /** * RESTRequest variant for use against a Sync storage server. */ -this.SyncStorageRequest = function SyncStorageRequest(uri) { +function SyncStorageRequest(uri) { RESTRequest.call(this, uri); this.authenticator = null; diff --git a/services/sync/modules/service.js b/services/sync/modules/service.js index 887a6756c66..3c09b679972 100644 --- a/services/sync/modules/service.js +++ b/services/sync/modules/service.js @@ -2,7 +2,7 @@ * 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 = ["Service"]; +const EXPORTED_SYMBOLS = ["Service"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -1475,5 +1475,5 @@ Sync11Service.prototype = { }, }; -this.Service = new Sync11Service(); +let Service = new Sync11Service(); Service.onStartup(); diff --git a/services/sync/modules/stages/cluster.js b/services/sync/modules/stages/cluster.js index dd7717201b8..19e7de62f07 100644 --- a/services/sync/modules/stages/cluster.js +++ b/services/sync/modules/stages/cluster.js @@ -2,7 +2,7 @@ * 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 = ["ClusterManager"]; +const EXPORTED_SYMBOLS = ["ClusterManager"]; const {utils: Cu} = Components; @@ -14,7 +14,7 @@ Cu.import("resource://services-sync/util.js"); /** * Contains code for managing the Sync cluster we are in. */ -this.ClusterManager = function ClusterManager(service) { +function ClusterManager(service) { this._log = Log4Moz.repository.getLogger("Sync.Service"); this._log.level = Log4Moz.Level[Svc.Prefs.get("log.logger.service.main")]; diff --git a/services/sync/modules/stages/enginesync.js b/services/sync/modules/stages/enginesync.js index 823c71ffcb2..da5204ef4d1 100644 --- a/services/sync/modules/stages/enginesync.js +++ b/services/sync/modules/stages/enginesync.js @@ -6,7 +6,7 @@ * This file contains code for synchronizing engines. */ -this.EXPORTED_SYMBOLS = ["EngineSynchronizer"]; +const EXPORTED_SYMBOLS = ["EngineSynchronizer"]; const {utils: Cu} = Components; @@ -21,7 +21,7 @@ Cu.import("resource://services-sync/util.js"); * * This was originally split out of service.js. The API needs lots of love. */ -this.EngineSynchronizer = function EngineSynchronizer(service) { +function EngineSynchronizer(service) { this._log = Log4Moz.repository.getLogger("Sync.Synchronizer"); this._log.level = Log4Moz.Level[Svc.Prefs.get("log.logger.synchronizer")]; diff --git a/services/sync/modules/status.js b/services/sync/modules/status.js index f17736a94b7..6ffc26e4093 100644 --- a/services/sync/modules/status.js +++ b/services/sync/modules/status.js @@ -2,7 +2,7 @@ * 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"]; +const EXPORTED_SYMBOLS = ["Status"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -14,7 +14,7 @@ Cu.import("resource://services-common/log4moz.js"); Cu.import("resource://services-sync/identity.js"); Cu.import("resource://gre/modules/Services.jsm"); -this.Status = { +let Status = { _log: Log4Moz.repository.getLogger("Sync.Status"), _authManager: new IdentityManager(), ready: false, diff --git a/services/sync/modules/userapi.js b/services/sync/modules/userapi.js index d09a98d5d41..e3da2786c06 100644 --- a/services/sync/modules/userapi.js +++ b/services/sync/modules/userapi.js @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = [ +const EXPORTED_SYMBOLS = [ "UserAPI10Client", ]; @@ -23,7 +23,7 @@ Cu.import("resource://services-sync/util.js"); * * Instances are constructed with the base URI of the service. */ -this.UserAPI10Client = function UserAPI10Client(baseURI) { +function UserAPI10Client(baseURI) { this._log = Log4Moz.repository.getLogger("Sync.UserAPI"); this._log.level = Log4Moz.Level[Svc.Prefs.get("log.logger.userapi")]; diff --git a/services/sync/modules/util.js b/services/sync/modules/util.js index 18d42aa8d4a..29b7aa0ff0d 100644 --- a/services/sync/modules/util.js +++ b/services/sync/modules/util.js @@ -2,8 +2,8 @@ * 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 = ["XPCOMUtils", "Services", "NetUtil", "PlacesUtils", - "FileUtils", "Utils", "Async", "Svc", "Str"]; +const EXPORTED_SYMBOLS = ["XPCOMUtils", "Services", "NetUtil", "PlacesUtils", + "FileUtils", "Utils", "Async", "Svc", "Str"]; const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components; @@ -12,20 +12,20 @@ Cu.import("resource://services-common/observers.js"); Cu.import("resource://services-common/preferences.js"); Cu.import("resource://services-common/stringbundle.js"); Cu.import("resource://services-common/utils.js"); -Cu.import("resource://services-common/async.js", this); +Cu.import("resource://services-common/async.js"); Cu.import("resource://services-crypto/utils.js"); Cu.import("resource://services-sync/constants.js"); -Cu.import("resource://gre/modules/XPCOMUtils.jsm", this); -Cu.import("resource://gre/modules/Services.jsm", this); -Cu.import("resource://gre/modules/PlacesUtils.jsm", this); -Cu.import("resource://gre/modules/NetUtil.jsm", this); -Cu.import("resource://gre/modules/FileUtils.jsm", this); +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); +Cu.import("resource://gre/modules/Services.jsm"); +Cu.import("resource://gre/modules/PlacesUtils.jsm"); +Cu.import("resource://gre/modules/NetUtil.jsm"); +Cu.import("resource://gre/modules/FileUtils.jsm"); /* * Utility functions */ -this.Utils = { +let Utils = { // Alias in functions from CommonUtils. These previously were defined here. // In the ideal world, references to these would be removed. nextTick: CommonUtils.nextTick, @@ -535,7 +535,7 @@ XPCOMUtils.defineLazyGetter(Utils, "_utf8Converter", function() { /* * Commonly-used services */ -this.Svc = {}; +let Svc = {}; Svc.Prefs = new Preferences(PREFS_BRANCH); Svc.DefaultPrefs = new Preferences({branch: PREFS_BRANCH, defaultBranch: true}); Svc.Obs = Observers; @@ -570,7 +570,7 @@ Svc.__defineGetter__("Crypto", function() { return Svc.Crypto = cryptoSvc; }); -this.Str = {}; +let Str = {}; ["errors", "sync"].forEach(function(lazy) { XPCOMUtils.defineLazyGetter(Str, lazy, Utils.lazyStrings(lazy)); }); diff --git a/storage/test/unit/vacuumParticipant.js b/storage/test/unit/vacuumParticipant.js index a8576643cca..e80655b38b1 100644 --- a/storage/test/unit/vacuumParticipant.js +++ b/storage/test/unit/vacuumParticipant.js @@ -114,4 +114,4 @@ vacuumParticipant.prototype = }; let gComponentsArray = [vacuumParticipant]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(gComponentsArray); +let NSGetFactory = XPCOMUtils.generateNSGetFactory(gComponentsArray); diff --git a/testing/marionette/components/marionettecomponent.js b/testing/marionette/components/marionettecomponent.js index b569d1a75ce..61ba66a0796 100644 --- a/testing/marionette/components/marionettecomponent.js +++ b/testing/marionette/components/marionettecomponent.js @@ -102,4 +102,4 @@ MarionetteComponent.prototype = { }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([MarionetteComponent]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([MarionetteComponent]); diff --git a/testing/marionette/marionette-elements.js b/testing/marionette/marionette-elements.js index cbbf935193c..05643167271 100644 --- a/testing/marionette/marionette-elements.js +++ b/testing/marionette/marionette-elements.js @@ -11,29 +11,19 @@ * server uses maps this reference to the actual element when it executes the command. */ -this.EXPORTED_SYMBOLS = [ - "ElementManager", - "CLASS_NAME", - "SELECTOR", - "ID", - "NAME", - "LINK_TEXT", - "PARTIAL_LINK_TEXT", - "TAG", - "XPATH" -]; +let EXPORTED_SYMBOLS = ["ElementManager", "CLASS_NAME", "SELECTOR", "ID", "NAME", "LINK_TEXT", "PARTIAL_LINK_TEXT", "TAG", "XPATH"]; let uuidGen = Components.classes["@mozilla.org/uuid-generator;1"] .getService(Components.interfaces.nsIUUIDGenerator); -this.CLASS_NAME = "class name"; -this.SELECTOR = "css selector"; -this.ID = "id"; -this.NAME = "name"; -this.LINK_TEXT = "link text"; -this.PARTIAL_LINK_TEXT = "partial link text"; -this.TAG = "tag name"; -this.XPATH = "xpath"; +let CLASS_NAME = "class name"; +let SELECTOR = "css selector"; +let ID = "id"; +let NAME = "name"; +let LINK_TEXT = "link text"; +let PARTIAL_LINK_TEXT = "partial link text"; +let TAG = "tag name"; +let XPATH = "xpath"; function ElementException(msg, num, stack) { this.message = msg; @@ -42,7 +32,7 @@ function ElementException(msg, num, stack) { } /* NOTE: Bug 736592 has been created to replace seenItems with a weakRef map */ -this.ElementManager = function ElementManager(notSupported) { +function ElementManager(notSupported) { this.searchTimeout = 0; this.seenItems = {}; this.timer = Components.classes["@mozilla.org/timer;1"].createInstance(Components.interfaces.nsITimer); diff --git a/testing/specialpowers/components/SpecialPowersObserver.js b/testing/specialpowers/components/SpecialPowersObserver.js index 81a5c9e3e05..eab9a593477 100644 --- a/testing/specialpowers/components/SpecialPowersObserver.js +++ b/testing/specialpowers/components/SpecialPowersObserver.js @@ -148,4 +148,4 @@ SpecialPowersObserver.prototype = new SpecialPowersObserverAPI(); } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SpecialPowersObserver]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([SpecialPowersObserver]); diff --git a/testing/specialpowers/content/MockFilePicker.jsm b/testing/specialpowers/content/MockFilePicker.jsm index 137b65ba52c..b6e13ae1671 100644 --- a/testing/specialpowers/content/MockFilePicker.jsm +++ b/testing/specialpowers/content/MockFilePicker.jsm @@ -2,7 +2,7 @@ * 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 = ["MockFilePicker"]; +var EXPORTED_SYMBOLS = ["MockFilePicker"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -30,7 +30,7 @@ var newFactory = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIFactory]) }; -this.MockFilePicker = { +var MockFilePicker = { returnOK: Ci.nsIFilePicker.returnOK, returnCancel: Ci.nsIFilePicker.returnCancel, returnReplace: Ci.nsIFilePicker.returnReplace, diff --git a/toolkit/components/console/jsconsole-clhandler.js b/toolkit/components/console/jsconsole-clhandler.js index 3a28f52061e..990a0e476b6 100644 --- a/toolkit/components/console/jsconsole-clhandler.js +++ b/toolkit/components/console/jsconsole-clhandler.js @@ -37,4 +37,4 @@ jsConsoleHandler.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsICommandLineHandler]), }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([jsConsoleHandler]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([jsConsoleHandler]); diff --git a/toolkit/components/contentprefs/nsContentPrefService.js b/toolkit/components/contentprefs/nsContentPrefService.js index 4dc9d4f09c3..edca9542e89 100644 --- a/toolkit/components/contentprefs/nsContentPrefService.js +++ b/toolkit/components/contentprefs/nsContentPrefService.js @@ -1432,4 +1432,4 @@ AsyncStatement.prototype = { // XPCOM Plumbing var components = [ContentPrefService, HostnameGrouper]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/toolkit/components/ctypes/ctypes.cpp b/toolkit/components/ctypes/ctypes.cpp index fd1ea1fae9a..9481f19e5b2 100644 --- a/toolkit/components/ctypes/ctypes.cpp +++ b/toolkit/components/ctypes/ctypes.cpp @@ -9,7 +9,6 @@ #include "nsMemory.h" #include "nsString.h" #include "nsNativeCharsetUtils.h" -#include "mozilla/Preferences.h" #define JSCTYPES_CONTRACTID \ "@mozilla.org/jsctypes;1" @@ -91,10 +90,6 @@ InitAndSealCTypesClass(JSContext* cx, JSObject* global) JS_SetCTypesCallbacks(JSVAL_TO_OBJECT(ctypes), &sCallbacks); - // Can't freeze our global if it's shared. - if (Preferences::GetBool("jsloader.reuseGlobal")) - return true; - // Seal up Object, Function, Array and Error and their prototypes. (This // single object instance is shared amongst everyone who imports the ctypes // module.) diff --git a/toolkit/components/ctypes/ctypes.jsm b/toolkit/components/ctypes/ctypes.jsm index 22b4023a646..270aa1c2cff 100644 --- a/toolkit/components/ctypes/ctypes.jsm +++ b/toolkit/components/ctypes/ctypes.jsm @@ -3,7 +3,7 @@ * 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 = [ "ctypes" ]; +let EXPORTED_SYMBOLS = [ "ctypes" ]; /* * This is the js module for ctypes. Import it like so: diff --git a/toolkit/components/downloads/nsDownloadManagerUI.js b/toolkit/components/downloads/nsDownloadManagerUI.js index 29021756111..fd95b47e4f1 100644 --- a/toolkit/components/downloads/nsDownloadManagerUI.js +++ b/toolkit/components/downloads/nsDownloadManagerUI.js @@ -117,5 +117,5 @@ nsDownloadManagerUI.prototype = { //// Module let components = [nsDownloadManagerUI]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/toolkit/components/downloads/test/unit/downloads_manifest.js b/toolkit/components/downloads/test/unit/downloads_manifest.js index a24622a6d26..839ba0241ba 100644 --- a/toolkit/components/downloads/test/unit/downloads_manifest.js +++ b/toolkit/components/downloads/test/unit/downloads_manifest.js @@ -21,4 +21,4 @@ HelperAppDlg.prototype = { } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([HelperAppDlg]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([HelperAppDlg]); diff --git a/toolkit/components/feeds/FeedProcessor.js b/toolkit/components/feeds/FeedProcessor.js index 7a6e7e404bf..9e094bf4a38 100644 --- a/toolkit/components/feeds/FeedProcessor.js +++ b/toolkit/components/feeds/FeedProcessor.js @@ -1794,4 +1794,4 @@ FeedProcessor.prototype = { var components = [FeedProcessor, FeedResult, Feed, Entry, TextConstruct, Generator, Person]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/toolkit/components/filepicker/nsFilePicker.js b/toolkit/components/filepicker/nsFilePicker.js index b1357e0cf51..773af3efc71 100644 --- a/toolkit/components/filepicker/nsFilePicker.js +++ b/toolkit/components/filepicker/nsFilePicker.js @@ -259,7 +259,7 @@ if (DEBUG) else debug = function (s) {}; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsFilePicker]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsFilePicker]); /* crap from strres.js that I want to use for string bundles since I can't include another .js file.... */ diff --git a/toolkit/components/microformats/Microformats.js b/toolkit/components/microformats/Microformats.js index c291160314f..7b2d4c3b9c0 100644 --- a/toolkit/components/microformats/Microformats.js +++ b/toolkit/components/microformats/Microformats.js @@ -2,9 +2,9 @@ * 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 = ["Microformats", "adr", "tag", "hCard", "hCalendar", "geo"]; +var EXPORTED_SYMBOLS = ["Microformats", "adr", "tag", "hCard", "hCalendar", "geo"]; -this.Microformats = { +var Microformats = { /* When a microformat is added, the name is placed in this list */ list: [], /* Custom iterator so that microformats can be enumerated as */ @@ -1163,7 +1163,7 @@ this.Microformats = { /* MICROFORMAT DEFINITIONS BEGIN HERE */ -this.adr = function adr(node, validate) { +function adr(node, validate) { if (node) { Microformats.parser.newMicroformat(this, node, "adr", validate); } @@ -1255,7 +1255,7 @@ var adr_definition = { Microformats.add("adr", adr_definition); -this.hCard = function hCard(node, validate) { +function hCard(node, validate) { if (node) { Microformats.parser.newMicroformat(this, node, "hCard", validate); } @@ -1464,7 +1464,7 @@ var hCard_definition = { Microformats.add("hCard", hCard_definition); -this.hCalendar = function hCalendar(node, validate) { +function hCalendar(node, validate) { if (node) { Microformats.parser.newMicroformat(this, node, "hCalendar", validate); } @@ -1644,7 +1644,7 @@ var hCalendar_definition = { Microformats.add("hCalendar", hCalendar_definition); -this.geo = function geo(node, validate) { +function geo(node, validate) { if (node) { Microformats.parser.newMicroformat(this, node, "geo", validate); } @@ -1760,7 +1760,7 @@ var geo_definition = { Microformats.add("geo", geo_definition); -this.tag = function tag(node, validate) { +function tag(node, validate) { if (node) { Microformats.parser.newMicroformat(this, node, "tag", validate); } diff --git a/toolkit/components/nsDefaultCLH.js b/toolkit/components/nsDefaultCLH.js index 33130090895..b81eed725ee 100644 --- a/toolkit/components/nsDefaultCLH.js +++ b/toolkit/components/nsDefaultCLH.js @@ -122,4 +122,4 @@ nsDefaultCLH.prototype = { helpInfo : "", }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsDefaultCLH]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsDefaultCLH]); diff --git a/toolkit/components/osfile/osfile.jsm b/toolkit/components/osfile/osfile.jsm index e624798e850..5c7f8c5e367 100644 --- a/toolkit/components/osfile/osfile.jsm +++ b/toolkit/components/osfile/osfile.jsm @@ -7,8 +7,8 @@ */ if (typeof Components != "undefined") { - this.EXPORTED_SYMBOLS = ["OS"]; - Components.utils.import("resource://gre/modules/osfile/osfile_async_front.jsm", this); + var EXPORTED_SYMBOLS = ["OS"]; + Components.utils.import("resource://gre/modules/osfile/osfile_async_front.jsm"); } else { #ifdef XP_WIN importScripts("resource://gre/modules/osfile/osfile_win_front.jsm"); diff --git a/toolkit/components/osfile/osfile_async_front.jsm b/toolkit/components/osfile/osfile_async_front.jsm index b5227857148..68fd42840bc 100644 --- a/toolkit/components/osfile/osfile_async_front.jsm +++ b/toolkit/components/osfile/osfile_async_front.jsm @@ -19,9 +19,9 @@ * @rejects {B} reason */ -this.EXPORTED_SYMBOLS = ["OS"]; +let EXPORTED_SYMBOLS = ["OS"]; -Components.utils.import("resource://gre/modules/osfile/osfile_shared_allthreads.jsm", this); +Components.utils.import("resource://gre/modules/osfile/osfile_shared_allthreads.jsm"); let LOG = OS.Shared.LOG.bind(OS.Shared, "Controller"); let isTypedArray = OS.Shared.isTypedArray; diff --git a/toolkit/components/osfile/osfile_shared_allthreads.jsm b/toolkit/components/osfile/osfile_shared_allthreads.jsm index d3e6a086ff6..56a4f6df62e 100644 --- a/toolkit/components/osfile/osfile_shared_allthreads.jsm +++ b/toolkit/components/osfile/osfile_shared_allthreads.jsm @@ -4,7 +4,7 @@ { if (typeof Components != "undefined") { - this.EXPORTED_SYMBOLS = ["OS"]; + var EXPORTED_SYMBOLS = ["OS"]; } (function(exports) { "use strict"; diff --git a/toolkit/components/osfile/osfile_unix_allthreads.jsm b/toolkit/components/osfile/osfile_unix_allthreads.jsm index 761ad503401..9b0a3aabc79 100644 --- a/toolkit/components/osfile/osfile_unix_allthreads.jsm +++ b/toolkit/components/osfile/osfile_unix_allthreads.jsm @@ -19,9 +19,9 @@ if (typeof Components != "undefined") { // Module is opened as a jsm module - this.EXPORTED_SYMBOLS = ["OS"]; + var EXPORTED_SYMBOLS = ["OS"]; Components.utils.import("resource://gre/modules/ctypes.jsm"); - Components.utils.import("resource://gre/modules/osfile/osfile_shared_allthreads.jsm", this); + Components.utils.import("resource://gre/modules/osfile/osfile_shared_allthreads.jsm"); } else { // File is included from a chrome worker importScripts("resource://gre/modules/osfile/osfile_shared_allthreads.jsm"); diff --git a/toolkit/components/osfile/osfile_win_allthreads.jsm b/toolkit/components/osfile/osfile_win_allthreads.jsm index e6eafc07a32..64f4721986a 100644 --- a/toolkit/components/osfile/osfile_win_allthreads.jsm +++ b/toolkit/components/osfile/osfile_win_allthreads.jsm @@ -19,9 +19,9 @@ if (typeof Components != "undefined") { // Module is opened as a jsm module - this.EXPORTED_SYMBOLS = ["OS"]; + var EXPORTED_SYMBOLS = ["OS"]; Components.utils.import("resource://gre/modules/ctypes.jsm"); - Components.utils.import("resource://gre/modules/osfile/osfile_shared_allthreads.jsm", this); + Components.utils.import("resource://gre/modules/osfile/osfile_shared_allthreads.jsm"); } else { // File is included from a chrome worker importScripts("resource://gre/modules/osfile/osfile_shared_allthreads.jsm"); diff --git a/toolkit/components/osfile/ospath_unix_back.jsm b/toolkit/components/osfile/ospath_unix_back.jsm index 551187044fb..0672e8c5ebb 100644 --- a/toolkit/components/osfile/ospath_unix_back.jsm +++ b/toolkit/components/osfile/ospath_unix_back.jsm @@ -15,8 +15,8 @@ * - all path concatenations go through function |join|. */ if (typeof Components != "undefined") { - this.EXPORTED_SYMBOLS = ["OS"]; - Components.utils.import("resource://gre/modules/osfile/osfile_unix_allthreads.jsm", this); + var EXPORTED_SYMBOLS = ["OS"]; + Components.utils.import("resource://gre/modules/osfile/osfile_unix_allthreads.jsm"); } (function(exports) { "use strict"; diff --git a/toolkit/components/osfile/ospath_win_back.jsm b/toolkit/components/osfile/ospath_win_back.jsm index 8aa193b79d3..5fefaebb10b 100644 --- a/toolkit/components/osfile/ospath_win_back.jsm +++ b/toolkit/components/osfile/ospath_win_back.jsm @@ -23,8 +23,8 @@ * components. */ if (typeof Components != "undefined") { - this.EXPORTED_SYMBOLS = ["OS"]; - Components.utils.import("resource://gre/modules/osfile/osfile_win_allthreads.jsm", this); + var EXPORTED_SYMBOLS = ["OS"]; + Components.utils.import("resource://gre/modules/osfile/osfile_win_allthreads.jsm"); } (function(exports) { "use strict"; diff --git a/toolkit/components/passwordmgr/crypto-SDR.js b/toolkit/components/passwordmgr/crypto-SDR.js index df9c0f0158f..6a7bff39da5 100644 --- a/toolkit/components/passwordmgr/crypto-SDR.js +++ b/toolkit/components/passwordmgr/crypto-SDR.js @@ -225,4 +225,4 @@ LoginManagerCrypto_SDR.prototype = { }; // end of nsLoginManagerCrypto_SDR implementation let component = [LoginManagerCrypto_SDR]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/toolkit/components/passwordmgr/nsLoginInfo.js b/toolkit/components/passwordmgr/nsLoginInfo.js index f2de7c4ed78..574ad704840 100644 --- a/toolkit/components/passwordmgr/nsLoginInfo.js +++ b/toolkit/components/passwordmgr/nsLoginInfo.js @@ -107,4 +107,4 @@ nsLoginInfo.prototype = { }; // end of nsLoginInfo implementation -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsLoginInfo]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsLoginInfo]); diff --git a/toolkit/components/passwordmgr/nsLoginManager.js b/toolkit/components/passwordmgr/nsLoginManager.js index 92c01bc9cb4..913032ce353 100644 --- a/toolkit/components/passwordmgr/nsLoginManager.js +++ b/toolkit/components/passwordmgr/nsLoginManager.js @@ -1388,4 +1388,4 @@ UserAutoCompleteResult.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([LoginManager]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([LoginManager]); diff --git a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js index 77c34349283..9bb43a3076c 100644 --- a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js +++ b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js @@ -1482,4 +1482,4 @@ LoginManagerPrompter.prototype = { var component = [LoginManagerPromptFactory, LoginManagerPrompter]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/toolkit/components/passwordmgr/storage-Legacy.js b/toolkit/components/passwordmgr/storage-Legacy.js index 594eaeaa81d..cab84469aa9 100644 --- a/toolkit/components/passwordmgr/storage-Legacy.js +++ b/toolkit/components/passwordmgr/storage-Legacy.js @@ -1459,4 +1459,4 @@ LoginManagerStorage_legacy.prototype = { } }; // end of nsLoginManagerStorage_legacy implementation -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([LoginManagerStorage_legacy]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([LoginManagerStorage_legacy]); diff --git a/toolkit/components/passwordmgr/storage-mozStorage.js b/toolkit/components/passwordmgr/storage-mozStorage.js index e560c9f1058..d33ba6d59e3 100644 --- a/toolkit/components/passwordmgr/storage-mozStorage.js +++ b/toolkit/components/passwordmgr/storage-mozStorage.js @@ -1681,4 +1681,4 @@ LoginManagerStorage_mozStorage.prototype = { }; // end of nsLoginManagerStorage_mozStorage implementation let component = [LoginManagerStorage_mozStorage]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/toolkit/components/perf/PerfMeasurement.cpp b/toolkit/components/perf/PerfMeasurement.cpp index 1fb4ade90df..9fc9129472f 100644 --- a/toolkit/components/perf/PerfMeasurement.cpp +++ b/toolkit/components/perf/PerfMeasurement.cpp @@ -7,7 +7,6 @@ #include "jsperf.h" #include "mozilla/ModuleUtils.h" #include "nsMemory.h" -#include "mozilla/Preferences.h" #define JSPERF_CONTRACTID \ "@mozilla.org/jsperf;1" @@ -59,10 +58,6 @@ InitAndSealPerfMeasurementClass(JSContext* cx, JSObject* global) if (!JS::RegisterPerfMeasurement(cx, global)) return false; - // Can't freeze our global if it's shared. - if (Preferences::GetBool("jsloader.reuseGlobal")) - return true; - // Seal up Object, Function, and Array and their prototypes. (This single // object instance is shared amongst everyone who imports the jsperf module.) if (!SealObjectAndPrototype(cx, global, "Object") || diff --git a/toolkit/components/perf/PerfMeasurement.jsm b/toolkit/components/perf/PerfMeasurement.jsm index d68298baaab..57878b8aee8 100644 --- a/toolkit/components/perf/PerfMeasurement.jsm +++ b/toolkit/components/perf/PerfMeasurement.jsm @@ -3,7 +3,7 @@ * 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 = [ "PerfMeasurement" ]; +let EXPORTED_SYMBOLS = [ "PerfMeasurement" ]; /* * This is the js module for jsperf. Import it like so: diff --git a/toolkit/components/places/BookmarkHTMLUtils.jsm b/toolkit/components/places/BookmarkHTMLUtils.jsm index 2c9fcbcb43c..98bc17f1632 100644 --- a/toolkit/components/places/BookmarkHTMLUtils.jsm +++ b/toolkit/components/places/BookmarkHTMLUtils.jsm @@ -2,7 +2,7 @@ * 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 = [ "BookmarkHTMLUtils" ]; +const EXPORTED_SYMBOLS = [ "BookmarkHTMLUtils" ]; const Ci = Components.interfaces; const Cc = Components.classes; @@ -30,7 +30,7 @@ const POST_DATA_ANNO = "bookmarkProperties/POSTData"; let serialNumber = 0; // for favicons -this.BookmarkHTMLUtils = Object.freeze({ +let BookmarkHTMLUtils = Object.freeze({ importFromURL: function importFromFile(aUrlString, aInitialImport, aCallback) { diff --git a/toolkit/components/places/ColorAnalyzer.js b/toolkit/components/places/ColorAnalyzer.js index 86d8f36d1d7..7a85007dc8a 100644 --- a/toolkit/components/places/ColorAnalyzer.js +++ b/toolkit/components/places/ColorAnalyzer.js @@ -87,4 +87,4 @@ ColorAnalyzer.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.mozIColorAnalyzer]) }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ColorAnalyzer]); +let NSGetFactory = XPCOMUtils.generateNSGetFactory([ColorAnalyzer]); diff --git a/toolkit/components/places/PlacesCategoriesStarter.js b/toolkit/components/places/PlacesCategoriesStarter.js index fb50ceeed1c..92e29397c6a 100644 --- a/toolkit/components/places/PlacesCategoriesStarter.js +++ b/toolkit/components/places/PlacesCategoriesStarter.js @@ -109,4 +109,4 @@ PlacesCategoriesStarter.prototype = { //// Module Registration let components = [PlacesCategoriesStarter]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/toolkit/components/places/PlacesDBUtils.jsm b/toolkit/components/places/PlacesDBUtils.jsm index ee8de0d1ea1..7924703fed0 100644 --- a/toolkit/components/places/PlacesDBUtils.jsm +++ b/toolkit/components/places/PlacesDBUtils.jsm @@ -13,7 +13,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/PlacesUtils.jsm"); -this.EXPORTED_SYMBOLS = [ "PlacesDBUtils" ]; +let EXPORTED_SYMBOLS = [ "PlacesDBUtils" ]; //////////////////////////////////////////////////////////////////////////////// //// Constants @@ -32,7 +32,7 @@ XPCOMUtils.defineLazyGetter(this, "DBConn", function() { //////////////////////////////////////////////////////////////////////////////// //// PlacesDBUtils -this.PlacesDBUtils = { +let PlacesDBUtils = { /** * Executes a list of maintenance tasks. * Once finished it will pass a array log to the callback attached to tasks. diff --git a/toolkit/components/places/PlacesUtils.jsm b/toolkit/components/places/PlacesUtils.jsm index f843ae1c315..20d509259d5 100644 --- a/toolkit/components/places/PlacesUtils.jsm +++ b/toolkit/components/places/PlacesUtils.jsm @@ -3,7 +3,7 @@ * 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 = [ +const EXPORTED_SYMBOLS = [ "PlacesUtils" , "PlacesAggregatedTransaction" , "PlacesCreateFolderTransaction" @@ -77,7 +77,7 @@ function asFullVisit(aNode) QI_node(aNode, Ci.nsINavHistoryFullVisitResultNode); function asContainer(aNode) QI_node(aNode, Ci.nsINavHistoryContainerResultNode); function asQuery(aNode) QI_node(aNode, Ci.nsINavHistoryQueryResultNode); -this.PlacesUtils = { +var PlacesUtils = { // Place entries that are containers, e.g. bookmark folders or queries. TYPE_X_MOZ_PLACE_CONTAINER: "text/x-moz-place-container", // Place entries that are bookmark separators. @@ -2349,8 +2349,7 @@ BaseTransaction.prototype = { * * @return nsITransaction object */ -this.PlacesAggregatedTransaction = - function PlacesAggregatedTransaction(aName, aTransactions) +function PlacesAggregatedTransaction(aName, aTransactions) { // Copy the transactions array to decouple it from its prototype, which // otherwise keeps alive its associated global object. @@ -2433,9 +2432,8 @@ PlacesAggregatedTransaction.prototype = { * * @return nsITransaction object */ -this.PlacesCreateFolderTransaction = - function PlacesCreateFolderTransaction(aTitle, aParentId, aIndex, aAnnotations, - aChildTransactions) +function PlacesCreateFolderTransaction(aTitle, aParentId, aIndex, aAnnotations, + aChildTransactions) { this.item = new TransactionItemCache(); this.item.title = aTitle; @@ -2507,10 +2505,9 @@ PlacesCreateFolderTransaction.prototype = { * * @return nsITransaction object */ -this.PlacesCreateBookmarkTransaction = - function PlacesCreateBookmarkTransaction(aURI, aParentId, aIndex, aTitle, - aKeyword, aAnnotations, - aChildTransactions) +function PlacesCreateBookmarkTransaction(aURI, aParentId, aIndex, aTitle, + aKeyword, aAnnotations, + aChildTransactions) { this.item = new TransactionItemCache(); this.item.uri = aURI; @@ -2574,8 +2571,7 @@ PlacesCreateBookmarkTransaction.prototype = { * * @return nsITransaction object */ -this.PlacesCreateSeparatorTransaction = - function PlacesCreateSeparatorTransaction(aParentId, aIndex) +function PlacesCreateSeparatorTransaction(aParentId, aIndex) { this.item = new TransactionItemCache(); this.item.parentId = aParentId; @@ -2618,9 +2614,8 @@ PlacesCreateSeparatorTransaction.prototype = { * * @return nsITransaction object */ -this.PlacesCreateLivemarkTransaction = - function PlacesCreateLivemarkTransaction(aFeedURI, aSiteURI, aTitle, aParentId, - aIndex, aAnnotations) +function PlacesCreateLivemarkTransaction(aFeedURI, aSiteURI, aTitle, aParentId, + aIndex, aAnnotations) { this.item = new TransactionItemCache(); this.item.feedURI = aFeedURI; @@ -2757,8 +2752,7 @@ PlacesRemoveLivemarkTransaction.prototype = { * * @return nsITransaction object */ -this.PlacesMoveItemTransaction = - function PlacesMoveItemTransaction(aItemId, aNewParentId, aNewIndex) +function PlacesMoveItemTransaction(aItemId, aNewParentId, aNewIndex) { this.item = new TransactionItemCache(); this.item.id = aItemId; @@ -2804,8 +2798,7 @@ PlacesMoveItemTransaction.prototype = { * * @return nsITransaction object */ -this.PlacesRemoveItemTransaction = - function PlacesRemoveItemTransaction(aItemId) +function PlacesRemoveItemTransaction(aItemId) { if (PlacesUtils.isRootItem(aItemId)) throw Cr.NS_ERROR_INVALID_ARG; @@ -2938,8 +2931,7 @@ PlacesRemoveItemTransaction.prototype = { * * @return nsITransaction object */ -this.PlacesEditItemTitleTransaction = - function PlacesEditItemTitleTransaction(aItemId, aNewTitle) +function PlacesEditItemTitleTransaction(aItemId, aNewTitle) { this.item = new TransactionItemCache(); this.item.id = aItemId; @@ -2973,8 +2965,7 @@ PlacesEditItemTitleTransaction.prototype = { * * @return nsITransaction object */ -this.PlacesEditBookmarkURITransaction = - function PlacesEditBookmarkURITransaction(aItemId, aNewURI) { +function PlacesEditBookmarkURITransaction(aItemId, aNewURI) { this.item = new TransactionItemCache(); this.item.id = aItemId; this.new = new TransactionItemCache(); @@ -3025,8 +3016,7 @@ PlacesEditBookmarkURITransaction.prototype = { * * @return nsITransaction object */ -this.PlacesSetItemAnnotationTransaction = - function PlacesSetItemAnnotationTransaction(aItemId, aAnnotationObject) +function PlacesSetItemAnnotationTransaction(aItemId, aAnnotationObject) { this.item = new TransactionItemCache(); this.item.id = aItemId; @@ -3085,8 +3075,7 @@ PlacesSetItemAnnotationTransaction.prototype = { * * @return nsITransaction object */ -this.PlacesSetPageAnnotationTransaction = - function PlacesSetPageAnnotationTransaction(aURI, aAnnotationObject) +function PlacesSetPageAnnotationTransaction(aURI, aAnnotationObject) { this.item = new TransactionItemCache(); this.item.uri = aURI; @@ -3142,8 +3131,7 @@ PlacesSetPageAnnotationTransaction.prototype = { * * @return nsITransaction object */ -this.PlacesEditBookmarkKeywordTransaction = - function PlacesEditBookmarkKeywordTransaction(aItemId, aNewKeyword) +function PlacesEditBookmarkKeywordTransaction(aItemId, aNewKeyword) { this.item = new TransactionItemCache(); this.item.id = aItemId; @@ -3177,8 +3165,7 @@ PlacesEditBookmarkKeywordTransaction.prototype = { * * @return nsITransaction object */ -this.PlacesEditBookmarkPostDataTransaction = - function PlacesEditBookmarkPostDataTransaction(aItemId, aPostData) +function PlacesEditBookmarkPostDataTransaction(aItemId, aPostData) { this.item = new TransactionItemCache(); this.item.id = aItemId; @@ -3212,8 +3199,7 @@ PlacesEditBookmarkPostDataTransaction.prototype = { * * @return nsITransaction object */ -this.PlacesEditItemDateAddedTransaction = - function PlacesEditItemDateAddedTransaction(aItemId, aNewDateAdded) +function PlacesEditItemDateAddedTransaction(aItemId, aNewDateAdded) { this.item = new TransactionItemCache(); this.item.id = aItemId; @@ -3251,8 +3237,7 @@ PlacesEditItemDateAddedTransaction.prototype = { * * @return nsITransaction object */ -this.PlacesEditItemLastModifiedTransaction = - function PlacesEditItemLastModifiedTransaction(aItemId, aNewLastModified) +function PlacesEditItemLastModifiedTransaction(aItemId, aNewLastModified) { this.item = new TransactionItemCache(); this.item.id = aItemId; @@ -3292,8 +3277,7 @@ PlacesEditItemLastModifiedTransaction.prototype = { * * @return nsITransaction object */ -this.PlacesSortFolderByNameTransaction = - function PlacesSortFolderByNameTransaction(aFolderId) +function PlacesSortFolderByNameTransaction(aFolderId) { this.item = new TransactionItemCache(); this.item.id = aFolderId; @@ -3379,8 +3363,7 @@ PlacesSortFolderByNameTransaction.prototype = { * @param aTags * Array of tags to set for the given URL. */ -this.PlacesTagURITransaction = - function PlacesTagURITransaction(aURI, aTags) +function PlacesTagURITransaction(aURI, aTags) { this.item = new TransactionItemCache(); this.item.uri = aURI; @@ -3427,8 +3410,7 @@ PlacesTagURITransaction.prototype = { * Array of tags to unset. pass null to remove all tags from the given * url. */ -this.PlacesUntagURITransaction = - function PlacesUntagURITransaction(aURI, aTags) +function PlacesUntagURITransaction(aURI, aTags) { this.item = new TransactionItemCache(); this.item.uri = aURI; diff --git a/toolkit/components/places/nsLivemarkService.js b/toolkit/components/places/nsLivemarkService.js index fe5269fb722..fc5d18cf2ca 100644 --- a/toolkit/components/places/nsLivemarkService.js +++ b/toolkit/components/places/nsLivemarkService.js @@ -1244,4 +1244,4 @@ LivemarkLoadListener.prototype = { ]) } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([LivemarkService]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([LivemarkService]); diff --git a/toolkit/components/places/nsPlacesAutoComplete.js b/toolkit/components/places/nsPlacesAutoComplete.js index c817e046985..e051120f0bc 100644 --- a/toolkit/components/places/nsPlacesAutoComplete.js +++ b/toolkit/components/places/nsPlacesAutoComplete.js @@ -1651,4 +1651,4 @@ urlInlineComplete.prototype = { }; let components = [nsPlacesAutoComplete, urlInlineComplete]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/toolkit/components/places/nsPlacesExpiration.js b/toolkit/components/places/nsPlacesExpiration.js index 46d4c4195e7..48fa1c34319 100644 --- a/toolkit/components/places/nsPlacesExpiration.js +++ b/toolkit/components/places/nsPlacesExpiration.js @@ -994,4 +994,4 @@ nsPlacesExpiration.prototype = { //// Module Registration let components = [nsPlacesExpiration]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/toolkit/components/places/nsTaggingService.js b/toolkit/components/places/nsTaggingService.js index 9a84df4dabc..f60bacd6cca 100644 --- a/toolkit/components/places/nsTaggingService.js +++ b/toolkit/components/places/nsTaggingService.js @@ -678,4 +678,4 @@ TagAutoCompleteSearch.prototype = { }; let component = [TaggingService, TagAutoCompleteSearch]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/toolkit/components/places/tests/unit/nsDummyObserver.js b/toolkit/components/places/tests/unit/nsDummyObserver.js index 6f45a8d6aaa..afc4421ef9b 100644 --- a/toolkit/components/places/tests/unit/nsDummyObserver.js +++ b/toolkit/components/places/tests/unit/nsDummyObserver.js @@ -52,4 +52,4 @@ DummyObserver.prototype = { ]) }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DummyObserver]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([DummyObserver]); diff --git a/toolkit/components/prompts/src/CommonDialog.jsm b/toolkit/components/prompts/src/CommonDialog.jsm index bc61902b314..1a037fc9b45 100644 --- a/toolkit/components/prompts/src/CommonDialog.jsm +++ b/toolkit/components/prompts/src/CommonDialog.jsm @@ -2,7 +2,7 @@ * 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 = ["CommonDialog"]; +var EXPORTED_SYMBOLS = ["CommonDialog"]; const Ci = Components.interfaces; const Cr = Components.results; @@ -12,7 +12,7 @@ const Cu = Components.utils; Cu.import("resource://gre/modules/Services.jsm"); -this.CommonDialog = function CommonDialog(args, ui) { +function CommonDialog(args, ui) { this.args = args; this.ui = ui; } diff --git a/toolkit/components/prompts/src/nsPrompter.js b/toolkit/components/prompts/src/nsPrompter.js index 871292212b4..d4ba688fec8 100644 --- a/toolkit/components/prompts/src/nsPrompter.js +++ b/toolkit/components/prompts/src/nsPrompter.js @@ -855,4 +855,4 @@ EmbedPrompter.prototype = new Prompter(); EmbedPrompter.prototype.classID = Components.ID("{7ad1b327-6dfa-46ec-9234-f2a620ea7e00}"); var component = [Prompter, EmbedPrompter, AuthPromptAdapterFactory]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/toolkit/components/reflect/reflect.jsm b/toolkit/components/reflect/reflect.jsm index abdfdcabbf8..dfb0c7a93b9 100644 --- a/toolkit/components/reflect/reflect.jsm +++ b/toolkit/components/reflect/reflect.jsm @@ -3,7 +3,7 @@ * 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 = [ "Reflect" ]; +let EXPORTED_SYMBOLS = [ "Reflect" ]; /* * This is the js module for Reflect. Import it like so: diff --git a/toolkit/components/satchel/nsFormAutoComplete.js b/toolkit/components/satchel/nsFormAutoComplete.js index 961cc93f1ba..d4999fc5346 100644 --- a/toolkit/components/satchel/nsFormAutoComplete.js +++ b/toolkit/components/satchel/nsFormAutoComplete.js @@ -427,4 +427,4 @@ FormAutoCompleteResult.prototype = { }; let component = [FormAutoComplete]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/toolkit/components/satchel/nsFormAutoCompleteResult.jsm b/toolkit/components/satchel/nsFormAutoCompleteResult.jsm index fd71d941caf..3c4d10badb4 100644 --- a/toolkit/components/satchel/nsFormAutoCompleteResult.jsm +++ b/toolkit/components/satchel/nsFormAutoCompleteResult.jsm @@ -2,22 +2,21 @@ * 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 = [ "FormAutoCompleteResult" ]; +let EXPORTED_SYMBOLS = [ "FormAutoCompleteResult" ]; const Ci = Components.interfaces; const Cr = Components.results; Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); -this.FormAutoCompleteResult = - function FormAutoCompleteResult(searchString, - searchResult, - defaultIndex, - errorDescription, - values, - labels, - comments, - prevResult) { +function FormAutoCompleteResult(searchString, + searchResult, + defaultIndex, + errorDescription, + values, + labels, + comments, + prevResult) { this._searchString = searchString; this._searchResult = searchResult; this._defaultIndex = defaultIndex; diff --git a/toolkit/components/satchel/nsFormHistory.js b/toolkit/components/satchel/nsFormHistory.js index 494a2a336ad..b97d9d05cab 100644 --- a/toolkit/components/satchel/nsFormHistory.js +++ b/toolkit/components/satchel/nsFormHistory.js @@ -961,4 +961,4 @@ FormHistory.prototype = { }; let component = [FormHistory]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/toolkit/components/satchel/nsInputListAutoComplete.js b/toolkit/components/satchel/nsInputListAutoComplete.js index 357ba93bb0f..9dd159f885b 100644 --- a/toolkit/components/satchel/nsInputListAutoComplete.js +++ b/toolkit/components/satchel/nsInputListAutoComplete.js @@ -87,4 +87,4 @@ InputListAutoComplete.prototype = { }; let component = [InputListAutoComplete]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/toolkit/components/search/nsSearchService.js b/toolkit/components/search/nsSearchService.js index 2e9f32ab443..0ca4a23b749 100644 --- a/toolkit/components/search/nsSearchService.js +++ b/toolkit/components/search/nsSearchService.js @@ -3848,6 +3848,6 @@ var engineUpdateService = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SearchService]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([SearchService]); #include ../../../toolkit/content/debug.js diff --git a/toolkit/components/search/nsSearchSuggestions.js b/toolkit/components/search/nsSearchSuggestions.js index 6d756c1069d..ba7449b38fb 100644 --- a/toolkit/components/search/nsSearchSuggestions.js +++ b/toolkit/components/search/nsSearchSuggestions.js @@ -565,4 +565,4 @@ SearchSuggestAutoComplete.prototype = { }; var component = [SearchSuggestAutoComplete]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/toolkit/components/social/FrameWorker.jsm b/toolkit/components/social/FrameWorker.jsm index 546511d8aab..f480733712c 100644 --- a/toolkit/components/social/FrameWorker.jsm +++ b/toolkit/components/social/FrameWorker.jsm @@ -17,15 +17,14 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components; Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/MessagePortBase.jsm"); -this.EXPORTED_SYMBOLS = ["getFrameWorkerHandle"]; +const EXPORTED_SYMBOLS = ["getFrameWorkerHandle"]; var workerCache = {}; // keyed by URL. var _nextPortId = 1; // Retrieves a reference to a WorkerHandle associated with a FrameWorker and a // new ClientPort. -this.getFrameWorkerHandle = - function getFrameWorkerHandle(url, clientWindow, name) { +function getFrameWorkerHandle(url, clientWindow, name) { // first create the client port we are going to use. Later we will // message the worker to create the worker port. let portid = _nextPortId++; diff --git a/toolkit/components/social/MessagePortBase.jsm b/toolkit/components/social/MessagePortBase.jsm index 0d317b7efb6..7a24c4e67f9 100644 --- a/toolkit/components/social/MessagePortBase.jsm +++ b/toolkit/components/social/MessagePortBase.jsm @@ -3,14 +3,14 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ // Code that is shared between clients and workers. -this.EXPORTED_SYMBOLS = ["AbstractPort"]; +const EXPORTED_SYMBOLS = ["AbstractPort"]; -this.AbstractPort = function AbstractPort(portid) { +function AbstractPort(portid) { this._portid = portid; this._handler = undefined; // pending messages sent to this port before it has a message handler. this._pendingMessagesIncoming = []; -}; +} AbstractPort.prototype = { _portType: null, // set by a subclass. @@ -103,4 +103,4 @@ AbstractPort.prototype = { this._pendingMessagesIncoming = []; this._portid = null; } -}; +} diff --git a/toolkit/components/social/MozSocialAPI.jsm b/toolkit/components/social/MozSocialAPI.jsm index 1deb2be7708..bd6f574dd8a 100644 --- a/toolkit/components/social/MozSocialAPI.jsm +++ b/toolkit/components/social/MozSocialAPI.jsm @@ -9,9 +9,9 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "SocialService", "resource://gre/modules/SocialService.jsm"); -this.EXPORTED_SYMBOLS = ["MozSocialAPI", "openChatWindow"]; +const EXPORTED_SYMBOLS = ["MozSocialAPI", "openChatWindow"]; -this.MozSocialAPI = { +var MozSocialAPI = { _enabled: false, _everEnabled: false, set enabled(val) { @@ -249,8 +249,7 @@ function ensureProviderOrigin(provider, url) { return fullURL; } -this.openChatWindow = - function openChatWindow(chromeWindow, provider, url, callback, mode) { +function openChatWindow(chromeWindow, provider, url, callback, mode) { if (!chromeWindow.SocialChatBar) return; let fullURL = ensureProviderOrigin(provider, url); diff --git a/toolkit/components/social/SocialService.jsm b/toolkit/components/social/SocialService.jsm index 308bdf48616..bb079805522 100644 --- a/toolkit/components/social/SocialService.jsm +++ b/toolkit/components/social/SocialService.jsm @@ -2,7 +2,7 @@ * 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 = ["SocialService"]; +const EXPORTED_SYMBOLS = ["SocialService"]; const { classes: Cc, interfaces: Ci, utils: Cu } = Components; @@ -82,7 +82,7 @@ function schedule(callback) { } // Public API -this.SocialService = { +const SocialService = { get enabled() { return SocialServiceInternal.enabled; }, diff --git a/toolkit/components/social/WorkerAPI.jsm b/toolkit/components/social/WorkerAPI.jsm index f35393e0028..5d443e6260a 100644 --- a/toolkit/components/social/WorkerAPI.jsm +++ b/toolkit/components/social/WorkerAPI.jsm @@ -13,9 +13,9 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "getFrameWorkerHandle", "resource://gre/modules/FrameWorker.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "openChatWindow", "resource://gre/modules/MozSocialAPI.jsm"); -this.EXPORTED_SYMBOLS = ["WorkerAPI"]; +const EXPORTED_SYMBOLS = ["WorkerAPI"]; -this.WorkerAPI = function WorkerAPI(provider, port) { +function WorkerAPI(provider, port) { if (!port) throw new Error("Can't initialize WorkerAPI with a null port"); diff --git a/toolkit/components/telemetry/TelemetryPing.js b/toolkit/components/telemetry/TelemetryPing.js index 66a0fb1f835..79e2a90a6a9 100644 --- a/toolkit/components/telemetry/TelemetryPing.js +++ b/toolkit/components/telemetry/TelemetryPing.js @@ -1036,4 +1036,4 @@ TelemetryPing.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]), }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TelemetryPing]); +let NSGetFactory = XPCOMUtils.generateNSGetFactory([TelemetryPing]); diff --git a/toolkit/components/telemetry/TelemetryStopwatch.jsm b/toolkit/components/telemetry/TelemetryStopwatch.jsm index a1d7cafbcea..9c88e3c32fb 100644 --- a/toolkit/components/telemetry/TelemetryStopwatch.jsm +++ b/toolkit/components/telemetry/TelemetryStopwatch.jsm @@ -6,7 +6,7 @@ const Cc = Components.classes; const Ci = Components.interfaces; const Cu = Components.utils; -this.EXPORTED_SYMBOLS = ["TelemetryStopwatch"]; +let EXPORTED_SYMBOLS = ["TelemetryStopwatch"]; let Telemetry = Cc["@mozilla.org/base/telemetry;1"] .getService(Ci.nsITelemetry); @@ -17,7 +17,7 @@ let Telemetry = Cc["@mozilla.org/base/telemetry;1"] let simpleTimers = {}; let objectTimers = new WeakMap(); -this.TelemetryStopwatch = { +let TelemetryStopwatch = { /** * Starts a timer associated with a telemetry histogram. The timer can be * directly associated with a histogram, or with a pair of a histogram and diff --git a/toolkit/components/url-classifier/SafeBrowsing.jsm b/toolkit/components/url-classifier/SafeBrowsing.jsm index 675eb7b81f6..313ac4827e3 100644 --- a/toolkit/components/url-classifier/SafeBrowsing.jsm +++ b/toolkit/components/url-classifier/SafeBrowsing.jsm @@ -2,7 +2,7 @@ * 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 = ["SafeBrowsing"]; +var EXPORTED_SYMBOLS = ["SafeBrowsing"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -23,7 +23,7 @@ function log(...stuff) { dump(msg + "\n"); } -this.SafeBrowsing = { +var SafeBrowsing = { init: function() { if (this.initialized) { diff --git a/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js b/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js index d9ad1d0a7d6..75c0ddbcf3d 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js +++ b/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js @@ -574,4 +574,4 @@ function errorWithStack() { return err; } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([HashCompleter]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([HashCompleter]); diff --git a/toolkit/components/url-classifier/nsUrlClassifierLib.js b/toolkit/components/url-classifier/nsUrlClassifierLib.js index 8c782d56f32..70b3af2d14f 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierLib.js +++ b/toolkit/components/url-classifier/nsUrlClassifierLib.js @@ -33,4 +33,4 @@ function UrlClassifierLib() { UrlClassifierLib.prototype.classID = Components.ID("{26a4a019-2827-4a89-a85c-5931a678823a}"); UrlClassifierLib.prototype.QueryInterface = XPCOMUtils.generateQI([]); -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([UrlClassifierLib]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([UrlClassifierLib]); diff --git a/toolkit/components/url-classifier/nsUrlClassifierListManager.js b/toolkit/components/url-classifier/nsUrlClassifierListManager.js index 070a2d27438..26caff286b2 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierListManager.js +++ b/toolkit/components/url-classifier/nsUrlClassifierListManager.js @@ -46,4 +46,4 @@ RegistrationData.prototype = { }, }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RegistrationData]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([RegistrationData]); diff --git a/toolkit/components/urlformatter/nsURLFormatter.js b/toolkit/components/urlformatter/nsURLFormatter.js index 738c12560d5..82b610ebd3a 100644 --- a/toolkit/components/urlformatter/nsURLFormatter.js +++ b/toolkit/components/urlformatter/nsURLFormatter.js @@ -139,4 +139,4 @@ nsURLFormatterService.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsURLFormatterService]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsURLFormatterService]); diff --git a/toolkit/content/DeferredTask.jsm b/toolkit/content/DeferredTask.jsm index 03b53d536bd..99ea301194a 100644 --- a/toolkit/content/DeferredTask.jsm +++ b/toolkit/content/DeferredTask.jsm @@ -2,7 +2,7 @@ * 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 = ["DeferredTask"]; +const EXPORTED_SYMBOLS = ["DeferredTask"]; const Cu = Components.utils; const Cc = Components.classes; @@ -23,7 +23,7 @@ const Ci = Components.interfaces; * @param aDelay The delay time in milliseconds. * @param aCallback The code to execute after the delay. */ -this.DeferredTask = function DeferredTask(aCallback, aDelay) { +function DeferredTask(aCallback, aDelay) { this._callback = function onCallback() { this._timer = null; try { diff --git a/toolkit/content/Dict.jsm b/toolkit/content/Dict.jsm index 2d276113adf..34bcb66a8f0 100644 --- a/toolkit/content/Dict.jsm +++ b/toolkit/content/Dict.jsm @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["Dict"]; +var EXPORTED_SYMBOLS = ["Dict"]; /** * Transforms a given key into a property name guaranteed not to collide with @@ -31,7 +31,7 @@ function unconvert(aProp) { * object are considered. * If |aInitial| is a string, it is assumed to be JSON and parsed into an object. */ -this.Dict = function Dict(aInitial) { +function Dict(aInitial) { if (aInitial === undefined) aInitial = {}; if (typeof aInitial == "string") diff --git a/toolkit/content/Geometry.jsm b/toolkit/content/Geometry.jsm index 47072b7445e..dad754edb2a 100644 --- a/toolkit/content/Geometry.jsm +++ b/toolkit/content/Geometry.jsm @@ -2,14 +2,14 @@ * 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 = ["Point", "Rect"]; +let EXPORTED_SYMBOLS = ["Point", "Rect"]; /** * Simple Point class. * * Any method that takes an x and y may also take a point. */ -this.Point = function Point(x, y) { +function Point(x, y) { this.set(x, y); } @@ -84,7 +84,7 @@ Point.prototype = { * non-positive widths and heights in that case. */ -this.Rect = function Rect(x, y, w, h) { +function Rect(x, y, w, h) { this.left = x; this.top = y; this.right = x + w; diff --git a/toolkit/content/InlineSpellChecker.jsm b/toolkit/content/InlineSpellChecker.jsm index bbbdaa63def..9601c69fcfb 100644 --- a/toolkit/content/InlineSpellChecker.jsm +++ b/toolkit/content/InlineSpellChecker.jsm @@ -2,12 +2,12 @@ * 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 = [ "InlineSpellChecker" ]; +var EXPORTED_SYMBOLS = [ "InlineSpellChecker" ]; var gLanguageBundle; var gRegionBundle; const MAX_UNDO_STACK_DEPTH = 1; -this.InlineSpellChecker = function InlineSpellChecker(aEditor) { +function InlineSpellChecker(aEditor) { this.init(aEditor); this.mAddedWordStack = []; // We init this here to preserve it between init/uninit calls } diff --git a/toolkit/content/LightweightThemeConsumer.jsm b/toolkit/content/LightweightThemeConsumer.jsm index 91b5d87e65a..d0a4aec8a45 100644 --- a/toolkit/content/LightweightThemeConsumer.jsm +++ b/toolkit/content/LightweightThemeConsumer.jsm @@ -2,15 +2,14 @@ * 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 = ["LightweightThemeConsumer"]; +let EXPORTED_SYMBOLS = ["LightweightThemeConsumer"]; Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeImageOptimizer", "resource://gre/modules/LightweightThemeImageOptimizer.jsm"); -this.LightweightThemeConsumer = - function LightweightThemeConsumer(aDocument) { +function LightweightThemeConsumer(aDocument) { this._doc = aDocument; this._win = aDocument.defaultView; this._footerId = aDocument.documentElement.getAttribute("lightweightthemesfooter"); diff --git a/toolkit/content/PageMenu.jsm b/toolkit/content/PageMenu.jsm index 865c4591474..febe94a981b 100644 --- a/toolkit/content/PageMenu.jsm +++ b/toolkit/content/PageMenu.jsm @@ -2,9 +2,9 @@ * 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 = ["PageMenu"]; +let EXPORTED_SYMBOLS = ["PageMenu"]; -this.PageMenu = function PageMenu() { +function PageMenu() { } PageMenu.prototype = { diff --git a/toolkit/content/PopupNotifications.jsm b/toolkit/content/PopupNotifications.jsm index 68ed9861c11..258b95d6c4d 100644 --- a/toolkit/content/PopupNotifications.jsm +++ b/toolkit/content/PopupNotifications.jsm @@ -2,7 +2,7 @@ * 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 = ["PopupNotifications"]; +var EXPORTED_SYMBOLS = ["PopupNotifications"]; var Cc = Components.classes, Ci = Components.interfaces; @@ -87,7 +87,7 @@ Notification.prototype = { * It is used as a fallback popup anchor if notifications specify * invalid or non-existent anchor IDs. */ -this.PopupNotifications = function PopupNotifications(tabbrowser, panel, iconBox) { +function PopupNotifications(tabbrowser, panel, iconBox) { if (!(tabbrowser instanceof Ci.nsIDOMXULElement)) throw "Invalid tabbrowser"; if (iconBox && !(iconBox instanceof Ci.nsIDOMXULElement)) diff --git a/toolkit/content/PrivateBrowsingUtils.jsm b/toolkit/content/PrivateBrowsingUtils.jsm index b5cbaf63316..f91d10e8f82 100644 --- a/toolkit/content/PrivateBrowsingUtils.jsm +++ b/toolkit/content/PrivateBrowsingUtils.jsm @@ -2,7 +2,7 @@ * 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 = ["PrivateBrowsingUtils"]; +var EXPORTED_SYMBOLS = ["PrivateBrowsingUtils"]; Components.utils.import("resource://gre/modules/Services.jsm"); @@ -11,7 +11,7 @@ const kAutoStartPref = "browser.components.autostart"; const Cc = Components.classes; const Ci = Components.interfaces; -this.PrivateBrowsingUtils = { +var PrivateBrowsingUtils = { isWindowPrivate: function pbu_isWindowPrivate(aWindow) { return this.privacyContextFromWindow(aWindow).usePrivateBrowsing; }, diff --git a/toolkit/content/PropertyListUtils.jsm b/toolkit/content/PropertyListUtils.jsm index 7a41e45ba5b..8925feea27d 100644 --- a/toolkit/content/PropertyListUtils.jsm +++ b/toolkit/content/PropertyListUtils.jsm @@ -55,7 +55,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["PropertyListUtils"]; +let EXPORTED_SYMBOLS = ["PropertyListUtils"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -70,7 +70,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "ctypes", XPCOMUtils.defineLazyModuleGetter(this, "Services", "resource://gre/modules/Services.jsm"); -this.PropertyListUtils = Object.freeze({ +let PropertyListUtils = Object.freeze({ /** * Asynchronously reads a file as a property list. * diff --git a/toolkit/content/Services.jsm b/toolkit/content/Services.jsm index 6e97215e361..0813bf3e74e 100644 --- a/toolkit/content/Services.jsm +++ b/toolkit/content/Services.jsm @@ -2,14 +2,14 @@ * 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 = ["Services"]; +let EXPORTED_SYMBOLS = ["Services"]; const Ci = Components.interfaces; const Cc = Components.classes; Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); -this.Services = {}; +let Services = {}; XPCOMUtils.defineLazyGetter(Services, "prefs", function () { return Cc["@mozilla.org/preferences-service;1"] diff --git a/toolkit/content/Task.jsm b/toolkit/content/Task.jsm index 3d7a7290f79..d79db8617e1 100644 --- a/toolkit/content/Task.jsm +++ b/toolkit/content/Task.jsm @@ -6,7 +6,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = [ +let EXPORTED_SYMBOLS = [ "Task" ]; @@ -103,7 +103,7 @@ Cu.import("resource://gre/modules/commonjs/promise/core.js"); /** * This object provides the public module functions. */ -this.Task = { +const Task = { /** * Creates and starts a new task. * diff --git a/toolkit/content/Troubleshoot.jsm b/toolkit/content/Troubleshoot.jsm index d10b7dc29c6..83e5a5d6768 100644 --- a/toolkit/content/Troubleshoot.jsm +++ b/toolkit/content/Troubleshoot.jsm @@ -2,7 +2,7 @@ * 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 = [ +let EXPORTED_SYMBOLS = [ "Troubleshoot", ]; @@ -73,7 +73,7 @@ const PREFS_BLACKLIST = [ /[.]print_to_filename$/, ]; -this.Troubleshoot = { +let Troubleshoot = { /** * Captures a snapshot of data that may help troubleshooters troubleshoot diff --git a/toolkit/content/UpdateChannel.jsm b/toolkit/content/UpdateChannel.jsm index e220a60aabd..46237e95b98 100644 --- a/toolkit/content/UpdateChannel.jsm +++ b/toolkit/content/UpdateChannel.jsm @@ -2,13 +2,13 @@ * 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 = ["UpdateChannel"]; +const EXPORTED_SYMBOLS = ["UpdateChannel"]; const Cu = Components.utils; Cu.import("resource://gre/modules/Services.jsm"); -this.UpdateChannel = { +let UpdateChannel = { /** * Read the update channel from defaults only. We do this to ensure that * the channel is tightly coupled with the application and does not apply diff --git a/toolkit/content/WindowDraggingUtils.jsm b/toolkit/content/WindowDraggingUtils.jsm index 458843c13c7..fb2640ddc64 100644 --- a/toolkit/content/WindowDraggingUtils.jsm +++ b/toolkit/content/WindowDraggingUtils.jsm @@ -8,9 +8,9 @@ #define USE_HITTEST #endif -this.EXPORTED_SYMBOLS = [ "WindowDraggingElement" ]; +let EXPORTED_SYMBOLS = [ "WindowDraggingElement" ]; -this.WindowDraggingElement = function WindowDraggingElement(elem) { +function WindowDraggingElement(elem) { this._elem = elem; this._window = elem.ownerDocument.defaultView; #ifdef USE_HITTEST @@ -19,7 +19,7 @@ this.WindowDraggingElement = function WindowDraggingElement(elem) { else #endif this._elem.addEventListener("mousedown", this, false); -}; +} WindowDraggingElement.prototype = { mouseDownCheck: function(e) { return true; }, diff --git a/toolkit/content/debug.js b/toolkit/content/debug.js index 822ae9068e5..ba647dedd14 100644 --- a/toolkit/content/debug.js +++ b/toolkit/content/debug.js @@ -8,7 +8,7 @@ // This file contains functions that are useful for debugging purposes from // within JavaScript code. -this.EXPORTED_SYMBOLS = ["NS_ASSERT"]; +var EXPORTED_SYMBOLS = ["NS_ASSERT"]; var gTraceOnAssert = true; @@ -29,7 +29,7 @@ var gTraceOnAssert = true; * @param message a string to be displayed upon failure of the assertion */ -this.NS_ASSERT = function NS_ASSERT(condition, message) { +function NS_ASSERT(condition, message) { if (condition) return; diff --git a/toolkit/crashreporter/CrashSubmit.jsm b/toolkit/crashreporter/CrashSubmit.jsm index dfa43ab9c62..7d05dd31af3 100644 --- a/toolkit/crashreporter/CrashSubmit.jsm +++ b/toolkit/crashreporter/CrashSubmit.jsm @@ -5,7 +5,7 @@ Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/KeyValueParser.jsm"); -this.EXPORTED_SYMBOLS = [ +let EXPORTED_SYMBOLS = [ "CrashSubmit" ]; @@ -301,7 +301,7 @@ Submitter.prototype = { //=================================== // External API goes here -this.CrashSubmit = { +let CrashSubmit = { /** * Submit the crash report named id.dmp from the "pending" directory. * diff --git a/toolkit/crashreporter/KeyValueParser.jsm b/toolkit/crashreporter/KeyValueParser.jsm index d8b095761ad..a05bd87d4b7 100644 --- a/toolkit/crashreporter/KeyValueParser.jsm +++ b/toolkit/crashreporter/KeyValueParser.jsm @@ -4,7 +4,7 @@ Components.utils.import("resource://gre/modules/Services.jsm"); -this.EXPORTED_SYMBOLS = [ +let EXPORTED_SYMBOLS = [ "parseKeyValuePairs", "parseKeyValuePairsFromFile" ]; @@ -12,7 +12,7 @@ this.EXPORTED_SYMBOLS = [ const Cc = Components.classes; const Ci = Components.interfaces; -this.parseKeyValuePairs = function parseKeyValuePairs(text) { +function parseKeyValuePairs(text) { let lines = text.split('\n'); let data = {}; for (let i = 0; i < lines.length; i++) { @@ -31,7 +31,7 @@ this.parseKeyValuePairs = function parseKeyValuePairs(text) { return data; } -this.parseKeyValuePairsFromFile = function parseKeyValuePairsFromFile(file) { +function parseKeyValuePairsFromFile(file) { let fstream = Cc["@mozilla.org/network/file-input-stream;1"]. createInstance(Ci.nsIFileInputStream); fstream.init(file, -1, 0, 0); diff --git a/toolkit/crashreporter/test/CrashTestUtils.jsm b/toolkit/crashreporter/test/CrashTestUtils.jsm index 9ba544473f8..18f9d42d527 100644 --- a/toolkit/crashreporter/test/CrashTestUtils.jsm +++ b/toolkit/crashreporter/test/CrashTestUtils.jsm @@ -1,8 +1,6 @@ -// XXXkhuey this needs a license header. +var EXPORTED_SYMBOLS = ["CrashTestUtils"]; -this.EXPORTED_SYMBOLS = ["CrashTestUtils"]; - -this.CrashTestUtils = { +let CrashTestUtils = { // These will be defined using ctypes APIs below. crash: null, lockDir: null, diff --git a/toolkit/devtools/Console.jsm b/toolkit/devtools/Console.jsm index 40bb414e3f8..b222031f678 100644 --- a/toolkit/devtools/Console.jsm +++ b/toolkit/devtools/Console.jsm @@ -20,7 +20,7 @@ * implementation isn't always required (or even well defined) */ -this.EXPORTED_SYMBOLS = [ "console" ]; +const EXPORTED_SYMBOLS = [ "console" ]; Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); @@ -345,7 +345,7 @@ function createMultiLineDumper(aLevel) { * object. It currently writes to dump(), but should write to the web * console's chrome error section (when it has one) */ -this.console = { +const console = { debug: createMultiLineDumper("debug"), log: createDumper("log"), info: createDumper("info"), diff --git a/toolkit/devtools/Require.jsm b/toolkit/devtools/Require.jsm index dfd998b37f8..48ab4990568 100644 --- a/toolkit/devtools/Require.jsm +++ b/toolkit/devtools/Require.jsm @@ -15,7 +15,7 @@ * serves the projects it loads. */ -this.EXPORTED_SYMBOLS = [ "define", "require" ]; +const EXPORTED_SYMBOLS = [ "define", "require" ]; const console = (function() { const tempScope = {}; @@ -29,7 +29,7 @@ const console = (function() { * @param deps Ignored. For compatibility with CommonJS AMD Spec * @param payload Function with (require, exports, module) params */ -this.define = function define(moduleName, deps, payload) { +function define(moduleName, deps, payload) { if (typeof moduleName != "string") { throw new Error("Error: Module name is not a string"); } @@ -192,4 +192,4 @@ define.globalDomain = new Domain(); * Expose a default require function which is the require of the global * sandbox to make it easy to use. */ -this.require = define.globalDomain.require.bind(define.globalDomain); +const require = define.globalDomain.require.bind(define.globalDomain); diff --git a/toolkit/devtools/_Promise.jsm b/toolkit/devtools/_Promise.jsm index 0ea8c54d040..ac615558aea 100644 --- a/toolkit/devtools/_Promise.jsm +++ b/toolkit/devtools/_Promise.jsm @@ -5,7 +5,7 @@ */ -this.EXPORTED_SYMBOLS = [ "Promise" ]; +var EXPORTED_SYMBOLS = [ "Promise" ]; /** * Create an unfulfilled promise @@ -14,7 +14,7 @@ this.EXPORTED_SYMBOLS = [ "Promise" ]; * * @constructor */ -this.Promise = function Promise(aTrace) { +function Promise(aTrace) { this._status = Promise.PENDING; this._value = undefined; this._onSuccessHandlers = []; diff --git a/toolkit/devtools/debugger/dbg-client.jsm b/toolkit/devtools/debugger/dbg-client.jsm index e7ea804e2c9..eb38a8fc4df 100644 --- a/toolkit/devtools/debugger/dbg-client.jsm +++ b/toolkit/devtools/debugger/dbg-client.jsm @@ -10,9 +10,9 @@ const Cc = Components.classes; const Cu = Components.utils; const Cr = Components.results; -this.EXPORTED_SYMBOLS = ["DebuggerTransport", - "DebuggerClient", - "debuggerSocketConnect"]; +var EXPORTED_SYMBOLS = ["DebuggerTransport", + "DebuggerClient", + "debuggerSocketConnect"]; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/NetUtil.jsm"); @@ -197,7 +197,7 @@ const ROOT_ACTOR_NAME = "root"; * provides the means to communicate with the server and exchange the messages * required by the protocol in a traditional JavaScript API. */ -this.DebuggerClient = function DebuggerClient(aTransport) +function DebuggerClient(aTransport) { this._transport = aTransport; this._transport.hooks = this; @@ -1284,7 +1284,7 @@ eventSource(BreakpointClient.prototype); * @param aPort number * The port number of the debugger server. */ -this.debuggerSocketConnect = function debuggerSocketConnect(aHost, aPort) +function debuggerSocketConnect(aHost, aPort) { let s = socketTransportService.createTransport(null, 0, aHost, aPort, null); let transport = new DebuggerTransport(s.openInputStream(0, 0, 0), diff --git a/toolkit/devtools/debugger/dbg-transport.js b/toolkit/devtools/debugger/dbg-transport.js index d65ac84cdec..bdd85eda5c8 100644 --- a/toolkit/devtools/debugger/dbg-transport.js +++ b/toolkit/devtools/debugger/dbg-transport.js @@ -39,7 +39,7 @@ Cu.import("resource://gre/modules/NetUtil.jsm"); * ([length]:[packet]). The contents of the JSON packet are specified in * the Remote Debugging Protocol specification. */ -this.DebuggerTransport = function DebuggerTransport(aInput, aOutput) +function DebuggerTransport(aInput, aOutput) { this._input = aInput; this._output = aOutput; diff --git a/toolkit/devtools/debugger/server/dbg-server.jsm b/toolkit/devtools/debugger/server/dbg-server.jsm index ece7be88dc5..07a22589768 100644 --- a/toolkit/devtools/debugger/server/dbg-server.jsm +++ b/toolkit/devtools/debugger/server/dbg-server.jsm @@ -15,7 +15,7 @@ const Ci = Components.interfaces; const Cc = Components.classes; const Cu = Components.utils; -this.EXPORTED_SYMBOLS = ["DebuggerServer"]; +var EXPORTED_SYMBOLS = ["DebuggerServer"]; function loadSubScript(aURL) { @@ -40,4 +40,4 @@ var gGlobal = Cu.Sandbox(systemPrincipal); gGlobal.importFunction(loadSubScript); gGlobal.loadSubScript("chrome://global/content/devtools/dbg-server.js"); -this.DebuggerServer = gGlobal.DebuggerServer; +var DebuggerServer = gGlobal.DebuggerServer; diff --git a/toolkit/devtools/sourcemap/SourceMap.jsm b/toolkit/devtools/sourcemap/SourceMap.jsm index bde9257b74b..dd7c525b999 100644 --- a/toolkit/devtools/sourcemap/SourceMap.jsm +++ b/toolkit/devtools/sourcemap/SourceMap.jsm @@ -15,7 +15,7 @@ /////////////////////////////////////////////////////////////////////////////// -this.EXPORTED_SYMBOLS = [ "SourceMapConsumer", "SourceMapGenerator", "SourceNode" ]; +var EXPORTED_SYMBOLS = [ "SourceMapConsumer", "SourceMapGenerator", "SourceNode" ]; Components.utils.import('resource://gre/modules/devtools/Require.jsm'); /* -*- Mode: js; js-indent-level: 2; -*- */ diff --git a/toolkit/devtools/sourcemap/tests/unit/Utils.jsm b/toolkit/devtools/sourcemap/tests/unit/Utils.jsm index af7d1b1edf9..90d2d36b14a 100644 --- a/toolkit/devtools/sourcemap/tests/unit/Utils.jsm +++ b/toolkit/devtools/sourcemap/tests/unit/Utils.jsm @@ -15,7 +15,7 @@ Components.utils.import('resource://gre/modules/devtools/Require.jsm'); Components.utils.import('resource://gre/modules/devtools/SourceMap.jsm'); -this.EXPORTED_SYMBOLS = [ "define", "runSourceMapTests" ]; +let EXPORTED_SYMBOLS = [ "define", "runSourceMapTests" ]; /* -*- Mode: js; js-indent-level: 2; -*- */ /* * Copyright 2011 Mozilla Foundation and contributors diff --git a/toolkit/devtools/webconsole/NetworkHelper.jsm b/toolkit/devtools/webconsole/NetworkHelper.jsm index c4b6d1c0d2b..853d4448325 100644 --- a/toolkit/devtools/webconsole/NetworkHelper.jsm +++ b/toolkit/devtools/webconsole/NetworkHelper.jsm @@ -64,7 +64,7 @@ XPCOMUtils.defineLazyGetter(this, "NetUtil", function () { return obj.NetUtil; }); -this.EXPORTED_SYMBOLS = ["NetworkHelper"]; +var EXPORTED_SYMBOLS = ["NetworkHelper"]; /** * Helper object for networking stuff. @@ -73,7 +73,7 @@ this.EXPORTED_SYMBOLS = ["NetworkHelper"]; * have been modified to match the Firefox coding rules. */ -this.NetworkHelper = +var NetworkHelper = { /** * Converts aText with a given aCharset to unicode. diff --git a/toolkit/devtools/webconsole/WebConsoleClient.jsm b/toolkit/devtools/webconsole/WebConsoleClient.jsm index b257e0acd8f..da27e34f1e0 100644 --- a/toolkit/devtools/webconsole/WebConsoleClient.jsm +++ b/toolkit/devtools/webconsole/WebConsoleClient.jsm @@ -10,7 +10,7 @@ const Cc = Components.classes; const Ci = Components.interfaces; const Cu = Components.utils; -this.EXPORTED_SYMBOLS = ["WebConsoleClient"]; +var EXPORTED_SYMBOLS = ["WebConsoleClient"]; /** * A WebConsoleClient is used as a front end for the WebConsoleActor that is @@ -21,7 +21,7 @@ this.EXPORTED_SYMBOLS = ["WebConsoleClient"]; * @param string aActor * The WebConsoleActor ID. */ -this.WebConsoleClient = function WebConsoleClient(aDebuggerClient, aActor) +function WebConsoleClient(aDebuggerClient, aActor) { this._actor = aActor; this._client = aDebuggerClient; diff --git a/toolkit/devtools/webconsole/WebConsoleUtils.jsm b/toolkit/devtools/webconsole/WebConsoleUtils.jsm index b4abc490a4a..e936c3acb4b 100644 --- a/toolkit/devtools/webconsole/WebConsoleUtils.jsm +++ b/toolkit/devtools/webconsole/WebConsoleUtils.jsm @@ -28,10 +28,10 @@ XPCOMUtils.defineLazyServiceGetter(this, "gActivityDistributor", "@mozilla.org/network/http-activity-distributor;1", "nsIHttpActivityDistributor"); -this.EXPORTED_SYMBOLS = ["WebConsoleUtils", "JSPropertyProvider", "JSTermHelpers", - "PageErrorListener", "ConsoleAPIListener", - "NetworkResponseListener", "NetworkMonitor", - "ConsoleProgressListener"]; +var EXPORTED_SYMBOLS = ["WebConsoleUtils", "JSPropertyProvider", "JSTermHelpers", + "PageErrorListener", "ConsoleAPIListener", + "NetworkResponseListener", "NetworkMonitor", + "ConsoleProgressListener"]; // Match the function name from the result of toString() or toSource(). // @@ -44,7 +44,7 @@ const REGEX_MATCH_FUNCTION_NAME = /^\(?function\s+([^(\s]+)\s*\(/; // Match the function arguments from the result of toString() or toSource(). const REGEX_MATCH_FUNCTION_ARGS = /^\(?function\s*[^\s(]*\s*\((.+?)\)/; -this.WebConsoleUtils = { +var WebConsoleUtils = { /** * Convenience function to unwrap a wrapped object. * @@ -914,7 +914,7 @@ WebConsoleUtils.l10n.prototype = { // JS Completer ////////////////////////////////////////////////////////////////////////// -this.JSPropertyProvider = (function _JSPP(WCU) { +var JSPropertyProvider = (function _JSPP(WCU) { const STATE_NORMAL = 0; const STATE_QUOTE = 2; const STATE_DQUOTE = 3; @@ -1225,7 +1225,7 @@ return JSPropertyProvider; * invoked with one argument, the nsIScriptError, whenever a relevant * page error is received. */ -this.PageErrorListener = function PageErrorListener(aWindow, aListener) +function PageErrorListener(aWindow, aListener) { this.window = aWindow; this.listener = aListener; @@ -1373,7 +1373,7 @@ PageErrorListener.prototype = * Console API message that comes from the observer service, whenever * a relevant console API call is received. */ -this.ConsoleAPIListener = function ConsoleAPIListener(aWindow, aOwner) +function ConsoleAPIListener(aWindow, aOwner) { this.window = aWindow; this.owner = aOwner; @@ -1475,7 +1475,7 @@ ConsoleAPIListener.prototype = * @param object aOwner * The owning object. */ -this.JSTermHelpers = function JSTermHelpers(aOwner) +function JSTermHelpers(aOwner) { /** * Find a node by ID. @@ -1679,7 +1679,7 @@ this.JSTermHelpers = function JSTermHelpers(aOwner) aOwner.helperResult = { rawOutput: true }; return String(aString); }; -}; +} (function(_global, WCU) { @@ -2582,6 +2582,7 @@ _global.NetworkMonitor = NetworkMonitor; _global.NetworkResponseListener = NetworkResponseListener; })(this, WebConsoleUtils); + /** * A WebProgressListener that listens for location changes. * @@ -2596,8 +2597,7 @@ _global.NetworkResponseListener = NetworkResponseListener; * - onFileActivity(aFileURI) * - onLocationChange(aState, aTabURI, aPageTitle) */ -this.ConsoleProgressListener = - function ConsoleProgressListener(aWindow, aOwner) +function ConsoleProgressListener(aWindow, aOwner) { this.window = aWindow; this.owner = aOwner; diff --git a/toolkit/forgetaboutsite/ForgetAboutSite.jsm b/toolkit/forgetaboutsite/ForgetAboutSite.jsm index 30e86c9ef4f..ed0789cb848 100644 --- a/toolkit/forgetaboutsite/ForgetAboutSite.jsm +++ b/toolkit/forgetaboutsite/ForgetAboutSite.jsm @@ -4,7 +4,7 @@ Components.utils.import("resource://gre/modules/Services.jsm"); -this.EXPORTED_SYMBOLS = ["ForgetAboutSite"]; +var EXPORTED_SYMBOLS = ["ForgetAboutSite"]; /** * Returns true if the string passed in is part of the root domain of the @@ -35,7 +35,7 @@ const Cc = Components.classes; const Ci = Components.interfaces; const Cu = Components.utils; -this.ForgetAboutSite = { +var ForgetAboutSite = { removeDataFromDomain: function CRH_removeDataFromDomain(aDomain) { // clear any and all network geolocation provider sessions diff --git a/toolkit/identity/Identity.jsm b/toolkit/identity/Identity.jsm index a3d5e37d739..08d8a5a4729 100644 --- a/toolkit/identity/Identity.jsm +++ b/toolkit/identity/Identity.jsm @@ -6,7 +6,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["IdentityService"]; +const EXPORTED_SYMBOLS = ["IdentityService"]; const Cu = Components.utils; const Ci = Components.interfaces; @@ -302,4 +302,4 @@ IDService.prototype = { }; -this.IdentityService = new IDService(); +let IdentityService = new IDService(); diff --git a/toolkit/identity/IdentityProvider.jsm b/toolkit/identity/IdentityProvider.jsm index f0fb5ed5d91..93e8b91455f 100644 --- a/toolkit/identity/IdentityProvider.jsm +++ b/toolkit/identity/IdentityProvider.jsm @@ -16,7 +16,7 @@ Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/identity/LogUtils.jsm"); Cu.import("resource://gre/modules/identity/Sandbox.jsm"); -this.EXPORTED_SYMBOLS = ["IdentityProvider"]; +const EXPORTED_SYMBOLS = ["IdentityProvider"]; const FALLBACK_PROVIDER = "browserid.org"; XPCOMUtils.defineLazyModuleGetter(this, @@ -491,4 +491,4 @@ IdentityProviderService.prototype = { }; -this.IdentityProvider = new IdentityProviderService(); +let IdentityProvider = new IdentityProviderService(); diff --git a/toolkit/identity/IdentityStore.jsm b/toolkit/identity/IdentityStore.jsm index ed761ca26d1..fda9e277d39 100644 --- a/toolkit/identity/IdentityStore.jsm +++ b/toolkit/identity/IdentityStore.jsm @@ -14,7 +14,7 @@ const Cr = Components.results; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); -this.EXPORTED_SYMBOLS = ["IdentityStore"]; +const EXPORTED_SYMBOLS = ["IdentityStore"]; // the data store for IDService // written as a separate thing so it can easily be mocked @@ -94,4 +94,4 @@ IDServiceStore.prototype = { }, }; -this.IdentityStore = new IDServiceStore(); +let IdentityStore = new IDServiceStore(); diff --git a/toolkit/identity/LogUtils.jsm b/toolkit/identity/LogUtils.jsm index 61dba9d3ba9..85d8e5d7159 100644 --- a/toolkit/identity/LogUtils.jsm +++ b/toolkit/identity/LogUtils.jsm @@ -6,7 +6,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["Logger"]; +const EXPORTED_SYMBOLS = ["Logger"]; const PREF_DEBUG = "toolkit.identity.debug"; const Cu = Components.utils; @@ -100,4 +100,4 @@ IdentityLogger.prototype = { }; -this.Logger = new IdentityLogger(); +let Logger = new IdentityLogger(); diff --git a/toolkit/identity/RelyingParty.jsm b/toolkit/identity/RelyingParty.jsm index 6a6dfaf461d..cf81b494927 100644 --- a/toolkit/identity/RelyingParty.jsm +++ b/toolkit/identity/RelyingParty.jsm @@ -16,7 +16,7 @@ Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/identity/LogUtils.jsm"); Cu.import("resource://gre/modules/identity/IdentityStore.jsm"); -this.EXPORTED_SYMBOLS = ["RelyingParty"]; +const EXPORTED_SYMBOLS = ["RelyingParty"]; XPCOMUtils.defineLazyModuleGetter(this, "jwcrypto", @@ -365,4 +365,4 @@ IdentityRelyingParty.prototype = { }; -this.RelyingParty = new IdentityRelyingParty(); +let RelyingParty = new IdentityRelyingParty(); diff --git a/toolkit/identity/Sandbox.jsm b/toolkit/identity/Sandbox.jsm index 90a9095e385..0196687ac23 100644 --- a/toolkit/identity/Sandbox.jsm +++ b/toolkit/identity/Sandbox.jsm @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["Sandbox"]; +const EXPORTED_SYMBOLS = ["Sandbox"]; const {classes: Cc, interfaces: Ci, utils: Cu} = Components; @@ -31,7 +31,7 @@ XPCOMUtils.defineLazyModuleGetter(this, * @param aCallback * (function) Callback to be invoked with a Sandbox, when ready. */ -this.Sandbox = function Sandbox(aURL, aCallback) { +function Sandbox(aURL, aCallback) { // Normalize the URL so the comparison in _makeSandboxContentLoaded works this._url = Services.io.newURI(aURL, null, null).spec; this._log("Creating sandbox for:", this._url); diff --git a/toolkit/identity/jwcrypto.jsm b/toolkit/identity/jwcrypto.jsm index 783be6bda83..159ce68e6ea 100644 --- a/toolkit/identity/jwcrypto.jsm +++ b/toolkit/identity/jwcrypto.jsm @@ -21,7 +21,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "@mozilla.org/identity/crypto-service;1", "nsIIdentityCryptoService"); -this.EXPORTED_SYMBOLS = ["jwcrypto"]; +const EXPORTED_SYMBOLS = ["jwcrypto"]; const ALGORITHMS = { RS256: "RS256", DS160: "DS160" }; @@ -125,5 +125,5 @@ jwcryptoClass.prototype = { }; -this.jwcrypto = new jwcryptoClass(); +var jwcrypto = new jwcryptoClass(); jwcrypto.ALGORITHMS = ALGORITHMS; diff --git a/toolkit/mozapps/downloads/DownloadLastDir.jsm b/toolkit/mozapps/downloads/DownloadLastDir.jsm index eae69ece2ee..c26cbde6e14 100644 --- a/toolkit/mozapps/downloads/DownloadLastDir.jsm +++ b/toolkit/mozapps/downloads/DownloadLastDir.jsm @@ -28,7 +28,7 @@ const LAST_DIR_PREF = "browser.download.lastDir"; const SAVE_PER_SITE_PREF = LAST_DIR_PREF + ".savePerSite"; const nsIFile = Components.interfaces.nsIFile; -this.EXPORTED_SYMBOLS = [ "DownloadLastDir" ]; +var EXPORTED_SYMBOLS = [ "DownloadLastDir" ]; Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); @@ -84,7 +84,7 @@ function isContentPrefEnabled() { let gDownloadLastDirFile = readLastDirPref(); -this.DownloadLastDir = function DownloadLastDir(aWindow) { +function DownloadLastDir(aWindow) { this.window = aWindow; } diff --git a/toolkit/mozapps/downloads/DownloadPaths.jsm b/toolkit/mozapps/downloads/DownloadPaths.jsm index a1057582ec9..3b94c1300c0 100644 --- a/toolkit/mozapps/downloads/DownloadPaths.jsm +++ b/toolkit/mozapps/downloads/DownloadPaths.jsm @@ -4,7 +4,7 @@ * 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 = [ +var EXPORTED_SYMBOLS = [ "DownloadPaths", ]; @@ -26,7 +26,7 @@ const Ci = Components.interfaces; const Cu = Components.utils; const Cr = Components.results; -this.DownloadPaths = { +const DownloadPaths = { /** * Creates a uniquely-named file starting from the name of the provided file. * If a file with the provided name already exists, the function attempts to diff --git a/toolkit/mozapps/downloads/DownloadTaskbarProgress.jsm b/toolkit/mozapps/downloads/DownloadTaskbarProgress.jsm index c3e6d911816..c4e6b1cc15a 100644 --- a/toolkit/mozapps/downloads/DownloadTaskbarProgress.jsm +++ b/toolkit/mozapps/downloads/DownloadTaskbarProgress.jsm @@ -4,7 +4,7 @@ * 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 = [ +let EXPORTED_SYMBOLS = [ "DownloadTaskbarProgress", ]; @@ -19,7 +19,7 @@ const kTaskbarID = "@mozilla.org/windows-taskbar;1"; //////////////////////////////////////////////////////////////////////////////// //// DownloadTaskbarProgress Object -this.DownloadTaskbarProgress = +const DownloadTaskbarProgress = { /** * Called when a browser window appears. This has an effect only when we diff --git a/toolkit/mozapps/downloads/DownloadUtils.jsm b/toolkit/mozapps/downloads/DownloadUtils.jsm index f0636cf124d..531f27d4b16 100644 --- a/toolkit/mozapps/downloads/DownloadUtils.jsm +++ b/toolkit/mozapps/downloads/DownloadUtils.jsm @@ -3,7 +3,7 @@ * 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 = [ "DownloadUtils" ]; +var EXPORTED_SYMBOLS = [ "DownloadUtils" ]; /** * This module provides the DownloadUtils object which contains useful methods @@ -85,7 +85,7 @@ __defineGetter__("gBundle", function() { const kCachedLastMaxSize = 10; let gCachedLast = []; -this.DownloadUtils = { +let DownloadUtils = { /** * Generate a full status string for a download given its current progress, * total size, speed, last time remaining diff --git a/toolkit/mozapps/downloads/nsHelperAppDlg.js b/toolkit/mozapps/downloads/nsHelperAppDlg.js index abb6c4825ac..b5739ab0002 100644 --- a/toolkit/mozapps/downloads/nsHelperAppDlg.js +++ b/toolkit/mozapps/downloads/nsHelperAppDlg.js @@ -1081,4 +1081,4 @@ nsUnknownContentTypeDialog.prototype = { } } -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsUnknownContentTypeDialog]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsUnknownContentTypeDialog]); diff --git a/toolkit/mozapps/extensions/AddonLogging.jsm b/toolkit/mozapps/extensions/AddonLogging.jsm index 6077e43b283..96cbe5de651 100644 --- a/toolkit/mozapps/extensions/AddonLogging.jsm +++ b/toolkit/mozapps/extensions/AddonLogging.jsm @@ -19,7 +19,7 @@ const NS_PREFBRANCH_PREFCHANGE_TOPIC_ID = "nsPref:changed"; Components.utils.import("resource://gre/modules/FileUtils.jsm"); Components.utils.import("resource://gre/modules/Services.jsm"); -this.EXPORTED_SYMBOLS = [ "LogManager" ]; +var EXPORTED_SYMBOLS = [ "LogManager" ]; var gDebugLogEnabled = false; @@ -130,7 +130,7 @@ AddonLogger.prototype = { } }; -this.LogManager = { +var LogManager = { getLogger: function LogManager_getLogger(aName, aTarget) { let logger = new AddonLogger(aName); diff --git a/toolkit/mozapps/extensions/AddonManager.jsm b/toolkit/mozapps/extensions/AddonManager.jsm index 129ba8c8183..e6f542f7e61 100644 --- a/toolkit/mozapps/extensions/AddonManager.jsm +++ b/toolkit/mozapps/extensions/AddonManager.jsm @@ -51,7 +51,7 @@ XPCOMUtils.defineLazyGetter(this, "CertUtils", function certUtilsLazyGetter() { }); -this.EXPORTED_SYMBOLS = [ "AddonManager", "AddonManagerPrivate" ]; +var EXPORTED_SYMBOLS = [ "AddonManager", "AddonManagerPrivate" ]; const CATEGORY_PROVIDER_MODULE = "addon-provider-module"; @@ -2027,7 +2027,7 @@ var AddonManagerInternal = { * AddonManagerInternal for documentation however note that these methods are * subject to change at any time. */ -this.AddonManagerPrivate = { +var AddonManagerPrivate = { startup: function AMP_startup() { AddonManagerInternal.startup(); }, @@ -2086,7 +2086,7 @@ this.AddonManagerPrivate = { * This is the public API that UI and developers should be calling. All methods * just forward to AddonManagerInternal. */ -this.AddonManager = { +var AddonManager = { // Constants for the AddonInstall.state property // The install is available for download. STATE_AVAILABLE: 0, diff --git a/toolkit/mozapps/extensions/AddonRepository.jsm b/toolkit/mozapps/extensions/AddonRepository.jsm index 559760bc1af..19872a12e94 100644 --- a/toolkit/mozapps/extensions/AddonRepository.jsm +++ b/toolkit/mozapps/extensions/AddonRepository.jsm @@ -17,7 +17,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "FileUtils", XPCOMUtils.defineLazyModuleGetter(this, "NetUtil", "resource://gre/modules/NetUtil.jsm"); -this.EXPORTED_SYMBOLS = [ "AddonRepository" ]; +var EXPORTED_SYMBOLS = [ "AddonRepository" ]; const PREF_GETADDONS_CACHE_ENABLED = "extensions.getAddons.cache.enabled"; const PREF_GETADDONS_CACHE_TYPES = "extensions.getAddons.cache.types"; @@ -418,7 +418,7 @@ AddonSearchResult.prototype = { * that are compatible with the current application and are not already * installed. */ -this.AddonRepository = { +var AddonRepository = { /** * Whether caching is currently enabled */ diff --git a/toolkit/mozapps/extensions/AddonUpdateChecker.jsm b/toolkit/mozapps/extensions/AddonUpdateChecker.jsm index 3b5dc7de71a..bda63ae22d7 100644 --- a/toolkit/mozapps/extensions/AddonUpdateChecker.jsm +++ b/toolkit/mozapps/extensions/AddonUpdateChecker.jsm @@ -13,7 +13,7 @@ const Cc = Components.classes; const Ci = Components.interfaces; const Cu = Components.utils; -this.EXPORTED_SYMBOLS = [ "AddonUpdateChecker" ]; +var EXPORTED_SYMBOLS = [ "AddonUpdateChecker" ]; const TIMEOUT = 2 * 60 * 1000; const PREFIX_NS_RDF = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"; @@ -592,7 +592,7 @@ function matchesVersions(aUpdate, aAppVersion, aPlatformVersion, return result; } -this.AddonUpdateChecker = { +var AddonUpdateChecker = { // These must be kept in sync with AddonManager // The update check timed out ERROR_TIMEOUT: -1, diff --git a/toolkit/mozapps/extensions/ChromeManifestParser.jsm b/toolkit/mozapps/extensions/ChromeManifestParser.jsm index 9a77c54295a..76cb14d2b70 100644 --- a/toolkit/mozapps/extensions/ChromeManifestParser.jsm +++ b/toolkit/mozapps/extensions/ChromeManifestParser.jsm @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["ChromeManifestParser"]; +var EXPORTED_SYMBOLS = ["ChromeManifestParser"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -33,7 +33,7 @@ function flushJarCache(aJarFile) { /** * Parses chrome manifest files. */ -this.ChromeManifestParser = { +var ChromeManifestParser = { /** * Reads and parses a chrome manifest file located at a specified URI, and all diff --git a/toolkit/mozapps/extensions/LightweightThemeImageOptimizer.jsm b/toolkit/mozapps/extensions/LightweightThemeImageOptimizer.jsm index f76aa9d06fb..f7037eed8ea 100644 --- a/toolkit/mozapps/extensions/LightweightThemeImageOptimizer.jsm +++ b/toolkit/mozapps/extensions/LightweightThemeImageOptimizer.jsm @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["LightweightThemeImageOptimizer"]; +let EXPORTED_SYMBOLS = ["LightweightThemeImageOptimizer"]; const Cu = Components.utils; const Ci = Components.interfaces; @@ -20,7 +20,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "FileUtils", const ORIGIN_TOP_RIGHT = 1; const ORIGIN_BOTTOM_LEFT = 2; -this.LightweightThemeImageOptimizer = { +let LightweightThemeImageOptimizer = { optimize: function LWTIO_optimize(aThemeData, aScreen) { let data = Utils.createCopy(aThemeData); if (!data.headerURL) { diff --git a/toolkit/mozapps/extensions/LightweightThemeManager.jsm b/toolkit/mozapps/extensions/LightweightThemeManager.jsm index 1e579e4ce44..7ee8740d84c 100644 --- a/toolkit/mozapps/extensions/LightweightThemeManager.jsm +++ b/toolkit/mozapps/extensions/LightweightThemeManager.jsm @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["LightweightThemeManager"]; +var EXPORTED_SYMBOLS = ["LightweightThemeManager"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -69,7 +69,7 @@ __defineSetter__("_maxUsedThemes", function maxUsedThemesSetter(aVal) { var _themeIDBeingEnabled = null; var _themeIDBeingDisbled = null; -this.LightweightThemeManager = { +var LightweightThemeManager = { get usedThemes () { try { return JSON.parse(_prefs.getComplexValue("usedThemes", diff --git a/toolkit/mozapps/extensions/PluginProvider.jsm b/toolkit/mozapps/extensions/PluginProvider.jsm index bb495d27134..dc2342c135d 100644 --- a/toolkit/mozapps/extensions/PluginProvider.jsm +++ b/toolkit/mozapps/extensions/PluginProvider.jsm @@ -7,7 +7,7 @@ const Cc = Components.classes; const Ci = Components.interfaces; -this.EXPORTED_SYMBOLS = []; +var EXPORTED_SYMBOLS = []; Components.utils.import("resource://gre/modules/AddonManager.jsm"); Components.utils.import("resource://gre/modules/Services.jsm"); diff --git a/toolkit/mozapps/extensions/XPIProvider.jsm b/toolkit/mozapps/extensions/XPIProvider.jsm index 82fa9d8cd07..bbb6d32c9fe 100644 --- a/toolkit/mozapps/extensions/XPIProvider.jsm +++ b/toolkit/mozapps/extensions/XPIProvider.jsm @@ -8,7 +8,7 @@ const Cc = Components.classes; const Ci = Components.interfaces; const Cr = Components.results; -this.EXPORTED_SYMBOLS = []; +var EXPORTED_SYMBOLS = []; Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); diff --git a/toolkit/mozapps/extensions/addonManager.js b/toolkit/mozapps/extensions/addonManager.js index d33098b2fde..ffe0833eb2b 100644 --- a/toolkit/mozapps/extensions/addonManager.js +++ b/toolkit/mozapps/extensions/addonManager.js @@ -206,4 +206,4 @@ amManager.prototype = { Ci.nsIObserver]) }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([amManager]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([amManager]); diff --git a/toolkit/mozapps/extensions/amContentHandler.js b/toolkit/mozapps/extensions/amContentHandler.js index e5c65d9590a..34d17bf36ad 100644 --- a/toolkit/mozapps/extensions/amContentHandler.js +++ b/toolkit/mozapps/extensions/amContentHandler.js @@ -84,4 +84,4 @@ amContentHandler.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([amContentHandler]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([amContentHandler]); diff --git a/toolkit/mozapps/extensions/amWebInstallListener.js b/toolkit/mozapps/extensions/amWebInstallListener.js index 06ac7c248da..3d82aada033 100644 --- a/toolkit/mozapps/extensions/amWebInstallListener.js +++ b/toolkit/mozapps/extensions/amWebInstallListener.js @@ -312,4 +312,4 @@ extWebInstallListener.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.amIWebInstallListener]) }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([extWebInstallListener]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([extWebInstallListener]); diff --git a/toolkit/mozapps/extensions/nsBlocklistService.js b/toolkit/mozapps/extensions/nsBlocklistService.js index da8d4a389ae..ce9356c83f9 100644 --- a/toolkit/mozapps/extensions/nsBlocklistService.js +++ b/toolkit/mozapps/extensions/nsBlocklistService.js @@ -1177,4 +1177,4 @@ BlocklistItemData.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([Blocklist]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([Blocklist]); diff --git a/toolkit/mozapps/extensions/test/addons/test_bootstrap1_1/version.jsm b/toolkit/mozapps/extensions/test/addons/test_bootstrap1_1/version.jsm index 7fe60e632dd..7b6d8960c57 100644 --- a/toolkit/mozapps/extensions/test/addons/test_bootstrap1_1/version.jsm +++ b/toolkit/mozapps/extensions/test/addons/test_bootstrap1_1/version.jsm @@ -1,3 +1,3 @@ -this.EXPORTED_SYMBOLS = ["VERSION"]; +var EXPORTED_SYMBOLS = ["VERSION"]; -this.VERSION = 1; +var VERSION = 1; diff --git a/toolkit/mozapps/extensions/test/addons/test_bootstrap1_2/version.jsm b/toolkit/mozapps/extensions/test/addons/test_bootstrap1_2/version.jsm index 532741e121b..4afb723f695 100644 --- a/toolkit/mozapps/extensions/test/addons/test_bootstrap1_2/version.jsm +++ b/toolkit/mozapps/extensions/test/addons/test_bootstrap1_2/version.jsm @@ -1,3 +1,3 @@ -this.EXPORTED_SYMBOLS = ["VERSION"]; +var EXPORTED_SYMBOLS = ["VERSION"]; -this.VERSION = 2; +var VERSION = 2; diff --git a/toolkit/mozapps/extensions/test/addons/test_bootstrap1_3/version.jsm b/toolkit/mozapps/extensions/test/addons/test_bootstrap1_3/version.jsm index 1b813faaf47..2454336c691 100644 --- a/toolkit/mozapps/extensions/test/addons/test_bootstrap1_3/version.jsm +++ b/toolkit/mozapps/extensions/test/addons/test_bootstrap1_3/version.jsm @@ -1,3 +1,3 @@ -this.EXPORTED_SYMBOLS = ["VERSION"]; +var EXPORTED_SYMBOLS = ["VERSION"]; -this.VERSION = 3; +var VERSION = 3; diff --git a/toolkit/mozapps/handling/nsContentDispatchChooser.js b/toolkit/mozapps/handling/nsContentDispatchChooser.js index 01a417ff156..fa4dd4bf1cb 100644 --- a/toolkit/mozapps/handling/nsContentDispatchChooser.js +++ b/toolkit/mozapps/handling/nsContentDispatchChooser.js @@ -87,4 +87,4 @@ nsContentDispatchChooser.prototype = let components = [nsContentDispatchChooser]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/toolkit/mozapps/shared/CertUtils.jsm b/toolkit/mozapps/shared/CertUtils.jsm index c6f55ee2940..2af846425ef 100644 --- a/toolkit/mozapps/shared/CertUtils.jsm +++ b/toolkit/mozapps/shared/CertUtils.jsm @@ -4,7 +4,7 @@ * 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/. */ #endif -this.EXPORTED_SYMBOLS = [ "BadCertHandler", "checkCert", "readCertPrefs", "validateCert" ]; +EXPORTED_SYMBOLS = [ "BadCertHandler", "checkCert", "readCertPrefs", "validateCert" ]; const Ce = Components.Exception; const Ci = Components.interfaces; @@ -31,8 +31,7 @@ Components.utils.import("resource://gre/modules/Services.jsm"); * @return An array of JS objects with names / values corresponding to the * expected certificate's attribute names / values. */ -this.readCertPrefs = - function readCertPrefs(aPrefBranch) { +function readCertPrefs(aPrefBranch) { if (Services.prefs.getBranch(aPrefBranch).getChildList("").length == 0) return null; @@ -71,8 +70,7 @@ this.readCertPrefs = * aCertificate wasn't specified and aCerts is not null or an empty * array. */ -this.validateCert = - function validateCert(aCertificate, aCerts) { +function validateCert(aCertificate, aCerts) { // If there are no certificate requirements then just exit if (!aCerts || aCerts.length == 0) return; @@ -139,8 +137,7 @@ this.validateCert = * from the aCerts param is different than the expected value. * NS_ERROR_ABORT if the certificate issuer is not built-in. */ -this.checkCert = - function checkCert(aChannel, aAllowNonBuiltInCerts, aCerts) { +function checkCert(aChannel, aAllowNonBuiltInCerts, aCerts) { if (!aChannel.originalURI.schemeIs("https")) { // Require https if there are certificate values to verify if (aCerts) { @@ -187,8 +184,7 @@ function isBuiltinToken(tokenName) { * When true certificates that aren't builtin are allowed. When false * or not specified the certificate must be a builtin certificate. */ -this.BadCertHandler = - function BadCertHandler(aAllowNonBuiltInCerts) { +function BadCertHandler(aAllowNonBuiltInCerts) { this.allowNonBuiltInCerts = aAllowNonBuiltInCerts; } BadCertHandler.prototype = { diff --git a/toolkit/mozapps/shared/FileUtils.jsm b/toolkit/mozapps/shared/FileUtils.jsm index d11540ec55c..72c0b9bdc7a 100644 --- a/toolkit/mozapps/shared/FileUtils.jsm +++ b/toolkit/mozapps/shared/FileUtils.jsm @@ -3,7 +3,7 @@ * 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 = [ "FileUtils" ]; +EXPORTED_SYMBOLS = [ "FileUtils" ]; Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); @@ -15,7 +15,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "gDirService", "@mozilla.org/file/directory_service;1", "nsIProperties"); -this.FileUtils = { +var FileUtils = { MODE_RDONLY : 0x01, MODE_WRONLY : 0x02, MODE_RDWR : 0x04, diff --git a/toolkit/mozapps/update/nsUpdateService.js b/toolkit/mozapps/update/nsUpdateService.js index a32f715a39b..00089141004 100644 --- a/toolkit/mozapps/update/nsUpdateService.js +++ b/toolkit/mozapps/update/nsUpdateService.js @@ -3862,7 +3862,7 @@ UpdatePrompt.prototype = { }; var components = [UpdateService, Checker, UpdatePrompt, UpdateManager]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(components); #if 0 /** diff --git a/toolkit/mozapps/update/nsUpdateServiceStub.js b/toolkit/mozapps/update/nsUpdateServiceStub.js index 78babe57d30..ce3a4d5ef18 100644 --- a/toolkit/mozapps/update/nsUpdateServiceStub.js +++ b/toolkit/mozapps/update/nsUpdateServiceStub.js @@ -60,4 +60,4 @@ UpdateServiceStub.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]) }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([UpdateServiceStub]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([UpdateServiceStub]); diff --git a/toolkit/mozapps/update/nsUpdateTimerManager.js b/toolkit/mozapps/update/nsUpdateTimerManager.js index 0e5d8715981..8bfe54ffef4 100644 --- a/toolkit/mozapps/update/nsUpdateTimerManager.js +++ b/toolkit/mozapps/update/nsUpdateTimerManager.js @@ -302,4 +302,4 @@ TimerManager.prototype = { Ci.nsIObserver]) }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TimerManager]); +var NSGetFactory = XPCOMUtils.generateNSGetFactory([TimerManager]); diff --git a/toolkit/webapps/WebappOSUtils.jsm b/toolkit/webapps/WebappOSUtils.jsm index 24ca60fab40..1fb802f790d 100644 --- a/toolkit/webapps/WebappOSUtils.jsm +++ b/toolkit/webapps/WebappOSUtils.jsm @@ -9,9 +9,9 @@ const Cu = Components.utils; Cu.import("resource://gre/modules/Services.jsm"); -this.EXPORTED_SYMBOLS = ["WebappOSUtils"]; +let EXPORTED_SYMBOLS = ["WebappOSUtils"]; -this.WebappOSUtils = { +let WebappOSUtils = { launch: function(aData) { #ifdef XP_WIN let appRegKey; diff --git a/toolkit/webapps/WebappsInstaller.jsm b/toolkit/webapps/WebappsInstaller.jsm index 2666c26b132..73453bfe9f5 100644 --- a/toolkit/webapps/WebappsInstaller.jsm +++ b/toolkit/webapps/WebappsInstaller.jsm @@ -2,7 +2,7 @@ * 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 = ["WebappsInstaller"]; +let EXPORTED_SYMBOLS = ["WebappsInstaller"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -13,7 +13,7 @@ Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/FileUtils.jsm"); Cu.import("resource://gre/modules/NetUtil.jsm"); -this.WebappsInstaller = { +let WebappsInstaller = { /** * Creates a native installation of the web app in the OS * diff --git a/tools/profiler/Profiler.jsm b/tools/profiler/Profiler.jsm index c61218875bd..e85d55e42d2 100644 --- a/tools/profiler/Profiler.jsm +++ b/tools/profiler/Profiler.jsm @@ -8,9 +8,9 @@ const Cc = Components.classes; const Ci = Components.interfaces; const Cr = Components.results; -this.EXPORTED_SYMBOLS = ["Profiler"]; +var EXPORTED_SYMBOLS = ["Profiler"]; -this.Profiler = { +let Profiler = { }; diff --git a/uriloader/exthandler/nsHandlerService.js b/uriloader/exthandler/nsHandlerService.js index 4e1672ed3a5..d437b2807cd 100644 --- a/uriloader/exthandler/nsHandlerService.js +++ b/uriloader/exthandler/nsHandlerService.js @@ -1404,4 +1404,4 @@ HandlerService.prototype = { //****************************************************************************// // More XPCOM Plumbing -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([HandlerService]); +NSGetFactory = XPCOMUtils.generateNSGetFactory([HandlerService]); diff --git a/uriloader/exthandler/nsWebHandlerApp.js b/uriloader/exthandler/nsWebHandlerApp.js index 54f8a95e313..4789b830724 100644 --- a/uriloader/exthandler/nsWebHandlerApp.js +++ b/uriloader/exthandler/nsWebHandlerApp.js @@ -149,5 +149,5 @@ nsWebHandlerApp.prototype = { //////////////////////////////////////////////////////////////////////////////// //// Module -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsWebHandlerApp]); +NSGetFactory = XPCOMUtils.generateNSGetFactory([nsWebHandlerApp]); diff --git a/webapprt/CommandLineHandler.js b/webapprt/CommandLineHandler.js index e6118354170..a90e46e6de7 100644 --- a/webapprt/CommandLineHandler.js +++ b/webapprt/CommandLineHandler.js @@ -68,4 +68,4 @@ CommandLineHandler.prototype = { }; let components = [CommandLineHandler]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +let NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/webapprt/ContentPermission.js b/webapprt/ContentPermission.js index 3a726393f61..0f7d2d06399 100644 --- a/webapprt/ContentPermission.js +++ b/webapprt/ContentPermission.js @@ -86,4 +86,4 @@ ContentPermission.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermission]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermission]); diff --git a/webapprt/ContentPolicy.js b/webapprt/ContentPolicy.js index 8f1c0eb4a08..c9af5b7e311 100644 --- a/webapprt/ContentPolicy.js +++ b/webapprt/ContentPolicy.js @@ -37,4 +37,4 @@ ContentPolicy.prototype = { }, }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPolicy]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPolicy]); diff --git a/webapprt/DirectoryProvider.js b/webapprt/DirectoryProvider.js index 9b199863b7d..a78939903c2 100644 --- a/webapprt/DirectoryProvider.js +++ b/webapprt/DirectoryProvider.js @@ -53,4 +53,4 @@ DirectoryProvider.prototype = { }, }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]); diff --git a/webapprt/Startup.jsm b/webapprt/Startup.jsm index 0402debe1ed..ba07d72469b 100644 --- a/webapprt/Startup.jsm +++ b/webapprt/Startup.jsm @@ -8,7 +8,7 @@ * the first time this module is imported. So only put stuff here that must * happen before the webapp is loaded. */ -this.EXPORTED_SYMBOLS = []; +const EXPORTED_SYMBOLS = []; const Ci = Components.interfaces; const Cu = Components.utils; diff --git a/webapprt/WebappRT.jsm b/webapprt/WebappRT.jsm index 3a920908eee..c6a30eca6cc 100644 --- a/webapprt/WebappRT.jsm +++ b/webapprt/WebappRT.jsm @@ -2,7 +2,7 @@ * 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 = ["WebappRT"]; +const EXPORTED_SYMBOLS = ["WebappRT"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -21,7 +21,7 @@ XPCOMUtils.defineLazyGetter(this, "DOMApplicationRegistry", function() { return DOMApplicationRegistry; }); -this.WebappRT = { +let WebappRT = { _config: null, get config() { diff --git a/webapprt/WebappsHandler.jsm b/webapprt/WebappsHandler.jsm index a6fe4440de4..03374a939e5 100644 --- a/webapprt/WebappsHandler.jsm +++ b/webapprt/WebappsHandler.jsm @@ -4,7 +4,7 @@ "use strict"; -this.EXPORTED_SYMBOLS = ["WebappsHandler"]; +let EXPORTED_SYMBOLS = ["WebappsHandler"]; let Cc = Components.classes; let Ci = Components.interfaces; @@ -15,7 +15,7 @@ Cu.import("resource://gre/modules/Webapps.jsm"); Cu.import("resource://gre/modules/WebappsInstaller.jsm"); Cu.import("resource://gre/modules/WebappOSUtils.jsm"); -this.WebappsHandler = { +let WebappsHandler = { init: function() { Services.obs.addObserver(this, "webapps-ask-install", false); Services.obs.addObserver(this, "webapps-launch", false); diff --git a/xpcom/ds/nsINIProcessor.js b/xpcom/ds/nsINIProcessor.js index ebea6224673..2c391eb5bad 100644 --- a/xpcom/ds/nsINIProcessor.js +++ b/xpcom/ds/nsINIProcessor.js @@ -189,4 +189,4 @@ stringEnumerator.prototype = { }; let component = [INIProcessorFactory]; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/xpcom/sample/nsSample.js b/xpcom/sample/nsSample.js index 6334182b23a..4f624e0099c 100644 --- a/xpcom/sample/nsSample.js +++ b/xpcom/sample/nsSample.js @@ -55,6 +55,6 @@ mySample.prototype = { * XPCOMUtils.generateNSGetModule is for Mozilla 1.9.2 (Firefox 3.6). */ if (XPCOMUtils.generateNSGetFactory) - this.NSGetFactory = XPCOMUtils.generateNSGetFactory([mySample]); + var NSGetFactory = XPCOMUtils.generateNSGetFactory([mySample]); else var NSGetModule = XPCOMUtils.generateNSGetModule([mySample]); diff --git a/xpcom/tests/regorder/core/component.js b/xpcom/tests/regorder/core/component.js index 375c40e2719..7850749983c 100644 --- a/xpcom/tests/regorder/core/component.js +++ b/xpcom/tests/regorder/core/component.js @@ -30,8 +30,7 @@ var gRegTestCoreComponent = const kClassID = Components.ID("{56ab1cd4-ac44-4f86-8104-171f8b8f2fc7}"); -this.NSGetFactory = - function NSGetFactory(aClassID) { +function NSGetFactory(aClassID) { if (!aClassID.equals(kClassID)) throw Components.results.NS_ERROR_NOT_IMPLEMENTED; diff --git a/xpcom/tests/regorder/core/component2.js b/xpcom/tests/regorder/core/component2.js index 40759a01ba0..a12404d9bea 100644 --- a/xpcom/tests/regorder/core/component2.js +++ b/xpcom/tests/regorder/core/component2.js @@ -30,8 +30,7 @@ var gRegTestCoreComponent = const kClassID = Components.ID("{d04d1298-6dac-459b-a13b-bcab235730a0}"); -this.NSGetFactory = - function NSGetFactory(aClassID) { +function NSGetFactory(aClassID) { if (!aClassID.equals(kClassID)) throw Components.results.NS_ERROR_NOT_IMPLEMENTED; diff --git a/xpcom/tests/regorder/extension/extComponent.js b/xpcom/tests/regorder/extension/extComponent.js index 763fb44ef8e..1d045bf89c2 100644 --- a/xpcom/tests/regorder/extension/extComponent.js +++ b/xpcom/tests/regorder/extension/extComponent.js @@ -29,7 +29,7 @@ var gRegTestExtComponent = }; const kClassID = Components.ID("{fe64efb7-c5ab-41a6-b639-e6c0f483181e}"); -this.NSGetFactory = function NSGetFactory(cid) +function NSGetFactory(cid) { if (!cid.equals(kClassID)) throw Components.results.NS_ERROR_NOT_IMPLEMENTED; diff --git a/xulrunner/examples/simple/components/src/SimpleTest.js b/xulrunner/examples/simple/components/src/SimpleTest.js index e6cf90660c6..06310d2d034 100644 --- a/xulrunner/examples/simple/components/src/SimpleTest.js +++ b/xulrunner/examples/simple/components/src/SimpleTest.js @@ -24,4 +24,4 @@ SimpleTest.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SimpleTest]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([SimpleTest]); diff --git a/xulrunner/setup/nsXULAppInstall.js b/xulrunner/setup/nsXULAppInstall.js index 7bd11064bb9..e5fcc933861 100644 --- a/xulrunner/setup/nsXULAppInstall.js +++ b/xulrunner/setup/nsXULAppInstall.js @@ -315,4 +315,4 @@ AppInstall.prototype = { } }; -this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AppInstall]); +const NSGetFactory = XPCOMUtils.generateNSGetFactory([AppInstall]);