From c82a2d6fea3f99454ca8b42c86aa491bd934233f Mon Sep 17 00:00:00 2001 From: Kyle Huey Date: Tue, 30 Oct 2012 12:28:11 -0700 Subject: [PATCH] Bug 798491: Add an option to stick all chrome JSMs/JS components in the same compartment. r=mrbkap,philikon --- accessible/src/jsat/AccessFu.jsm | 4 +- accessible/src/jsat/EventManager.jsm | 4 +- accessible/src/jsat/Presenters.jsm | 18 +- accessible/src/jsat/TouchAdapter.jsm | 6 +- accessible/src/jsat/TraversalRules.jsm | 4 +- accessible/src/jsat/Utils.jsm | 6 +- accessible/src/jsat/UtteranceGenerator.jsm | 4 +- b2g/app/b2g.js | 2 + b2g/components/ActivitiesGlue.js | 2 +- b2g/components/AlertsService.js | 2 +- b2g/components/ContentHandler.js | 2 +- b2g/components/ContentPermissionPrompt.js | 2 +- b2g/components/DirectoryProvider.js | 2 +- b2g/components/MailtoProtocolHandler.js | 2 +- b2g/components/MozKeyboard.js | 2 +- b2g/components/PaymentGlue.js | 2 +- b2g/components/ProcessGlobal.js | 2 +- b2g/components/RecoveryService.js | 2 +- b2g/components/SmsProtocolHandler.js | 2 +- b2g/components/TelProtocolHandler.js | 2 +- b2g/components/TelURIParser.jsm | 4 +- b2g/components/UpdatePrompt.js | 2 +- b2g/components/YoutubeProtocolHandler.js | 2 +- browser/components/distribution.js | 4 +- .../downloads/src/DownloadsCommon.jsm | 4 +- .../downloads/src/DownloadsStartup.js | 2 +- .../components/downloads/src/DownloadsUI.js | 2 +- browser/components/feeds/src/FeedConverter.js | 2 +- browser/components/feeds/src/FeedWriter.js | 2 +- .../feeds/src/WebContentConverter.js | 2 +- .../migration/src/ChromeProfileMigrator.js | 2 +- .../migration/src/FirefoxProfileMigrator.js | 2 +- .../migration/src/IEProfileMigrator.js | 2 +- .../migration/src/MigrationUtils.jsm | 6 +- .../migration/src/ProfileMigrator.js | 2 +- .../migration/src/SafariProfileMigrator.js | 2 +- browser/components/nsBrowserContentHandler.js | 2 +- browser/components/nsBrowserGlue.js | 2 +- .../places/src/PlacesProtocolHandler.js | 2 +- .../components/places/src/PlacesUIUtils.jsm | 4 +- .../src/nsPrivateBrowsingService.js | 2 +- .../sessionstore/src/DocumentUtils.jsm | 4 +- .../sessionstore/src/SessionStorage.jsm | 4 +- .../sessionstore/src/SessionStore.jsm | 4 +- .../sessionstore/src/XPathGenerator.jsm | 4 +- .../sessionstore/src/nsSessionStartup.js | 2 +- .../sessionstore/src/nsSessionStore.js | 2 +- .../shell/src/nsSetDefaultBrowser.js | 2 +- browser/components/sidebar/nsSidebar.js | 2 +- browser/components/tabview/modules/utils.jsm | 14 +- browser/components/thumbnails/PageThumbs.jsm | 6 +- .../thumbnails/PageThumbsProtocol.js | 2 +- browser/devtools/commandline/CmdAddon.jsm | 4 +- browser/devtools/commandline/CmdBreak.jsm | 2 +- browser/devtools/commandline/CmdCalllog.jsm | 2 +- .../devtools/commandline/CmdCalllogChrome.jsm | 2 +- browser/devtools/commandline/CmdCmd.jsm | 4 +- browser/devtools/commandline/CmdConsole.jsm | 2 +- browser/devtools/commandline/CmdCookie.jsm | 2 +- browser/devtools/commandline/CmdDbg.jsm | 2 +- browser/devtools/commandline/CmdEcho.jsm | 2 +- browser/devtools/commandline/CmdExport.jsm | 3 +- browser/devtools/commandline/CmdJsb.jsm | 2 +- browser/devtools/commandline/CmdPagemod.jsm | 2 +- browser/devtools/commandline/CmdRestart.jsm | 2 +- .../devtools/commandline/CmdScreenshot.jsm | 2 +- browser/devtools/commandline/Commands.jsm | 2 +- browser/devtools/commandline/gcli.jsm | 4 +- browser/devtools/commandline/test/helpers.js | 4 +- browser/devtools/debugger/DebuggerUI.jsm | 6 +- browser/devtools/highlighter/CmdInspect.jsm | 2 +- browser/devtools/highlighter/highlighter.jsm | 4 +- browser/devtools/highlighter/inspector.jsm | 4 +- browser/devtools/highlighter/test/helpers.js | 4 +- browser/devtools/layoutview/LayoutView.jsm | 4 +- browser/devtools/markupview/MarkupView.jsm | 4 +- .../devtools/responsivedesign/CmdResize.jsm | 2 +- .../responsivedesign/responsivedesign.jsm | 4 +- .../devtools/responsivedesign/test/helpers.js | 4 +- .../scratchpad/scratchpad-manager.jsm | 4 +- browser/devtools/shared/Browser.jsm | 10 +- browser/devtools/shared/DOMHelpers.jsm | 4 +- browser/devtools/shared/DeveloperToolbar.jsm | 4 +- browser/devtools/shared/EventEmitter.jsm | 6 +- .../devtools/shared/FloatingScrollbars.jsm | 6 +- browser/devtools/shared/Jsbeautify.jsm | 4 +- browser/devtools/shared/LayoutHelpers.jsm | 4 +- browser/devtools/shared/SplitView.jsm | 4 +- browser/devtools/shared/Templater.jsm | 6 +- browser/devtools/shared/Undo.jsm | 4 +- browser/devtools/shared/test/helpers.js | 4 +- .../sourceeditor/source-editor-orion.jsm | 4 +- .../sourceeditor/source-editor-ui.jsm | 4 +- .../devtools/sourceeditor/source-editor.jsm | 4 +- browser/devtools/styleeditor/CmdEdit.jsm | 2 +- browser/devtools/styleeditor/StyleEditor.jsm | 8 +- .../styleeditor/StyleEditorChrome.jsm | 4 +- .../devtools/styleeditor/StyleEditorUtil.jsm | 16 +- browser/devtools/styleeditor/test/helpers.js | 4 +- .../devtools/styleinspector/CssHtmlTree.jsm | 6 +- browser/devtools/styleinspector/CssLogic.jsm | 6 +- .../devtools/styleinspector/CssRuleView.jsm | 20 +- .../styleinspector/StyleInspector.jsm | 2 +- browser/devtools/tilt/CmdTilt.jsm | 2 +- browser/devtools/tilt/Tilt.jsm | 4 +- browser/devtools/tilt/TiltGL.jsm | 4 +- browser/devtools/tilt/TiltMath.jsm | 14 +- browser/devtools/tilt/TiltUtils.jsm | 4 +- browser/devtools/tilt/TiltVisualizer.jsm | 4 +- browser/devtools/tilt/TiltVisualizerStyle.jsm | 4 +- .../devtools/webconsole/AutocompletePopup.jsm | 4 +- browser/devtools/webconsole/HUDService.jsm | 2 +- browser/devtools/webconsole/NetworkPanel.jsm | 4 +- browser/devtools/webconsole/PropertyPanel.jsm | 6 +- browser/fuel/src/fuelApplication.js | 2 +- browser/modules/AboutHomeUtils.jsm | 4 +- browser/modules/BrowserNewTabPreloader.jsm | 4 +- browser/modules/NetworkPrioritizer.jsm | 4 +- browser/modules/NewTabUtils.jsm | 4 +- browser/modules/SignInToWebsite.jsm | 4 +- browser/modules/Social.jsm | 4 +- browser/modules/TelemetryTimestamps.jsm | 4 +- browser/modules/WindowsJumpLists.jsm | 4 +- browser/modules/WindowsPreviewPerTab.jsm | 4 +- browser/modules/offlineAppCache.jsm | 4 +- browser/modules/openLocationLastURL.jsm | 4 +- browser/modules/webappsUI.jsm | 4 +- browser/modules/webrtcUI.jsm | 4 +- content/base/src/CSPUtils.jsm | 18 +- content/base/src/contentAreaDropListener.js | 2 +- content/base/src/contentSecurityPolicy.js | 2 +- content/base/src/messageWakeupService.js | 2 +- content/base/src/nsBadCertHandler.js | 2 +- .../xslt/src/xslt/txEXSLTRegExFunctions.js | 2 +- content/xtf/test/unit/xtfComponent.js | 2 +- dom/activities/src/ActivitiesService.jsm | 2 +- dom/activities/src/ActivityOptions.js | 2 +- dom/activities/src/ActivityProxy.js | 2 +- dom/activities/src/ActivityRequestHandler.js | 2 +- dom/activities/src/ActivityWrapper.js | 2 +- dom/alarm/AlarmDB.jsm | 4 +- dom/alarm/AlarmService.jsm | 4 +- dom/alarm/AlarmsManager.js | 2 +- dom/apps/src/AppsService.js | 2 +- dom/apps/src/AppsServiceChild.jsm | 4 +- dom/apps/src/AppsUtils.jsm | 6 +- dom/apps/src/OfflineCacheInstaller.jsm | 4 +- dom/apps/src/PermissionsInstaller.jsm | 18 +- dom/apps/src/Webapps.js | 6 +- dom/apps/src/Webapps.jsm | 4 +- dom/base/ConsoleAPI.js | 2 +- dom/base/ConsoleAPIStorage.jsm | 4 +- dom/base/DOMRequestHelper.jsm | 4 +- dom/base/IndexedDBHelper.jsm | 5 +- dom/base/ObjectWrapper.jsm | 4 +- dom/base/SiteSpecificUserAgent.js | 2 +- dom/browser-element/BrowserElementParent.js | 2 +- .../BrowserElementPromptService.jsm | 4 +- dom/contacts/ContactManager.js | 2 +- dom/contacts/fallback/ContactDB.jsm | 4 +- dom/contacts/fallback/ContactService.jsm | 4 +- dom/encoding/test/file_stringencoding.jsm | 4 +- dom/fm/DOMFMRadioChild.js | 2 +- dom/fm/DOMFMRadioParent.jsm | 4 +- dom/identity/DOMIdentity.jsm | 4 +- dom/identity/nsDOMIdentity.js | 2 +- dom/identity/nsIDService.js | 2 +- dom/media/PeerConnection.js | 2 +- dom/messages/SystemMessageInternal.js | 2 +- dom/messages/SystemMessageManager.js | 2 +- dom/mms/src/ril/MmsPduHelper.jsm | 52 +- dom/mms/src/ril/MmsService.js | 2 +- dom/mms/src/ril/WapPushManager.js | 6 +- dom/mms/src/ril/WspPduHelper.jsm | 93 +- dom/mms/src/ril/mms_consts.js | 143 +- dom/mms/src/ril/wap_consts.js | 12 +- dom/network/src/NetworkStatsDB.jsm | 4 +- dom/network/src/NetworkStatsManager.js | 6 +- dom/network/src/NetworkStatsService.jsm | 4 +- dom/network/src/TCPSocket.js | 2 +- .../src/TCPSocketParentIntermediary.js | 2 +- dom/payment/Payment.js | 2 +- dom/payment/Payment.jsm | 2 +- dom/payment/PaymentFlowInfo.js | 2 +- dom/payment/PaymentRequestInfo.js | 2 +- dom/permission/PermissionPromptHelper.jsm | 5 +- dom/permission/PermissionSettings.js | 2 +- dom/permission/PermissionSettings.jsm | 4 +- dom/settings/SettingsChangeNotifier.jsm | 4 +- dom/settings/SettingsDB.jsm | 10 +- dom/settings/SettingsManager.js | 2 +- dom/settings/SettingsQueue.jsm | 4 +- dom/settings/SettingsService.js | 3 +- dom/sms/src/ril/SmsDatabaseService.js | 2 +- dom/system/GPSDGeolocationProvider.js | 2 +- dom/system/NetworkGeolocationProvider.js | 2 +- dom/system/gonk/NetworkManager.js | 2 +- dom/system/gonk/RILContentHelper.js | 2 +- dom/system/gonk/RadioInterfaceLayer.js | 2 +- dom/system/gonk/ril_consts.js | 1772 ++++++++--------- dom/system/gonk/systemlibs.js | 9 +- dom/wifi/DOMWifiManager.js | 2 +- dom/wifi/WifiWorker.js | 2 +- dom/workers/test/WorkerTest.jsm | 4 +- .../test/extensions/traditional/WorkerTest.js | 2 +- extensions/cookie/test/unit/cookieprompt.js | 2 +- image/decoders/icon/qt/gtkqticonsconverter.js | 2 +- intl/locale/src/PluralForm.jsm | 4 +- js/ductwork/debugger/jsdebugger.jsm | 4 +- js/xpconnect/loader/ISO8601DateUtils.jsm | 4 +- js/xpconnect/loader/XPCOMUtils.jsm | 6 +- js/xpconnect/loader/mozJSComponentLoader.cpp | 287 ++- js/xpconnect/loader/mozJSComponentLoader.h | 28 +- js/xpconnect/loader/mozJSLoaderUtils.cpp | 39 + js/xpconnect/loader/mozJSLoaderUtils.h | 9 + .../tests/chrome/file_expandosharing.jsm | 4 +- .../tests/components/js/xpctest_attributes.js | 2 +- .../tests/components/js/xpctest_interfaces.js | 2 +- .../tests/components/js/xpctest_params.js | 2 +- .../tests/unit/bogus_element_type.jsm | 2 +- .../tests/unit/bogus_exports_type.jsm | 2 +- js/xpconnect/tests/unit/component-file.js | 2 +- js/xpconnect/tests/unit/component_import.js | 2 +- js/xpconnect/tests/unit/recursive_importA.jsm | 2 +- js/xpconnect/tests/unit/recursive_importB.jsm | 2 +- layout/tools/reftest/reftest-cmdline.js | 2 +- layout/tools/reftest/reftest.js | 4 +- mobile/android/components/AboutRedirector.js | 2 +- .../android/components/AddonUpdateService.js | 2 +- mobile/android/components/AlertsService.js | 2 +- mobile/android/components/BlocklistPrompt.js | 2 +- mobile/android/components/BrowserCLH.js | 2 +- .../components/ContentDispatchChooser.js | 2 +- .../components/ContentPermissionPrompt.js | 2 +- .../android/components/DirectoryProvider.js | 2 +- .../android/components/DownloadManagerUI.js | 2 +- mobile/android/components/FormAutoComplete.js | 2 +- mobile/android/components/HelperAppDialog.js | 2 +- .../components/LoginManagerPrompter.js | 2 +- mobile/android/components/PromptService.js | 2 +- mobile/android/components/SafeBrowsing.jsm | 4 +- mobile/android/components/SessionStore.js | 2 +- mobile/android/components/Sidebar.js | 2 +- mobile/android/components/XPIDialogService.js | 2 +- mobile/android/modules/JNI.jsm | 4 +- mobile/android/modules/LocaleRepository.jsm | 4 +- mobile/android/modules/contacts.jsm | 4 +- mobile/android/modules/linuxTypes.jsm | 6 +- mobile/android/modules/video.jsm | 4 +- mobile/xul/components/AboutRedirector.js | 2 +- mobile/xul/components/AddonUpdateService.js | 2 +- mobile/xul/components/AlertsService.js | 2 +- mobile/xul/components/AutoCompleteCache.js | 2 +- mobile/xul/components/BlocklistPrompt.js | 2 +- mobile/xul/components/BrowserCLH.js | 2 +- mobile/xul/components/BrowserStartup.js | 2 +- mobile/xul/components/CapturePicker.js | 2 +- .../xul/components/ContentDispatchChooser.js | 2 +- .../xul/components/ContentPermissionPrompt.js | 2 +- mobile/xul/components/DirectoryProvider.js | 2 +- mobile/xul/components/DownloadManagerUI.js | 2 +- mobile/xul/components/FormAutoComplete.js | 2 +- mobile/xul/components/HelperAppDialog.js | 2 +- mobile/xul/components/LoginManager.js | 2 +- mobile/xul/components/LoginManagerPrompter.js | 2 +- mobile/xul/components/PromptService.js | 2 +- mobile/xul/components/SafeBrowsing.js | 2 +- mobile/xul/components/SessionStore.js | 2 +- mobile/xul/components/Sidebar.js | 2 +- mobile/xul/components/UpdatePrompt.js | 2 +- mobile/xul/components/XPIDialogService.js | 2 +- mobile/xul/modules/LocaleRepository.jsm | 4 +- mobile/xul/modules/contacts.jsm | 4 +- mobile/xul/modules/linuxTypes.jsm | 6 +- mobile/xul/modules/video.jsm | 4 +- modules/libpref/src/init/all.js | 6 + netwerk/base/src/NetUtil.jsm | 4 +- netwerk/protocol/app/AppProtocolHandler.js | 2 +- netwerk/protocol/http/UserAgentOverrides.jsm | 4 +- netwerk/test/httpserver/httpd.js | 2 +- services/aitc/Aitc.js | 2 +- services/aitc/modules/browserid.js | 2 +- services/aitc/modules/client.js | 4 +- services/aitc/modules/main.js | 4 +- services/aitc/modules/manager.js | 4 +- services/aitc/modules/storage.js | 4 +- services/common/async.js | 4 +- services/common/log4moz.js | 4 +- services/common/modules-testing/aitcserver.js | 6 +- services/common/modules-testing/logging.js | 6 +- .../common/modules-testing/storageserver.js | 14 +- services/common/modules-testing/utils.js | 4 +- services/common/observers.js | 4 +- services/common/preferences.js | 5 +- services/common/rest.js | 9 +- services/common/storageservice.js | 9 +- services/common/stringbundle.js | 4 +- services/common/tokenserverclient.js | 12 +- services/common/utils.js | 4 +- services/crypto/modules/WeaveCrypto.js | 4 +- services/crypto/modules/utils.js | 4 +- services/notifications/service.js | 4 +- services/sync/Weave.js | 2 +- services/sync/modules-testing/fakeservices.js | 10 +- services/sync/modules-testing/rotaryengine.js | 10 +- services/sync/modules-testing/utils.js | 16 +- services/sync/modules/addonsreconciler.js | 16 +- services/sync/modules/addonutils.js | 2 +- services/sync/modules/engines.js | 12 +- services/sync/modules/engines/addons.js | 4 +- services/sync/modules/engines/apps.js | 6 +- services/sync/modules/engines/bookmarks.js | 20 +- services/sync/modules/engines/clients.js | 6 +- services/sync/modules/engines/forms.js | 6 +- services/sync/modules/engines/history.js | 6 +- services/sync/modules/engines/passwords.js | 6 +- services/sync/modules/engines/prefs.js | 6 +- services/sync/modules/engines/tabs.js | 6 +- services/sync/modules/identity.js | 4 +- services/sync/modules/jpakeclient.js | 7 +- services/sync/modules/keys.js | 6 +- services/sync/modules/main.js | 4 +- services/sync/modules/notifications.js | 10 +- services/sync/modules/policies.js | 6 +- services/sync/modules/record.js | 12 +- services/sync/modules/resource.js | 6 +- services/sync/modules/rest.js | 4 +- services/sync/modules/service.js | 4 +- services/sync/modules/stages/cluster.js | 4 +- services/sync/modules/stages/enginesync.js | 4 +- services/sync/modules/status.js | 4 +- services/sync/modules/userapi.js | 4 +- services/sync/modules/util.js | 22 +- storage/test/unit/vacuumParticipant.js | 2 +- .../components/marionettecomponent.js | 2 +- testing/marionette/marionette-elements.js | 30 +- .../components/SpecialPowersObserver.js | 2 +- .../specialpowers/content/MockFilePicker.jsm | 4 +- .../components/console/jsconsole-clhandler.js | 2 +- .../contentprefs/nsContentPrefService.js | 2 +- toolkit/components/ctypes/ctypes.cpp | 5 + toolkit/components/ctypes/ctypes.jsm | 2 +- .../downloads/nsDownloadManagerUI.js | 2 +- .../downloads/test/unit/downloads_manifest.js | 2 +- toolkit/components/feeds/FeedProcessor.js | 2 +- toolkit/components/filepicker/nsFilePicker.js | 2 +- .../components/microformats/Microformats.js | 14 +- toolkit/components/nsDefaultCLH.js | 2 +- toolkit/components/osfile/osfile.jsm | 4 +- .../components/osfile/osfile_async_front.jsm | 4 +- .../osfile/osfile_shared_allthreads.jsm | 2 +- .../osfile/osfile_unix_allthreads.jsm | 4 +- .../osfile/osfile_win_allthreads.jsm | 4 +- .../components/osfile/ospath_unix_back.jsm | 4 +- toolkit/components/osfile/ospath_win_back.jsm | 4 +- toolkit/components/passwordmgr/crypto-SDR.js | 2 +- toolkit/components/passwordmgr/nsLoginInfo.js | 2 +- .../components/passwordmgr/nsLoginManager.js | 2 +- .../passwordmgr/nsLoginManagerPrompter.js | 2 +- .../components/passwordmgr/storage-Legacy.js | 2 +- .../passwordmgr/storage-mozStorage.js | 2 +- toolkit/components/perf/PerfMeasurement.cpp | 5 + toolkit/components/perf/PerfMeasurement.jsm | 2 +- .../components/places/BookmarkHTMLUtils.jsm | 4 +- toolkit/components/places/ColorAnalyzer.js | 2 +- .../places/PlacesCategoriesStarter.js | 2 +- toolkit/components/places/PlacesDBUtils.jsm | 4 +- toolkit/components/places/PlacesUtils.jsm | 66 +- .../components/places/nsLivemarkService.js | 2 +- .../components/places/nsPlacesAutoComplete.js | 2 +- .../components/places/nsPlacesExpiration.js | 2 +- toolkit/components/places/nsTaggingService.js | 2 +- .../places/tests/unit/nsDummyObserver.js | 2 +- .../components/prompts/src/CommonDialog.jsm | 4 +- toolkit/components/prompts/src/nsPrompter.js | 2 +- toolkit/components/reflect/reflect.jsm | 2 +- .../components/satchel/nsFormAutoComplete.js | 2 +- .../satchel/nsFormAutoCompleteResult.jsm | 19 +- toolkit/components/satchel/nsFormHistory.js | 2 +- .../satchel/nsInputListAutoComplete.js | 2 +- toolkit/components/search/nsSearchService.js | 2 +- .../components/search/nsSearchSuggestions.js | 2 +- toolkit/components/social/FrameWorker.jsm | 5 +- toolkit/components/social/MessagePortBase.jsm | 8 +- toolkit/components/social/MozSocialAPI.jsm | 7 +- toolkit/components/social/SocialService.jsm | 4 +- toolkit/components/social/WorkerAPI.jsm | 4 +- toolkit/components/telemetry/TelemetryPing.js | 2 +- .../telemetry/TelemetryStopwatch.jsm | 4 +- .../url-classifier/SafeBrowsing.jsm | 4 +- .../nsUrlClassifierHashCompleter.js | 2 +- .../url-classifier/nsUrlClassifierLib.js | 2 +- .../nsUrlClassifierListManager.js | 2 +- .../components/urlformatter/nsURLFormatter.js | 2 +- toolkit/content/DeferredTask.jsm | 4 +- toolkit/content/Dict.jsm | 4 +- toolkit/content/Geometry.jsm | 6 +- toolkit/content/InlineSpellChecker.jsm | 4 +- toolkit/content/LightweightThemeConsumer.jsm | 5 +- toolkit/content/PageMenu.jsm | 4 +- toolkit/content/PopupNotifications.jsm | 4 +- toolkit/content/PrivateBrowsingUtils.jsm | 4 +- toolkit/content/PropertyListUtils.jsm | 4 +- toolkit/content/Services.jsm | 4 +- toolkit/content/Task.jsm | 4 +- toolkit/content/Troubleshoot.jsm | 4 +- toolkit/content/UpdateChannel.jsm | 4 +- toolkit/content/WindowDraggingUtils.jsm | 6 +- toolkit/content/debug.js | 4 +- toolkit/crashreporter/CrashSubmit.jsm | 4 +- toolkit/crashreporter/KeyValueParser.jsm | 6 +- toolkit/crashreporter/test/CrashTestUtils.jsm | 6 +- toolkit/devtools/Console.jsm | 4 +- toolkit/devtools/Require.jsm | 6 +- toolkit/devtools/_Promise.jsm | 4 +- toolkit/devtools/debugger/dbg-client.jsm | 10 +- toolkit/devtools/debugger/dbg-transport.js | 2 +- .../devtools/debugger/server/dbg-server.jsm | 4 +- toolkit/devtools/sourcemap/SourceMap.jsm | 2 +- .../devtools/sourcemap/tests/unit/Utils.jsm | 2 +- toolkit/devtools/webconsole/NetworkHelper.jsm | 4 +- .../devtools/webconsole/WebConsoleClient.jsm | 4 +- .../devtools/webconsole/WebConsoleUtils.jsm | 24 +- toolkit/forgetaboutsite/ForgetAboutSite.jsm | 4 +- toolkit/identity/Identity.jsm | 4 +- toolkit/identity/IdentityProvider.jsm | 4 +- toolkit/identity/IdentityStore.jsm | 4 +- toolkit/identity/LogUtils.jsm | 4 +- toolkit/identity/RelyingParty.jsm | 4 +- toolkit/identity/Sandbox.jsm | 4 +- toolkit/identity/jwcrypto.jsm | 4 +- toolkit/mozapps/downloads/DownloadLastDir.jsm | 4 +- toolkit/mozapps/downloads/DownloadPaths.jsm | 4 +- .../downloads/DownloadTaskbarProgress.jsm | 4 +- toolkit/mozapps/downloads/DownloadUtils.jsm | 4 +- toolkit/mozapps/downloads/nsHelperAppDlg.js | 2 +- toolkit/mozapps/extensions/AddonLogging.jsm | 4 +- toolkit/mozapps/extensions/AddonManager.jsm | 6 +- .../mozapps/extensions/AddonRepository.jsm | 4 +- .../mozapps/extensions/AddonUpdateChecker.jsm | 4 +- .../extensions/ChromeManifestParser.jsm | 4 +- .../LightweightThemeImageOptimizer.jsm | 4 +- .../extensions/LightweightThemeManager.jsm | 4 +- toolkit/mozapps/extensions/PluginProvider.jsm | 2 +- toolkit/mozapps/extensions/XPIProvider.jsm | 2 +- toolkit/mozapps/extensions/addonManager.js | 2 +- .../mozapps/extensions/amContentHandler.js | 2 +- .../extensions/amWebInstallListener.js | 2 +- .../mozapps/extensions/nsBlocklistService.js | 2 +- .../test/addons/test_bootstrap1_1/version.jsm | 4 +- .../test/addons/test_bootstrap1_2/version.jsm | 4 +- .../test/addons/test_bootstrap1_3/version.jsm | 4 +- .../handling/nsContentDispatchChooser.js | 2 +- toolkit/mozapps/shared/CertUtils.jsm | 14 +- toolkit/mozapps/shared/FileUtils.jsm | 4 +- toolkit/mozapps/update/nsUpdateService.js | 2 +- toolkit/mozapps/update/nsUpdateServiceStub.js | 2 +- .../mozapps/update/nsUpdateTimerManager.js | 2 +- toolkit/webapps/WebappOSUtils.jsm | 4 +- toolkit/webapps/WebappsInstaller.jsm | 4 +- tools/profiler/Profiler.jsm | 4 +- uriloader/exthandler/nsHandlerService.js | 2 +- uriloader/exthandler/nsWebHandlerApp.js | 2 +- webapprt/CommandLineHandler.js | 2 +- webapprt/ContentPermission.js | 2 +- webapprt/ContentPolicy.js | 2 +- webapprt/DirectoryProvider.js | 2 +- webapprt/Startup.jsm | 2 +- webapprt/WebappRT.jsm | 4 +- webapprt/WebappsHandler.jsm | 4 +- xpcom/ds/nsINIProcessor.js | 2 +- xpcom/sample/nsSample.js | 2 +- xpcom/tests/regorder/core/component.js | 3 +- xpcom/tests/regorder/core/component2.js | 3 +- .../tests/regorder/extension/extComponent.js | 2 +- .../simple/components/src/SimpleTest.js | 2 +- xulrunner/setup/nsXULAppInstall.js | 2 +- 477 files changed, 2289 insertions(+), 2057 deletions(-) diff --git a/accessible/src/jsat/AccessFu.jsm b/accessible/src/jsat/AccessFu.jsm index 764e5258e1e5..1859c4b74f4d 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; -var EXPORTED_SYMBOLS = ['AccessFu']; +this.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; -var AccessFu = { +this.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 113f5cfe9f27..ce6934c5aa30 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'); -var EXPORTED_SYMBOLS = ['EventManager']; +this.EXPORTED_SYMBOLS = ['EventManager']; -var EventManager = { +this.EventManager = { editState: {}, start: function start(aSendMsgFunc) { diff --git a/accessible/src/jsat/Presenters.jsm b/accessible/src/jsat/Presenters.jsm index 4278cb5b2ad5..e577cfef2174 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'); -var EXPORTED_SYMBOLS = ['VisualPresenter', - 'AndroidPresenter', - 'DummyAndroidPresenter', - 'SpeechPresenter', - 'PresenterContext']; +this.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. */ -function VisualPresenter() {} +this.VisualPresenter = function VisualPresenter() {} VisualPresenter.prototype = { __proto__: Presenter.prototype, @@ -179,7 +179,7 @@ VisualPresenter.prototype = { * Android presenter. Fires Android a11y events. */ -function AndroidPresenter() {} +this.AndroidPresenter = function AndroidPresenter() {} AndroidPresenter.prototype = { __proto__: Presenter.prototype, @@ -332,7 +332,7 @@ AndroidPresenter.prototype = { * A speech presenter for direct TTS output */ -function SpeechPresenter() {} +this.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. */ -function PresenterContext(aAccessible, aOldAccessible) { +this.PresenterContext = 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 035b4ec7185a..e279bbecb99a 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; -var EXPORTED_SYMBOLS = ['TouchAdapter', 'AndroidTouchAdapter']; +this.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; -var TouchAdapter = { +this.TouchAdapter = { // minimal swipe distance in inches SWIPE_MIN_DISTANCE: 0.4, @@ -366,7 +366,7 @@ var Mouse2Touch = { } }; -var AndroidTouchAdapter = { +this.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 0d11c8785478..ddec7376a9a4 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; -var EXPORTED_SYMBOLS = ['TraversalRules']; +this.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]; -var TraversalRules = { +this.TraversalRules = { Simple: new BaseTraversalRule( gSimpleTraversalRoles, function Simple_match(aAccessible) { diff --git a/accessible/src/jsat/Utils.jsm b/accessible/src/jsat/Utils.jsm index 03c4cbfc3444..2aa2b9f11d6b 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'); -var EXPORTED_SYMBOLS = ['Utils', 'Logger']; +this.EXPORTED_SYMBOLS = ['Utils', 'Logger']; -var Utils = { +this.Utils = { _buildAppMap: { '{3c2e2abc-06d4-11e1-ac3b-374f68613e61}': 'b2g', '{ec8030f7-c20a-464f-9b0e-13a3a9e97384}': 'browser', @@ -156,7 +156,7 @@ var Utils = { } }; -var Logger = { +this.Logger = { DEBUG: 0, INFO: 1, WARNING: 2, diff --git a/accessible/src/jsat/UtteranceGenerator.jsm b/accessible/src/jsat/UtteranceGenerator.jsm index 7b5f7f887c15..9108f6932574 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'); -var EXPORTED_SYMBOLS = ['UtteranceGenerator']; +this.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. */ -var UtteranceGenerator = { +this.UtteranceGenerator = { gActionMap: { jump: 'jumpAction', press: 'pressAction', diff --git a/b2g/app/b2g.js b/b2g/app/b2g.js index 08e3a63cfc94..4c3b90b9b726 100644 --- a/b2g/app/b2g.js +++ b/b2g/app/b2g.js @@ -576,3 +576,5 @@ 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 b3fe7808bac7..c6854572afc3 100644 --- a/b2g/components/ActivitiesGlue.js +++ b/b2g/components/ActivitiesGlue.js @@ -67,5 +67,5 @@ ActivitiesDialog.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIActivityUIGlue, Ci.nsIRunnable]) } -const NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivitiesDialog]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivitiesDialog]); diff --git a/b2g/components/AlertsService.js b/b2g/components/AlertsService.js index 181c5a4f95a4..abe2838020c4 100644 --- a/b2g/components/AlertsService.js +++ b/b2g/components/AlertsService.js @@ -24,4 +24,4 @@ AlertsService.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([AlertsService]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AlertsService]); diff --git a/b2g/components/ContentHandler.js b/b2g/components/ContentHandler.js index 5cebd232965b..ec37a51d1c94 100644 --- a/b2g/components/ContentHandler.js +++ b/b2g/components/ContentHandler.js @@ -50,4 +50,4 @@ ContentHandler.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentHandler]) }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentHandler]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentHandler]); diff --git a/b2g/components/ContentPermissionPrompt.js b/b2g/components/ContentPermissionPrompt.js index 39579a9aaecc..9612191f4471 100644 --- a/b2g/components/ContentPermissionPrompt.js +++ b/b2g/components/ContentPermissionPrompt.js @@ -145,4 +145,4 @@ ContentPermissionPrompt.prototype = { //module initialization -const NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermissionPrompt]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermissionPrompt]); diff --git a/b2g/components/DirectoryProvider.js b/b2g/components/DirectoryProvider.js index 1a657f33dee8..fbc957ef8626 100644 --- a/b2g/components/DirectoryProvider.js +++ b/b2g/components/DirectoryProvider.js @@ -77,4 +77,4 @@ DirectoryProvider.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]); diff --git a/b2g/components/MailtoProtocolHandler.js b/b2g/components/MailtoProtocolHandler.js index 48747b4bc675..60b1bbaaff65 100644 --- a/b2g/components/MailtoProtocolHandler.js +++ b/b2g/components/MailtoProtocolHandler.js @@ -43,4 +43,4 @@ MailtoProtocolHandler.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler]) }; -let NSGetFactory = XPCOMUtils.generateNSGetFactory([MailtoProtocolHandler]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([MailtoProtocolHandler]); diff --git a/b2g/components/MozKeyboard.js b/b2g/components/MozKeyboard.js index c95e1feae1a9..87146ba628ba 100644 --- a/b2g/components/MozKeyboard.js +++ b/b2g/components/MozKeyboard.js @@ -136,5 +136,5 @@ MozKeyboard.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([MozKeyboard]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([MozKeyboard]); diff --git a/b2g/components/PaymentGlue.js b/b2g/components/PaymentGlue.js index bc2b4f272f46..9be88e31c688 100644 --- a/b2g/components/PaymentGlue.js +++ b/b2g/components/PaymentGlue.js @@ -169,4 +169,4 @@ PaymentUI.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIPaymentUIGlue]) } -const NSGetFactory = XPCOMUtils.generateNSGetFactory([PaymentUI]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PaymentUI]); diff --git a/b2g/components/ProcessGlobal.js b/b2g/components/ProcessGlobal.js index 1d5f0ae4f40a..6857b4a926e4 100644 --- a/b2g/components/ProcessGlobal.js +++ b/b2g/components/ProcessGlobal.js @@ -57,4 +57,4 @@ ProcessGlobal.prototype = { }, }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([ProcessGlobal]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ProcessGlobal]); diff --git a/b2g/components/RecoveryService.js b/b2g/components/RecoveryService.js index 249dd7f9fd33..dda4215d3e36 100644 --- a/b2g/components/RecoveryService.js +++ b/b2g/components/RecoveryService.js @@ -90,4 +90,4 @@ RecoveryService.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([RecoveryService]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RecoveryService]); diff --git a/b2g/components/SmsProtocolHandler.js b/b2g/components/SmsProtocolHandler.js index 37079f72bd13..dc12ab45022c 100644 --- a/b2g/components/SmsProtocolHandler.js +++ b/b2g/components/SmsProtocolHandler.js @@ -56,4 +56,4 @@ SmsProtocolHandler.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler]) }; -let NSGetFactory = XPCOMUtils.generateNSGetFactory([SmsProtocolHandler]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SmsProtocolHandler]); diff --git a/b2g/components/TelProtocolHandler.js b/b2g/components/TelProtocolHandler.js index 90b0aca18058..38e0f2785cbd 100644 --- a/b2g/components/TelProtocolHandler.js +++ b/b2g/components/TelProtocolHandler.js @@ -55,4 +55,4 @@ TelProtocolHandler.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler]) }; -let NSGetFactory = XPCOMUtils.generateNSGetFactory([TelProtocolHandler]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TelProtocolHandler]); diff --git a/b2g/components/TelURIParser.jsm b/b2g/components/TelURIParser.jsm index 22f6a1686732..18eafd8c00ff 100644 --- a/b2g/components/TelURIParser.jsm +++ b/b2g/components/TelURIParser.jsm @@ -4,12 +4,12 @@ "use strict"; -let EXPORTED_SYMBOLS = ["TelURIParser"]; +this.EXPORTED_SYMBOLS = ["TelURIParser"]; /** * Singleton providing functionality for parsing tel: and sms: URIs */ -let TelURIParser = { +this.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 80f4facacb93..7de65a1c6f68 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) { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([UpdatePrompt]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([UpdatePrompt]); diff --git a/b2g/components/YoutubeProtocolHandler.js b/b2g/components/YoutubeProtocolHandler.js index 287d836acb7f..51678654aba8 100644 --- a/b2g/components/YoutubeProtocolHandler.js +++ b/b2g/components/YoutubeProtocolHandler.js @@ -129,4 +129,4 @@ YoutubeProtocolHandler.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([YoutubeProtocolHandler]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([YoutubeProtocolHandler]); diff --git a/browser/components/distribution.js b/browser/components/distribution.js index 6b20df6d2c1e..03a36e7b8a6e 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/. */ -EXPORTED_SYMBOLS = [ "DistributionCustomizer" ]; +this.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"); -function DistributionCustomizer() { +this.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 d1124b2b52ca..b91372e901c7 100644 --- a/browser/components/downloads/src/DownloadsCommon.jsm +++ b/browser/components/downloads/src/DownloadsCommon.jsm @@ -6,7 +6,7 @@ "use strict"; -var EXPORTED_SYMBOLS = [ +this.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. */ -const DownloadsCommon = { +this.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 ad61d47f3233..dcd7c1800d3e 100644 --- a/browser/components/downloads/src/DownloadsStartup.js +++ b/browser/components/downloads/src/DownloadsStartup.js @@ -273,4 +273,4 @@ DownloadsStartup.prototype = { //////////////////////////////////////////////////////////////////////////////// //// Module -const NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadsStartup]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadsStartup]); diff --git a/browser/components/downloads/src/DownloadsUI.js b/browser/components/downloads/src/DownloadsUI.js index 5ca37170c8c0..6726db795ba6 100644 --- a/browser/components/downloads/src/DownloadsUI.js +++ b/browser/components/downloads/src/DownloadsUI.js @@ -104,4 +104,4 @@ DownloadsUI.prototype = { //////////////////////////////////////////////////////////////////////////////// //// Module -const NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadsUI]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadsUI]); diff --git a/browser/components/feeds/src/FeedConverter.js b/browser/components/feeds/src/FeedConverter.js index d3e7a28dc759..e1659639ef72 100644 --- a/browser/components/feeds/src/FeedConverter.js +++ b/browser/components/feeds/src/FeedConverter.js @@ -579,4 +579,4 @@ var components = [FeedConverter, PodCastProtocolHandler]; -const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/browser/components/feeds/src/FeedWriter.js b/browser/components/feeds/src/FeedWriter.js index ea26b2b9cbb4..a20ac2d91a35 100644 --- a/browser/components/feeds/src/FeedWriter.js +++ b/browser/components/feeds/src/FeedWriter.js @@ -1378,4 +1378,4 @@ FeedWriter.prototype = { Ci.nsINavHistoryObserver]) }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([FeedWriter]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([FeedWriter]); diff --git a/browser/components/feeds/src/WebContentConverter.js b/browser/components/feeds/src/WebContentConverter.js index 0a9d19b86b1b..3667ce829b20 100644 --- a/browser/components/feeds/src/WebContentConverter.js +++ b/browser/components/feeds/src/WebContentConverter.js @@ -899,4 +899,4 @@ WebContentConverterRegistrar.prototype = { }] }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([WebContentConverterRegistrar]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WebContentConverterRegistrar]); diff --git a/browser/components/migration/src/ChromeProfileMigrator.js b/browser/components/migration/src/ChromeProfileMigrator.js index b5908dfdd417..d6d952ea0a8f 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}"); -const NSGetFactory = XPCOMUtils.generateNSGetFactory([ChromeProfileMigrator]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ChromeProfileMigrator]); diff --git a/browser/components/migration/src/FirefoxProfileMigrator.js b/browser/components/migration/src/FirefoxProfileMigrator.js index a6598fe90819..52722e936995 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}"); -const NSGetFactory = XPCOMUtils.generateNSGetFactory([FirefoxProfileMigrator]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([FirefoxProfileMigrator]); diff --git a/browser/components/migration/src/IEProfileMigrator.js b/browser/components/migration/src/IEProfileMigrator.js index 21f73ddc6649..549c7f2c4f35 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}"); -const NSGetFactory = XPCOMUtils.generateNSGetFactory([IEProfileMigrator]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([IEProfileMigrator]); diff --git a/browser/components/migration/src/MigrationUtils.jsm b/browser/components/migration/src/MigrationUtils.jsm index 0669aa88372e..1f6087926e23 100644 --- a/browser/components/migration/src/MigrationUtils.jsm +++ b/browser/components/migration/src/MigrationUtils.jsm @@ -4,7 +4,7 @@ "use strict"; -let EXPORTED_SYMBOLS = ["MigrationUtils", "MigratorPrototype"]; +this.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|. */ -let MigratorPrototype = { +this.MigratorPrototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIBrowserProfileMigrator]), /** @@ -323,7 +323,7 @@ let MigratorPrototype = { } }; -let MigrationUtils = Object.freeze({ +this.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 744f1175fdaf..f67823bae750 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") }; -let NSGetFactory = XPCOMUtils.generateNSGetFactory([ProfileMigrator]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ProfileMigrator]); diff --git a/browser/components/migration/src/SafariProfileMigrator.js b/browser/components/migration/src/SafariProfileMigrator.js index 8f25c9c7a672..8f6382d08ebd 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}"); -const NSGetFactory = XPCOMUtils.generateNSGetFactory([SafariProfileMigrator]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SafariProfileMigrator]); diff --git a/browser/components/nsBrowserContentHandler.js b/browser/components/nsBrowserContentHandler.js index 0c79aebf9c7c..656c86d8c32d 100644 --- a/browser/components/nsBrowserContentHandler.js +++ b/browser/components/nsBrowserContentHandler.js @@ -825,4 +825,4 @@ nsDefaultCommandLineHandler.prototype = { }; var components = [nsBrowserContentHandler, nsDefaultCommandLineHandler]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js index ce11b262e3c6..389f09d8c3ac 100644 --- a/browser/components/nsBrowserGlue.js +++ b/browser/components/nsBrowserGlue.js @@ -1751,4 +1751,4 @@ ContentPermissionPrompt.prototype = { }; var components = [BrowserGlue, ContentPermissionPrompt]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/browser/components/places/src/PlacesProtocolHandler.js b/browser/components/places/src/PlacesProtocolHandler.js index 07641c732170..ebffd2e28c06 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}") }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([PlacesProtocolHandler]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PlacesProtocolHandler]); diff --git a/browser/components/places/src/PlacesUIUtils.jsm b/browser/components/places/src/PlacesUIUtils.jsm index 9caf0859c109..278e28446da9 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/. */ -var EXPORTED_SYMBOLS = ["PlacesUIUtils"]; +this.EXPORTED_SYMBOLS = ["PlacesUIUtils"]; var Ci = Components.interfaces; var Cc = Components.classes; @@ -21,7 +21,7 @@ XPCOMUtils.defineLazyGetter(this, "PlacesUtils", function() { return PlacesUtils; }); -var PlacesUIUtils = { +this.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 b5a01656d9db..2d4c16f521a6 100644 --- a/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js +++ b/browser/components/privatebrowsing/src/nsPrivateBrowsingService.js @@ -591,4 +591,4 @@ PrivateBrowsingService.prototype = { } }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([PrivateBrowsingService]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PrivateBrowsingService]); diff --git a/browser/components/sessionstore/src/DocumentUtils.jsm b/browser/components/sessionstore/src/DocumentUtils.jsm index 63de0fa311d2..6b3f729b54cb 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/. */ -EXPORTED_SYMBOLS = [ "DocumentUtils" ]; +this.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"); -let DocumentUtils = { +this.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 ef22b6b453ff..8c14900c8d8a 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/. */ -let EXPORTED_SYMBOLS = ["SessionStorage"]; +this.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"); -let SessionStorage = { +this.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 3bde16f6197a..79fcc80cbdbc 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/. */ -let EXPORTED_SYMBOLS = ["SessionStore"]; +this.EXPORTED_SYMBOLS = ["SessionStore"]; const Cu = Components.utils; const Cc = Components.classes; @@ -99,7 +99,7 @@ function debug(aMsg) { Services.console.logStringMessage(aMsg); } -let SessionStore = { +this.SessionStore = { get canRestoreLastSession() { return SessionStoreInternal.canRestoreLastSession; }, diff --git a/browser/components/sessionstore/src/XPathGenerator.jsm b/browser/components/sessionstore/src/XPathGenerator.jsm index f194e3d82183..83ff2b80afc8 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/. */ -let EXPORTED_SYMBOLS = ["XPathGenerator"]; +this.EXPORTED_SYMBOLS = ["XPathGenerator"]; -let XPathGenerator = { +this.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 dba9f813de47..0aeb656cbf35 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}"), }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStartup]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStartup]); diff --git a/browser/components/sessionstore/src/nsSessionStore.js b/browser/components/sessionstore/src/nsSessionStore.js index a61bb646ab31..38713d500f9f 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]); -let NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStoreService]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStoreService]); diff --git a/browser/components/shell/src/nsSetDefaultBrowser.js b/browser/components/shell/src/nsSetDefaultBrowser.js index 47bab18a9456..f0fb661f7286 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]), }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSetDefaultBrowser]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSetDefaultBrowser]); diff --git a/browser/components/sidebar/nsSidebar.js b/browser/components/sidebar/nsSidebar.js index 1083e6798db7..5b055e2d9ed1 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]); -var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsSidebar]); +this.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 3e2d98ea4376..f5fd4ed729ea 100644 --- a/browser/components/tabview/modules/utils.jsm +++ b/browser/components/tabview/modules/utils.jsm @@ -7,7 +7,7 @@ // ********** // Title: utils.js -let EXPORTED_SYMBOLS = ["Point", "Rect", "Range", "Subscribable", "Utils", "MRUList"]; +this.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. -function Point(a, y) { +this.Point = 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. -function Rect(a, top, width, height) { +this.Rect = 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 -function Range(min, max) { +this.Range = 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. -function Subscribable() { +this.Subscribable = function Subscribable() { this.subscribers = null; }; @@ -438,7 +438,7 @@ Subscribable.prototype = { // ########## // Class: Utils // Singelton with common utility functions. -let Utils = { +this.Utils = { // ---------- // Function: toString // Prints [Utils] for debug use @@ -768,7 +768,7 @@ let Utils = { // // Constructor: MRUList // If a is an array of entries, creates a copy of it. -function MRUList(a) { +this.MRUList = 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 d1ee2f3998f6..0350ff2e8174 100644 --- a/browser/components/thumbnails/PageThumbs.jsm +++ b/browser/components/thumbnails/PageThumbs.jsm @@ -4,7 +4,7 @@ "use strict"; -let EXPORTED_SYMBOLS = ["PageThumbs", "PageThumbsStorage"]; +this.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. */ -let PageThumbs = { +this.PageThumbs = { _initialized: false, /** @@ -278,7 +278,7 @@ let PageThumbs = { }, }; -let PageThumbsStorage = { +this.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 a20a3845c1d4..e39795f095e3 100644 --- a/browser/components/thumbnails/PageThumbsProtocol.js +++ b/browser/components/thumbnails/PageThumbsProtocol.js @@ -88,7 +88,7 @@ Protocol.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIProtocolHandler]) }; -let NSGetFactory = XPCOMUtils.generateNSGetFactory([Protocol]); +this.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 927ad9ecc9c2..71c5a6ffb741 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; -let EXPORTED_SYMBOLS = [ "Flags" ]; +this.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. -let Flags = { +this.Flags = { addonsLoaded: false }; diff --git a/browser/devtools/commandline/CmdBreak.jsm b/browser/devtools/commandline/CmdBreak.jsm index 75c26667d514..819e7002b255 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; -let EXPORTED_SYMBOLS = [ ]; +this.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 42cbf9c3336a..d143a4b2a69a 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; -let EXPORTED_SYMBOLS = [ ]; +this.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 a5550c8c1ccf..80aa141155ce 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/. */ -let EXPORTED_SYMBOLS = [ ]; +this.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 7894da8590d7..cd137632d967 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/. */ -let EXPORTED_SYMBOLS = [ "CmdCommands" ]; +this.EXPORTED_SYMBOLS = [ "CmdCommands" ]; const { classes: Cc, interfaces: Ci, utils: Cu } = Components; @@ -32,7 +32,7 @@ let commands = []; /** * Exported API */ -let CmdCommands = { +this.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 c537b059ef78..391ced0b7be7 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; -let EXPORTED_SYMBOLS = [ ]; +this.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 1b72a37ccfba..88bd1b92c4b5 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; -let EXPORTED_SYMBOLS = [ ]; +this.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 f30593598580..257efd2afc2b 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; -let EXPORTED_SYMBOLS = [ ]; +this.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 4af05c3494e4..607ee1d7b11e 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; -let EXPORTED_SYMBOLS = [ ]; +this.EXPORTED_SYMBOLS = [ ]; Cu.import("resource:///modules/devtools/gcli.jsm"); diff --git a/browser/devtools/commandline/CmdExport.jsm b/browser/devtools/commandline/CmdExport.jsm index df76a5f6a9cb..175f294a8b29 100644 --- a/browser/devtools/commandline/CmdExport.jsm +++ b/browser/devtools/commandline/CmdExport.jsm @@ -3,7 +3,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ const { classes: Cc, interfaces: Ci, utils: Cu } = Components; -let EXPORTED_SYMBOLS = [ ]; + +this.EXPORTED_SYMBOLS = [ ]; Cu.import("resource:///modules/devtools/gcli.jsm"); diff --git a/browser/devtools/commandline/CmdJsb.jsm b/browser/devtools/commandline/CmdJsb.jsm index f19c32f86edb..5a31f500fcb1 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"); -let EXPORTED_SYMBOLS = [ ]; +this.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 54a055798ff3..e65d2bcd75f4 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; -let EXPORTED_SYMBOLS = [ ]; +this.EXPORTED_SYMBOLS = [ ]; Cu.import("resource:///modules/devtools/gcli.jsm"); diff --git a/browser/devtools/commandline/CmdRestart.jsm b/browser/devtools/commandline/CmdRestart.jsm index ea8e343a9516..d196fdbd3e5c 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; -let EXPORTED_SYMBOLS = [ ]; +this.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 7a65a3b5b8d5..1c164a51b55b 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; -let EXPORTED_SYMBOLS = [ ]; +this.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 c96aa26a69da..c1ca7dd0ffac 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/. */ -let EXPORTED_SYMBOLS = [ ]; +this.EXPORTED_SYMBOLS = [ ]; const Cu = Components.utils; diff --git a/browser/devtools/commandline/gcli.jsm b/browser/devtools/commandline/gcli.jsm index b222e7ba9227..b3bde36bdb6f 100644 --- a/browser/devtools/commandline/gcli.jsm +++ b/browser/devtools/commandline/gcli.jsm @@ -24,7 +24,7 @@ * For more information, ask Joe Walker */ -var EXPORTED_SYMBOLS = [ "gcli" ]; +this.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 -const gcli = require('gcli/index'); +this.gcli = require('gcli/index'); diff --git a/browser/devtools/commandline/test/helpers.js b/browser/devtools/commandline/test/helpers.js index 4f477e052922..7537a88254d8 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. */ -var EXPORTED_SYMBOLS = [ 'helpers' ]; +this.EXPORTED_SYMBOLS = [ 'helpers' ]; var test = { }; @@ -503,7 +503,7 @@ DeveloperToolbarTest.closeAllTabs = function() { /////////////////////////////////////////////////////////////////////////////// -var helpers = {}; +this.helpers = {}; var assert = { ok: ok, is: is, log: info }; diff --git a/browser/devtools/debugger/DebuggerUI.jsm b/browser/devtools/debugger/DebuggerUI.jsm index a6159fc77c2a..bcc4df734cb7 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"); -let EXPORTED_SYMBOLS = ["DebuggerUI"]; +this.EXPORTED_SYMBOLS = ["DebuggerUI"]; /** * Provides a simple mechanism of managing debugger instances. @@ -33,10 +33,10 @@ let EXPORTED_SYMBOLS = ["DebuggerUI"]; * @param nsIDOMWindow aWindow * The chrome window for which the DebuggerUI instance is created. */ -function DebuggerUI(aWindow) { +this.DebuggerUI = 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 1e4dbf33367a..c352c96cb285 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; -let EXPORTED_SYMBOLS = [ ]; +this.EXPORTED_SYMBOLS = [ ]; Cu.import("resource:///modules/devtools/gcli.jsm"); diff --git a/browser/devtools/highlighter/highlighter.jsm b/browser/devtools/highlighter/highlighter.jsm index 95228bb65b40..e94d41bfa557 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"); -var EXPORTED_SYMBOLS = ["Highlighter"]; +this.EXPORTED_SYMBOLS = ["Highlighter"]; const INSPECTOR_INVISIBLE_ELEMENTS = { "head": true, @@ -113,7 +113,7 @@ const PSEUDO_CLASSES = [":hover", ":active", ":focus"]; * * @param object aWindow */ -function Highlighter(aWindow) +this.Highlighter = 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 02de2ac5a293..2ffbaf77cec5 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; -var EXPORTED_SYMBOLS = ["InspectorUI"]; +this.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. */ -function InspectorUI(aWindow) +this.InspectorUI = 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 5ccba0d2490a..60362d5925e6 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. */ -var EXPORTED_SYMBOLS = [ 'helpers' ]; +this.EXPORTED_SYMBOLS = [ 'helpers' ]; var test = { }; @@ -496,7 +496,7 @@ DeveloperToolbarTest.closeAllTabs = function() { /////////////////////////////////////////////////////////////////////////////// -var helpers = {}; +this.helpers = {}; helpers._display = undefined; diff --git a/browser/devtools/layoutview/LayoutView.jsm b/browser/devtools/layoutview/LayoutView.jsm index 600cff785496..b07d411acff0 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"); -var EXPORTED_SYMBOLS = ["LayoutView"]; +this.EXPORTED_SYMBOLS = ["LayoutView"]; -function LayoutView(aOptions) +this.LayoutView = 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 f52d2fd0eb45..a45b7b63510b 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; -var EXPORTED_SYMBOLS = ["MarkupView"]; +this.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. */ -function MarkupView(aInspector, aFrame) +this.MarkupView = 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 2ac6250032a3..1303136c296f 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; -let EXPORTED_SYMBOLS = [ ]; +this.EXPORTED_SYMBOLS = [ ]; Cu.import("resource:///modules/devtools/gcli.jsm"); diff --git a/browser/devtools/responsivedesign/responsivedesign.jsm b/browser/devtools/responsivedesign/responsivedesign.jsm index a32aa46c0887..ed3e50b5857b 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"); -var EXPORTED_SYMBOLS = ["ResponsiveUIManager"]; +this.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; -let ResponsiveUIManager = { +this.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 5ccba0d2490a..60362d5925e6 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. */ -var EXPORTED_SYMBOLS = [ 'helpers' ]; +this.EXPORTED_SYMBOLS = [ 'helpers' ]; var test = { }; @@ -496,7 +496,7 @@ DeveloperToolbarTest.closeAllTabs = function() { /////////////////////////////////////////////////////////////////////////////// -var helpers = {}; +this.helpers = {}; helpers._display = undefined; diff --git a/browser/devtools/scratchpad/scratchpad-manager.jsm b/browser/devtools/scratchpad/scratchpad-manager.jsm index 94e073efcfa7..a54685d2360f 100644 --- a/browser/devtools/scratchpad/scratchpad-manager.jsm +++ b/browser/devtools/scratchpad/scratchpad-manager.jsm @@ -5,7 +5,7 @@ "use strict"; -var EXPORTED_SYMBOLS = ["ScratchpadManager"]; +this.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. */ -var ScratchpadManager = { +this.ScratchpadManager = { _nextUid: 1, _scratchpads: [], diff --git a/browser/devtools/shared/Browser.jsm b/browser/devtools/shared/Browser.jsm index a4a955074ead..8ae927c2b03c 100644 --- a/browser/devtools/shared/Browser.jsm +++ b/browser/devtools/shared/Browser.jsm @@ -11,14 +11,14 @@ * forwards to dump(); */ -const EXPORTED_SYMBOLS = [ "Node", "HTMLElement", "setTimeout", "clearTimeout" ]; +this.EXPORTED_SYMBOLS = [ "Node", "HTMLElement", "setTimeout", "clearTimeout" ]; /** * Expose Node/HTMLElement objects. This allows us to use the Node constants * without resorting to hardcoded numbers */ -const Node = Components.interfaces.nsIDOMNode; -const HTMLElement = Components.interfaces.nsIDOMHTMLElement; +this.Node = Components.interfaces.nsIDOMNode; +this.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. */ -const setTimeout = function setTimeout(callback, delay) { +this.setTimeout = function setTimeout(callback, delay) { const timer = Components.classes["@mozilla.org/timer;1"] .createInstance(Components.interfaces.nsITimer); @@ -83,7 +83,7 @@ const setTimeout = function setTimeout(callback, delay) { * @param timerID the ID of the timeout you wish to clear, as returned by * window.setTimeout(). */ -const clearTimeout = function clearTimeout(timerID) { +this.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 489db50bef7c..49a6d0b6fd5a 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/. */ -const EXPORTED_SYMBOLS = ["DOMHelpers"]; +this.EXPORTED_SYMBOLS = ["DOMHelpers"]; /** * DOMHelpers @@ -12,7 +12,7 @@ const EXPORTED_SYMBOLS = ["DOMHelpers"]; * @param nsIDOMWindow aWindow * The content window, owning the document to traverse. */ -function DOMHelpers(aWindow) { +this.DOMHelpers = function DOMHelpers(aWindow) { this.window = aWindow; }; diff --git a/browser/devtools/shared/DeveloperToolbar.jsm b/browser/devtools/shared/DeveloperToolbar.jsm index c70f1c751b0a..e98e158cf26a 100644 --- a/browser/devtools/shared/DeveloperToolbar.jsm +++ b/browser/devtools/shared/DeveloperToolbar.jsm @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = [ "DeveloperToolbar" ]; +this.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: */ -function DeveloperToolbar(aChromeWindow, aToolbarElement) +this.DeveloperToolbar = function DeveloperToolbar(aChromeWindow, aToolbarElement) { this._chromeWindow = aChromeWindow; diff --git a/browser/devtools/shared/EventEmitter.jsm b/browser/devtools/shared/EventEmitter.jsm index dafa50c9a748..d70324fc5700 100644 --- a/browser/devtools/shared/EventEmitter.jsm +++ b/browser/devtools/shared/EventEmitter.jsm @@ -1,6 +1,8 @@ -var EXPORTED_SYMBOLS = ["EventEmitter"]; +// XXXkhuey this should have a license header. -function EventEmitter() { +this.EXPORTED_SYMBOLS = ["EventEmitter"]; + +this.EventEmitter = function EventEmitter() { } EventEmitter.prototype = { diff --git a/browser/devtools/shared/FloatingScrollbars.jsm b/browser/devtools/shared/FloatingScrollbars.jsm index 3ed738c88f34..a47a784bdd40 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; -const EXPORTED_SYMBOLS = [ "switchToFloatingScrollbars", "switchToNativeScrollbars" ]; +this.EXPORTED_SYMBOLS = [ "switchToFloatingScrollbars", "switchToNativeScrollbars" ]; Cu.import("resource://gre/modules/Services.jsm"); @@ -20,7 +20,7 @@ let trackedTabs = new WeakMap(); * @param aTab the targeted tab. * */ -function switchToFloatingScrollbars(aTab) { +this.switchToFloatingScrollbars = function switchToFloatingScrollbars(aTab) { let mgr = trackedTabs.get(aTab); if (!mgr) { mgr = new ScrollbarManager(aTab); @@ -34,7 +34,7 @@ function switchToFloatingScrollbars(aTab) { * @param aTab the targeted tab. * */ -function switchToNativeScrollbars(aTab) { +this.switchToNativeScrollbars = 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 325cc36e0edc..4171d57468f4 100644 --- a/browser/devtools/shared/Jsbeautify.jsm +++ b/browser/devtools/shared/Jsbeautify.jsm @@ -56,9 +56,9 @@ */ -let EXPORTED_SYMBOLS = ["js_beautify"]; +this.EXPORTED_SYMBOLS = ["js_beautify"]; -function js_beautify(js_source_text, options) { +this.js_beautify = 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 998a26683862..64dd465478e1 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"); }); -var EXPORTED_SYMBOLS = ["LayoutHelpers"]; +this.EXPORTED_SYMBOLS = ["LayoutHelpers"]; -LayoutHelpers = { +this.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 6bce85dd4cf6..214ce0d5672e 100644 --- a/browser/devtools/shared/SplitView.jsm +++ b/browser/devtools/shared/SplitView.jsm @@ -5,7 +5,7 @@ "use strict"; -const EXPORTED_SYMBOLS = ["SplitView"]; +this.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 */ -function SplitView(aRoot) +this.SplitView = 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 8779c8bba6c4..c0c9af265422 100644 --- a/browser/devtools/shared/Templater.jsm +++ b/browser/devtools/shared/Templater.jsm @@ -15,7 +15,7 @@ */ -var EXPORTED_SYMBOLS = [ "Templater", "template" ]; +this.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 */ -function template(node, data, options) { +this.template = function template(node, data, options) { var template = new Templater(options || {}); template.processNode(node, data); return template; @@ -54,7 +54,7 @@ function template(node, data, options) { * Construct a Templater object. Use template() in preference to this ctor. * @deprecated Use template(node, data, options); */ -function Templater(options) { +this.Templater = function Templater(options) { if (options == null) { options = { allowEval: true }; } diff --git a/browser/devtools/shared/Undo.jsm b/browser/devtools/shared/Undo.jsm index 3e91ae14361c..5312d6249f21 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; -var EXPORTED_SYMBOLS=["UndoStack"]; +this.EXPORTED_SYMBOLS = ["UndoStack"]; /** * A simple undo stack manager. @@ -19,7 +19,7 @@ var EXPORTED_SYMBOLS=["UndoStack"]; * @param integer aMaxUndo Maximum number of undo steps. * defaults to 50. */ -function UndoStack(aMaxUndo) +this.UndoStack = 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 5ccba0d2490a..60362d5925e6 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. */ -var EXPORTED_SYMBOLS = [ 'helpers' ]; +this.EXPORTED_SYMBOLS = [ 'helpers' ]; var test = { }; @@ -496,7 +496,7 @@ DeveloperToolbarTest.closeAllTabs = function() { /////////////////////////////////////////////////////////////////////////////// -var helpers = {}; +this.helpers = {}; helpers._display = undefined; diff --git a/browser/devtools/sourceeditor/source-editor-orion.jsm b/browser/devtools/sourceeditor/source-editor-orion.jsm index d67dda9b3c60..b9dd7fa4a4c4 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" || }); } -var EXPORTED_SYMBOLS = ["SourceEditor"]; +this.EXPORTED_SYMBOLS = ["SourceEditor"]; /** * The SourceEditor object constructor. The SourceEditor component allows you to @@ -151,7 +151,7 @@ var EXPORTED_SYMBOLS = ["SourceEditor"]; * * @constructor */ -function SourceEditor() { +this.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 c0d4e52cdfc0..8b74d16238f0 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"); -var EXPORTED_SYMBOLS = ["SourceEditorUI"]; +this.EXPORTED_SYMBOLS = ["SourceEditorUI"]; /** * The Source Editor component user interface. */ -function SourceEditorUI(aEditor) +this.SourceEditorUI = 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 def2cfb5a7a8..04622183f673 100644 --- a/browser/devtools/sourceeditor/source-editor.jsm +++ b/browser/devtools/sourceeditor/source-editor.jsm @@ -34,8 +34,8 @@ try { } // Export the SourceEditor. -var SourceEditor = obj.SourceEditor; -var EXPORTED_SYMBOLS = ["SourceEditor"]; +this.SourceEditor = obj.SourceEditor; +this.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 593afe94053c..0449ef489215 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; -let EXPORTED_SYMBOLS = [ ]; +this.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 a43a285d3bbe..685d039d2a05 100644 --- a/browser/devtools/styleeditor/StyleEditor.jsm +++ b/browser/devtools/styleeditor/StyleEditor.jsm @@ -5,7 +5,7 @@ "use strict"; -const EXPORTED_SYMBOLS = ["StyleEditor", "StyleEditorFlags", "StyleEditorManager"]; +this.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 */ -function StyleEditor(aDocument, aStyleSheet) +this.StyleEditor = function StyleEditor(aDocument, aStyleSheet) { assert(aDocument, "Argument 'aDocument' is required."); @@ -1143,7 +1143,7 @@ StyleEditor.prototype = { * * @see StyleEditor.setFlag */ -let StyleEditorFlags = { +this.StyleEditorFlags = { DISABLED: "disabled", ERROR: "error", IMPORTED: "imported", @@ -1282,7 +1282,7 @@ function setupBracketCompletion(aSourceEditor) * Manage the different editors instances. */ -function StyleEditorManager(aWindow) { +this.StyleEditorManager = 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 93d02f27cafd..ca9dccd9e2fe 100644 --- a/browser/devtools/styleeditor/StyleEditorChrome.jsm +++ b/browser/devtools/styleeditor/StyleEditorChrome.jsm @@ -5,7 +5,7 @@ "use strict"; -const EXPORTED_SYMBOLS = ["StyleEditorChrome"]; +this.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. */ -function StyleEditorChrome(aRoot, aContentWindow) +this.StyleEditorChrome = 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 96de0a5c9d5a..7ef4a10c6fec 100644 --- a/browser/devtools/styleeditor/StyleEditorUtil.jsm +++ b/browser/devtools/styleeditor/StyleEditorUtil.jsm @@ -5,11 +5,11 @@ "use strict"; -const EXPORTED_SYMBOLS = [ +this.EXPORTED_SYMBOLS = [ "_", "assert", - "attr", - "getCurrentBrowserTabContentWindow", + "attr", // XXXkhuey unused? + "getCurrentBrowserTabContentWindow", // XXXkhuey unused? "log", "text", "wire" @@ -35,7 +35,7 @@ const gStringBundle = Services.strings.createBundle(PROPERTIES_URL); * Optional arguments to format in the string. * @return string */ -function _(aName) +this._ = function _(aName) { if (arguments.length == 1) { @@ -53,7 +53,7 @@ function _(aName) * Optional message. * @return aExpression */ -function assert(aExpression, aMessage) +this.assert = function assert(aExpression, aMessage) { if (!!!(aExpression)) { let msg = aMessage ? "ASSERTION FAILURE:" + aMessage : "ASSERTION FAILURE"; @@ -76,7 +76,7 @@ function assert(aExpression, aMessage) * Text content of matching element or null if there were no element * matching aSelector. */ -function text(aRoot, aSelector, aText) +this.text = 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. */ -function log() +this.log = function log() { console.logStringMessage(Array.prototype.slice.call(arguments).join(" ")); } @@ -136,7 +136,7 @@ function log() * If aDescriptor is a function, the argument is equivalent to : * {events: {'click': aDescriptor}} */ -function wire(aRoot, aSelectorOrElement, aDescriptor) +this.wire = 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 5ccba0d2490a..60362d5925e6 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. */ -var EXPORTED_SYMBOLS = [ 'helpers' ]; +this.EXPORTED_SYMBOLS = [ 'helpers' ]; var test = { }; @@ -496,7 +496,7 @@ DeveloperToolbarTest.closeAllTabs = function() { /////////////////////////////////////////////////////////////////////////////// -var helpers = {}; +this.helpers = {}; helpers._display = undefined; diff --git a/browser/devtools/styleinspector/CssHtmlTree.jsm b/browser/devtools/styleinspector/CssHtmlTree.jsm index b74b8f291314..520a02eb10cb 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"); -var EXPORTED_SYMBOLS = ["CssHtmlTree", "PropertyView"]; +this.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 */ -function CssHtmlTree(aStyleInspector) +this.CssHtmlTree = 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. */ -function PropertyView(aTree, aName) +this.PropertyView = 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 fc146a2aaf65..9f9aa994c199 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"); -var EXPORTED_SYMBOLS = ["CssLogic", "CssSelector"]; +this.EXPORTED_SYMBOLS = ["CssLogic", "CssSelector"]; -function CssLogic() +this.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. */ -function CssSelector(aCssRule, aSelector) +this.CssSelector = 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 df0a9139bb3a..7114415d8d01 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"); -var EXPORTED_SYMBOLS = ["CssRuleView", - "_ElementStyle", - "editableItem", - "_editableField", - "_getInplaceEditorForSpan"]; +this.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. -var _ElementStyle = ElementStyle; +this._ElementStyle = ElementStyle; ElementStyle.prototype = { @@ -874,7 +874,7 @@ TextProperty.prototype = { * set of disabled properties. * @constructor */ -function CssRuleView(aDoc, aStore) +this.CssRuleView = 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. */ -function editableItem(aOptions, aCallback) +this.editableItem = function editableItem(aOptions, aCallback) { let trigger = aOptions.trigger || "click" let element = aOptions.element; @@ -1967,7 +1967,7 @@ function editableItem(aOptions, aCallback) element._editable = true; } -var _editableField = editableField; +this._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. */ -function _getInplaceEditorForSpan(aSpan) { return aSpan.inplaceEditor; }; +this._getInplaceEditorForSpan = 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 673d88afe5a1..0496c381de48 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. -var EXPORTED_SYMBOLS = []; +this.EXPORTED_SYMBOLS = []; /** * Lookup l10n string from a string bundle. diff --git a/browser/devtools/tilt/CmdTilt.jsm b/browser/devtools/tilt/CmdTilt.jsm index 0519656d87fd..ff6d84de1453 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/. */ -let EXPORTED_SYMBOLS = [ ]; +this.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 64f430adb17f..a32e80a39f38 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"); -let EXPORTED_SYMBOLS = ["Tilt"]; +this.EXPORTED_SYMBOLS = ["Tilt"]; /** * Object managing instances of the visualizer. @@ -56,7 +56,7 @@ let EXPORTED_SYMBOLS = ["Tilt"]; * @param {Window} aWindow * the chrome window used by each visualizer instance */ -function Tilt(aWindow) +this.Tilt = 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 76563983ed8c..41232dbef7ec 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"); -let EXPORTED_SYMBOLS = ["TiltGL"]; +this.EXPORTED_SYMBOLS = ["TiltGL"]; /** * Module containing thin wrappers around low-level WebGL functions. */ -let TiltGL = {}; +this.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 d00908aab0c6..0ce2a48c83d4 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"); -let EXPORTED_SYMBOLS = +this.EXPORTED_SYMBOLS = ["EPSILON", "TiltMath", "vec3", "mat3", "mat4", "quat4"]; /** @@ -17,7 +17,7 @@ let EXPORTED_SYMBOLS = * Inspired by glMatrix, version 0.9.6, (c) 2011 Brandon Jones. */ -const EPSILON = 0.01; +this.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. */ -let vec3 = { +this.vec3 = { /** * Creates a new instance of a vec3 using the Float32Array type. @@ -496,7 +496,7 @@ let vec3 = { /** * mat3 - 3x3 Matrix. */ -let mat3 = { +this.mat3 = { /** * Creates a new instance of a mat3 using the Float32Array array type. @@ -659,7 +659,7 @@ let mat3 = { /** * mat4 - 4x4 Matrix. */ -let mat4 = { +this.mat4 = { /** * Creates a new instance of a mat4 using the default Float32Array type. @@ -1627,7 +1627,7 @@ let mat4 = { /** * quat4 - Quaternion. */ -let quat4 = { +this.quat4 = { /** * Creates a new instance of a quat4 using the default Float32Array type. @@ -2116,7 +2116,7 @@ let quat4 = { /** * Various algebraic math functions required by the engine. */ -let TiltMath = { +this.TiltMath = { /** * Helper function, converts degrees to radians. diff --git a/browser/devtools/tilt/TiltUtils.jsm b/browser/devtools/tilt/TiltUtils.jsm index c142feb9e6b1..275dfe59976b 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"); -let EXPORTED_SYMBOLS = ["TiltUtils"]; +this.EXPORTED_SYMBOLS = ["TiltUtils"]; /** * Module containing various helper functions used throughout Tilt. */ -let TiltUtils = {}; +this.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 4218a5a085b4..05d678ad8545 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"); -let EXPORTED_SYMBOLS = ["TiltVisualizer"]; +this.EXPORTED_SYMBOLS = ["TiltVisualizer"]; /** * Initializes the visualization presenter and controller. @@ -70,7 +70,7 @@ let EXPORTED_SYMBOLS = ["TiltVisualizer"]; * {Function} onError: optional, function called if initialization failed * {Function} onLoad: optional, function called if initialization worked */ -function TiltVisualizer(aProperties) +this.TiltVisualizer = 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 7d8dabeb9aec..ef44d5ba9f4d 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"); -let EXPORTED_SYMBOLS = ["TiltVisualizerStyle"]; +this.EXPORTED_SYMBOLS = ["TiltVisualizerStyle"]; let rgba = TiltMath.hex2rgba; /** * Various colors and style settings used throughout Tilt. */ -let TiltVisualizerStyle = { +this.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 e410e080db59..d9fd6d859db0 100644 --- a/browser/devtools/webconsole/AutocompletePopup.jsm +++ b/browser/devtools/webconsole/AutocompletePopup.jsm @@ -20,7 +20,7 @@ XPCOMUtils.defineLazyGetter(this, "stringBundle", function () { }); -var EXPORTED_SYMBOLS = ["AutocompletePopup"]; +this.EXPORTED_SYMBOLS = ["AutocompletePopup"]; /** * Autocomplete popup UI implementation. @@ -29,7 +29,7 @@ var EXPORTED_SYMBOLS = ["AutocompletePopup"]; * @param nsIDOMDocument aDocument * The document you want the popup attached to. */ -function AutocompletePopup(aDocument) +this.AutocompletePopup = function AutocompletePopup(aDocument) { this._document = aDocument; diff --git a/browser/devtools/webconsole/HUDService.jsm b/browser/devtools/webconsole/HUDService.jsm index 8d9c5e12f511..5f901d74a713 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); -var EXPORTED_SYMBOLS = ["HUDService"]; +this.EXPORTED_SYMBOLS = ["HUDService"]; function LogFactory(aMessagePrefix) { diff --git a/browser/devtools/webconsole/NetworkPanel.jsm b/browser/devtools/webconsole/NetworkPanel.jsm index 9c5d26faf588..35e83391a57a 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); -var EXPORTED_SYMBOLS = ["NetworkPanel"]; +this.EXPORTED_SYMBOLS = ["NetworkPanel"]; /** * Creates a new NetworkPanel. @@ -37,7 +37,7 @@ var EXPORTED_SYMBOLS = ["NetworkPanel"]; * @param object aHttpActivity * HttpActivity to display in the panel. */ -function NetworkPanel(aParent, aHttpActivity) +this.NetworkPanel = 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 38c363646161..a04b5a885fff 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"); -var EXPORTED_SYMBOLS = ["PropertyPanel", "PropertyTreeView"]; +this.EXPORTED_SYMBOLS = ["PropertyPanel", "PropertyTreeView"]; /////////////////////////////////////////////////////////////////////////// //// PropertyTreeView. @@ -25,7 +25,7 @@ var EXPORTED_SYMBOLS = ["PropertyPanel", "PropertyTreeView"]; * interface properties, see the documentation: * https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsITreeView */ -var PropertyTreeView = function() { +this.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. */ -function PropertyPanel(aParent, aTitle, aObject, aButtons) +this.PropertyPanel = 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 623694bb7660..4373ad966d5b 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; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([Application]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([Application]); diff --git a/browser/modules/AboutHomeUtils.jsm b/browser/modules/AboutHomeUtils.jsm index 98d7e052e1da..08977441786e 100644 --- a/browser/modules/AboutHomeUtils.jsm +++ b/browser/modules/AboutHomeUtils.jsm @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = [ "AboutHomeUtils" ]; +this.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; -let AboutHomeUtils = new Object(); +this.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 fecd7d383e92..91662f23cf07 100644 --- a/browser/modules/BrowserNewTabPreloader.jsm +++ b/browser/modules/BrowserNewTabPreloader.jsm @@ -4,7 +4,7 @@ "use strict"; -let EXPORTED_SYMBOLS = ["BrowserNewTabPreloader"]; +this.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; -let BrowserNewTabPreloader = { +this.BrowserNewTabPreloader = { init: function Preloader_init() { Initializer.start(); }, diff --git a/browser/modules/NetworkPrioritizer.jsm b/browser/modules/NetworkPrioritizer.jsm index a656adf8ac04..027f4b8865cf 100644 --- a/browser/modules/NetworkPrioritizer.jsm +++ b/browser/modules/NetworkPrioritizer.jsm @@ -13,7 +13,7 @@ * Lowest (+10): Background tabs in background windows. */ -let EXPORTED_SYMBOLS = ["trackBrowserWindow"]; +this.EXPORTED_SYMBOLS = ["trackBrowserWindow"]; const Ci = Components.interfaces; @@ -39,7 +39,7 @@ let _windows = []; // Exported symbol -function trackBrowserWindow(aWindow) { +this.trackBrowserWindow = function trackBrowserWindow(aWindow) { WindowHelper.addWindow(aWindow); } diff --git a/browser/modules/NewTabUtils.jsm b/browser/modules/NewTabUtils.jsm index d1c1b0db669f..ea78faef425a 100644 --- a/browser/modules/NewTabUtils.jsm +++ b/browser/modules/NewTabUtils.jsm @@ -4,7 +4,7 @@ "use strict"; -let EXPORTED_SYMBOLS = ["NewTabUtils"]; +this.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. */ -let NewTabUtils = { +this.NewTabUtils = { _initialized: false, init: function NewTabUtils_init() { diff --git a/browser/modules/SignInToWebsite.jsm b/browser/modules/SignInToWebsite.jsm index f3716e9948b7..b1943ef8f7d5 100644 --- a/browser/modules/SignInToWebsite.jsm +++ b/browser/modules/SignInToWebsite.jsm @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = ["SignInToWebsiteUX"]; +this.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)); } -let SignInToWebsiteUX = { +this.SignInToWebsiteUX = { init: function SignInToWebsiteUX_init() { diff --git a/browser/modules/Social.jsm b/browser/modules/Social.jsm index ffec034e60e0..a82716e63d07 100644 --- a/browser/modules/Social.jsm +++ b/browser/modules/Social.jsm @@ -4,7 +4,7 @@ "use strict"; -let EXPORTED_SYMBOLS = ["Social"]; +this.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"); -let Social = { +this.Social = { lastEventReceived: 0, provider: null, _disabledForSafeMode: false, diff --git a/browser/modules/TelemetryTimestamps.jsm b/browser/modules/TelemetryTimestamps.jsm index 22a4edbcc53d..7a17b877078a 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/. */ -let EXPORTED_SYMBOLS = ["TelemetryTimestamps"]; +this.EXPORTED_SYMBOLS = ["TelemetryTimestamps"]; /** * This module's purpose is to collect timestamps for important @@ -15,7 +15,7 @@ let EXPORTED_SYMBOLS = ["TelemetryTimestamps"]; */ let timeStamps = {}; -let TelemetryTimestamps = { +this.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 65f29a01c6a6..b4f098e14e7f 100644 --- a/browser/modules/WindowsJumpLists.jsm +++ b/browser/modules/WindowsJumpLists.jsm @@ -35,7 +35,7 @@ const LIST_TYPE = { * Exports */ -let EXPORTED_SYMBOLS = [ +this.EXPORTED_SYMBOLS = [ "WinTaskbarJumpList", ]; @@ -157,7 +157,7 @@ var tasksCfg = [ ///////////////////////////////////////////////////////////////////////////// // Implementation -var WinTaskbarJumpList = +this.WinTaskbarJumpList = { _builder: null, _tasks: null, diff --git a/browser/modules/WindowsPreviewPerTab.jsm b/browser/modules/WindowsPreviewPerTab.jsm index 4e9ce2bf0b8e..ca4bbb53adf0 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. */ -var EXPORTED_SYMBOLS = ["AeroPeek"]; +this.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. */ -var AeroPeek = { +this.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 26c99b00b937..5153711e290f 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/. */ -let EXPORTED_SYMBOLS = ["OfflineAppCacheHelper"]; +this.EXPORTED_SYMBOLS = ["OfflineAppCacheHelper"]; const Cc = Components.classes; const Ci = Components.interfaces; -let OfflineAppCacheHelper = { +this.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 a00d4397db63..0d653df28bac 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"); -var EXPORTED_SYMBOLS = [ "OpenLocationLastURL" ]; +this.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); -function OpenLocationLastURL(aWindow) { +this.OpenLocationLastURL = function OpenLocationLastURL(aWindow) { this.window = aWindow; } diff --git a/browser/modules/webappsUI.jsm b/browser/modules/webappsUI.jsm index fb86cbfc20c0..b8305ce2c256 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/. */ -let EXPORTED_SYMBOLS = ["webappsUI"]; +this.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"); -let webappsUI = { +this.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 19ef9c9a20f3..f385c4cbe045 100644 --- a/browser/modules/webrtcUI.jsm +++ b/browser/modules/webrtcUI.jsm @@ -4,14 +4,14 @@ "use strict"; -let EXPORTED_SYMBOLS = ["webrtcUI"]; +this.EXPORTED_SYMBOLS = ["webrtcUI"]; const Cu = Components.utils; const Ci = Components.interfaces; Cu.import("resource://gre/modules/Services.jsm"); -let webrtcUI = { +this.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 599bfedb4293..efa15770bf9d 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 -var EXPORTED_SYMBOLS = ["CSPRep", "CSPSourceList", "CSPSource", "CSPHost", - "CSPdebug", "CSPViolationReportListener", "CSPLocalizer"]; +this.EXPORTED_SYMBOLS = ["CSPRep", "CSPSourceList", "CSPSource", "CSPHost", + "CSPdebug", "CSPViolationReportListener", "CSPLocalizer"]; var STRINGS_URI = "chrome://global/locale/security/csp.properties"; @@ -94,7 +94,7 @@ var gPrefObserver = { }, }; -function CSPdebug(aMsg) { +this.CSPdebug = 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. */ -function CSPRep() { +this.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 */ -function CSPSourceList() { +this.CSPSourceList = function CSPSourceList() { this._sources = []; this._permitAllSources = false; @@ -900,7 +900,7 @@ CSPSourceList.prototype = { /** * Class to model a source (scheme, host, port) */ -function CSPSource() { +this.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. */ -function CSPHost() { +this.CSPHost = function CSPHost() { this._segments = []; } @@ -1556,7 +1556,7 @@ CSPHost.prototype = { /** * Class that listens to violation report transmission and logs errors. */ -function CSPViolationReportListener(reportURI) { +this.CSPViolationReportListener = function CSPViolationReportListener(reportURI) { this._reportURI = reportURI; } @@ -1636,7 +1636,7 @@ function cspWarn(aCSPRep, aMessage) { ////////////////////////////////////////////////////////////////////// -CSPLocalizer = { +this.CSPLocalizer = { /** * Retrieve a localized string. * diff --git a/content/base/src/contentAreaDropListener.js b/content/base/src/contentAreaDropListener.js index 5a7ae4f63358..b101dfc62b83 100644 --- a/content/base/src/contentAreaDropListener.js +++ b/content/base/src/contentAreaDropListener.js @@ -151,4 +151,4 @@ ContentAreaDropListener.prototype = }; var components = [ContentAreaDropListener]; -const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/content/base/src/contentSecurityPolicy.js b/content/base/src/contentSecurityPolicy.js index 2d017fd73bef..7807d809f115 100644 --- a/content/base/src/contentSecurityPolicy.js +++ b/content/base/src/contentSecurityPolicy.js @@ -570,4 +570,4 @@ CSPReportRedirectSink.prototype = { } }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentSecurityPolicy]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentSecurityPolicy]); diff --git a/content/base/src/messageWakeupService.js b/content/base/src/messageWakeupService.js index ca68a5afd20f..73d7c2431452 100644 --- a/content/base/src/messageWakeupService.js +++ b/content/base/src/messageWakeupService.js @@ -92,5 +92,5 @@ MessageWakeupService.prototype = }; var components = [MessageWakeupService]; -const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/content/base/src/nsBadCertHandler.js b/content/base/src/nsBadCertHandler.js index e2224c6dd14a..28119e4c2e91 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}"), }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([BadCertHandler]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([BadCertHandler]); diff --git a/content/xslt/src/xslt/txEXSLTRegExFunctions.js b/content/xslt/src/xslt/txEXSLTRegExFunctions.js index afa421568f03..9aa60cc83142 100644 --- a/content/xslt/src/xslt/txEXSLTRegExFunctions.js +++ b/content/xslt/src/xslt/txEXSLTRegExFunctions.js @@ -66,4 +66,4 @@ txEXSLTRegExFunctions.prototype = { } } -var NSGetFactory = XPCOMUtils.generateNSGetFactory([txEXSLTRegExFunctions]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([txEXSLTRegExFunctions]); diff --git a/content/xtf/test/unit/xtfComponent.js b/content/xtf/test/unit/xtfComponent.js index e95d19c20638..5cb38c591897 100644 --- a/content/xtf/test/unit/xtfComponent.js +++ b/content/xtf/test/unit/xtfComponent.js @@ -152,4 +152,4 @@ FooElementFactory.prototype = /* */ -const NSGetFactory = XPCOMUtils.generateNSGetFactory([FooElementFactory]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([FooElementFactory]); diff --git a/dom/activities/src/ActivitiesService.jsm b/dom/activities/src/ActivitiesService.jsm index 90648a7d7a46..927485306a67 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"); -const EXPORTED_SYMBOLS = []; +this.EXPORTED_SYMBOLS = []; let idbGlobal = this; diff --git a/dom/activities/src/ActivityOptions.js b/dom/activities/src/ActivityOptions.js index cd5f4fdf32b3..6481266cb795 100644 --- a/dom/activities/src/ActivityOptions.js +++ b/dom/activities/src/ActivityOptions.js @@ -53,4 +53,4 @@ ActivityOptions.prototype = { }) } -const NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivityOptions]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivityOptions]); diff --git a/dom/activities/src/ActivityProxy.js b/dom/activities/src/ActivityProxy.js index 4d48fd1ce8ed..f38a99e4f1e1 100644 --- a/dom/activities/src/ActivityProxy.js +++ b/dom/activities/src/ActivityProxy.js @@ -100,4 +100,4 @@ ActivityProxy.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIActivityProxy]) } -const NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivityProxy]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivityProxy]); diff --git a/dom/activities/src/ActivityRequestHandler.js b/dom/activities/src/ActivityRequestHandler.js index 3688bd05d008..3bc1436249da 100644 --- a/dom/activities/src/ActivityRequestHandler.js +++ b/dom/activities/src/ActivityRequestHandler.js @@ -77,4 +77,4 @@ ActivityRequestHandler.prototype = { }) } -const NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivityRequestHandler]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivityRequestHandler]); diff --git a/dom/activities/src/ActivityWrapper.js b/dom/activities/src/ActivityWrapper.js index ee4b01bb851c..8cdc99846dfb 100644 --- a/dom/activities/src/ActivityWrapper.js +++ b/dom/activities/src/ActivityWrapper.js @@ -42,5 +42,5 @@ ActivityWrapper.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsISystemMessagesWrapper]) } -const NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivityWrapper]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ActivityWrapper]); diff --git a/dom/alarm/AlarmDB.jsm b/dom/alarm/AlarmDB.jsm index b4402707ba03..00938282d3a2 100644 --- a/dom/alarm/AlarmDB.jsm +++ b/dom/alarm/AlarmDB.jsm @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = ["AlarmDB"]; +this.EXPORTED_SYMBOLS = ["AlarmDB"]; /* static functions */ const DEBUG = false; @@ -23,7 +23,7 @@ const ALARMDB_NAME = "alarms"; const ALARMDB_VERSION = 1; const ALARMSTORE_NAME = "alarms"; -function AlarmDB(aGlobal) { +this.AlarmDB = function AlarmDB(aGlobal) { debug("AlarmDB()"); this._global = aGlobal; } diff --git a/dom/alarm/AlarmService.jsm b/dom/alarm/AlarmService.jsm index e94681efcaf4..3cf777e81c74 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"); -let EXPORTED_SYMBOLS = ["AlarmService"]; +this.EXPORTED_SYMBOLS = ["AlarmService"]; XPCOMUtils.defineLazyServiceGetter(this, "ppmm", "@mozilla.org/parentprocessmessagemanager;1", @@ -30,7 +30,7 @@ XPCOMUtils.defineLazyGetter(this, "messenger", function() { let myGlobal = this; -let AlarmService = { +this.AlarmService = { init: function init() { debug("init()"); diff --git a/dom/alarm/AlarmsManager.js b/dom/alarm/AlarmsManager.js index e4ad93ec509c..0fb7c75e30bd 100644 --- a/dom/alarm/AlarmsManager.js +++ b/dom/alarm/AlarmsManager.js @@ -171,4 +171,4 @@ AlarmsManager.prototype = { }, } -const NSGetFactory = XPCOMUtils.generateNSGetFactory([AlarmsManager]) +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AlarmsManager]) diff --git a/dom/apps/src/AppsService.js b/dom/apps/src/AppsService.js index 34a6782a8b19..2baacb1c2fe4 100644 --- a/dom/apps/src/AppsService.js +++ b/dom/apps/src/AppsService.js @@ -62,4 +62,4 @@ AppsService.prototype = { QueryInterface : XPCOMUtils.generateQI([Ci.nsIAppsService]) } -const NSGetFactory = XPCOMUtils.generateNSGetFactory([AppsService]) +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AppsService]) diff --git a/dom/apps/src/AppsServiceChild.jsm b/dom/apps/src/AppsServiceChild.jsm index e89a8a6cdbdc..950c83acfbe0 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. -let EXPORTED_SYMBOLS = ["DOMApplicationRegistry"]; +this.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"); } -let DOMApplicationRegistry = { +this.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 acb13c34b4e3..a8198a7ca922 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 -let EXPORTED_SYMBOLS = ["AppsUtils", "ManifestHelper"]; +this.EXPORTED_SYMBOLS = ["AppsUtils", "ManifestHelper"]; function debug(s) { //dump("-*- AppsUtils.jsm: " + s + "\n"); } -let AppsUtils = { +this.AppsUtils = { // Clones a app, without the manifest. cloneAppObject: function cloneAppObject(aApp) { return { @@ -240,7 +240,7 @@ let AppsUtils = { /** * Helper object to access manifest information with locale support */ -let ManifestHelper = function(aManifest, aOrigin) { +this.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 0d3b0c294677..3e9d38bbb836 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; -let EXPORTED_SYMBOLS = ["OfflineCacheInstaller"]; +this.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) { }); } -const OfflineCacheInstaller = { +this.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 a8acdecdd13a..4cb6181cf9c5 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"); -var EXPORTED_SYMBOLS = ["PermissionsInstaller", - "expandPermissions", - "PermissionsTable", - ]; +this.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 -const PermissionsTable = { "resource-lock": { +this.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 **/ -function expandPermissions(aPermName, aAccess) { +this.expandPermissions = 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; -} +}; -let PermissionsInstaller = { +this.PermissionsInstaller = { /** * Install permissisions or remove deprecated permissions upon re-install * @param object aApp @@ -453,4 +453,4 @@ let PermissionsInstaller = { } ); } -} +}; diff --git a/dom/apps/src/Webapps.js b/dom/apps/src/Webapps.js index f676040a51db..bcc78d588211 100644 --- a/dom/apps/src/Webapps.js +++ b/dom/apps/src/Webapps.js @@ -758,6 +758,6 @@ WebappsApplicationMgmt.prototype = { classDescription: "Webapps Application Mgmt"}) } -const NSGetFactory = XPCOMUtils.generateNSGetFactory([WebappsRegistry, - WebappsApplication, - DOMError]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WebappsRegistry, + WebappsApplication, + DOMError]); diff --git a/dom/apps/src/Webapps.jsm b/dom/apps/src/Webapps.jsm index ebbea8a4e125..155f41aa6917 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; -let EXPORTED_SYMBOLS = ["DOMApplicationRegistry"]; +this.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 -let DOMApplicationRegistry = { +this.DOMApplicationRegistry = { appsFile: null, webapps: { }, children: [ ], diff --git a/dom/base/ConsoleAPI.js b/dom/base/ConsoleAPI.js index 4a3f845beed5..77176cbdd3c3 100644 --- a/dom/base/ConsoleAPI.js +++ b/dom/base/ConsoleAPI.js @@ -485,4 +485,4 @@ ConsoleAPI.prototype = { } }; -let NSGetFactory = XPCOMUtils.generateNSGetFactory([ConsoleAPI]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ConsoleAPI]); diff --git a/dom/base/ConsoleAPIStorage.jsm b/dom/base/ConsoleAPIStorage.jsm index 7b6e02f57bbc..bbdee79ce8c3 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; -var EXPORTED_SYMBOLS = ["ConsoleAPIStorage"]; +this.EXPORTED_SYMBOLS = ["ConsoleAPIStorage"]; var _consoleStorage = {}; @@ -36,7 +36,7 @@ var _consoleStorage = {}; * // Clear the events for the given inner window ID. * ConsoleAPIStorage.clearEvents(innerWindowID); */ -var ConsoleAPIStorage = { +this.ConsoleAPIStorage = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]), diff --git a/dom/base/DOMRequestHelper.jsm b/dom/base/DOMRequestHelper.jsm index be2c3b43d8aa..79a9df4439f8 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; -let EXPORTED_SYMBOLS = ["DOMRequestIpcHelper"]; +this.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"); -function DOMRequestIpcHelper() { +this.DOMRequestIpcHelper = function DOMRequestIpcHelper() { } DOMRequestIpcHelper.prototype = { diff --git a/dom/base/IndexedDBHelper.jsm b/dom/base/IndexedDBHelper.jsm index 108ab45e6ce9..7feac95a112d 100644 --- a/dom/base/IndexedDBHelper.jsm +++ b/dom/base/IndexedDBHelper.jsm @@ -5,6 +5,7 @@ "use strict" let DEBUG = 0; +let debug; if (DEBUG) { debug = function (s) { dump("-*- IndexedDBHelper: " + s + "\n"); } } else { @@ -15,12 +16,12 @@ const Cu = Components.utils; const Cc = Components.classes; const Ci = Components.interfaces; -let EXPORTED_SYMBOLS = ["IndexedDBHelper"]; +this.EXPORTED_SYMBOLS = ["IndexedDBHelper"]; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); -function IndexedDBHelper() { } +this.IndexedDBHelper = function IndexedDBHelper() {} IndexedDBHelper.prototype = { diff --git a/dom/base/ObjectWrapper.jsm b/dom/base/ObjectWrapper.jsm index b3563a181e2d..7521c351371d 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; -const EXPORTED_SYMBOLS = ["ObjectWrapper"]; +this.EXPORTED_SYMBOLS = ["ObjectWrapper"]; // Makes sure that we expose correctly chrome JS objects to content. -let ObjectWrapper = { +this.ObjectWrapper = { getObjectKind: function objWrapper_getobjectkind(aObject) { if (!aObject) { return "null"; diff --git a/dom/base/SiteSpecificUserAgent.js b/dom/base/SiteSpecificUserAgent.js index b84dabc2acaa..b94acc5cc618 100644 --- a/dom/base/SiteSpecificUserAgent.js +++ b/dom/base/SiteSpecificUserAgent.js @@ -24,4 +24,4 @@ SiteSpecificUserAgent.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsISiteSpecificUserAgent]) }; -let NSGetFactory = XPCOMUtils.generateNSGetFactory([SiteSpecificUserAgent]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SiteSpecificUserAgent]); diff --git a/dom/browser-element/BrowserElementParent.js b/dom/browser-element/BrowserElementParent.js index 020707c93bb5..12c7a31f9b46 100644 --- a/dom/browser-element/BrowserElementParent.js +++ b/dom/browser-element/BrowserElementParent.js @@ -646,4 +646,4 @@ BrowserElementParent.prototype = { }, }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([BrowserElementParentFactory]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([BrowserElementParentFactory]); diff --git a/dom/browser-element/BrowserElementPromptService.jsm b/dom/browser-element/BrowserElementPromptService.jsm index 5883904b0bf9..8f66c4254148 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); -let EXPORTED_SYMBOLS = ["BrowserElementPromptService"]; +this.EXPORTED_SYMBOLS = ["BrowserElementPromptService"]; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); @@ -541,7 +541,7 @@ BrowserElementPromptFactory.prototype = { } }; -let BrowserElementPromptService = { +this.BrowserElementPromptService = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]), diff --git a/dom/contacts/ContactManager.js b/dom/contacts/ContactManager.js index 63520fe3ed11..89c521b8fece 100644 --- a/dom/contacts/ContactManager.js +++ b/dom/contacts/ContactManager.js @@ -601,5 +601,5 @@ ContactManager.prototype = { flags: nsIClassInfo.DOM_OBJECT}) } -const NSGetFactory = XPCOMUtils.generateNSGetFactory( +this.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 2d04a86ff93d..b00b3afca5e9 100644 --- a/dom/contacts/fallback/ContactDB.jsm +++ b/dom/contacts/fallback/ContactDB.jsm @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = ['ContactDB']; +this.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"; -function ContactDB(aGlobal) { +this.ContactDB = 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 20d7a112afb8..bc91a9935bad 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; -let EXPORTED_SYMBOLS = ["DOMContactManager"]; +this.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; -let DOMContactManager = { +this.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 79f78bb2309b..cf554217027d 100644 --- a/dom/encoding/test/file_stringencoding.jsm +++ b/dom/encoding/test/file_stringencoding.jsm @@ -1,6 +1,6 @@ -var EXPORTED_SYMBOLS = ['checkFromJSM']; +this.EXPORTED_SYMBOLS = ['checkFromJSM']; -function checkFromJSM(is_op) { +this.checkFromJSM = 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 5a56725e1988..e151609269b2 100644 --- a/dom/fm/DOMFMRadioChild.js +++ b/dom/fm/DOMFMRadioChild.js @@ -383,5 +383,5 @@ DOMFMRadioChild.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([DOMFMRadioChild]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DOMFMRadioChild]); diff --git a/dom/fm/DOMFMRadioParent.jsm b/dom/fm/DOMFMRadioParent.jsm index 78083028c098..6fca3a325ef1 100644 --- a/dom/fm/DOMFMRadioParent.jsm +++ b/dom/fm/DOMFMRadioParent.jsm @@ -60,9 +60,9 @@ XPCOMUtils.defineLazyServiceGetter(this, "gSettingsService", "@mozilla.org/settingsService;1", "nsISettingsService"); -let EXPORTED_SYMBOLS = ["DOMFMRadioParent"]; +this.EXPORTED_SYMBOLS = ["DOMFMRadioParent"]; -let DOMFMRadioParent = { +this.DOMFMRadioParent = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISettingsServiceCallback]), diff --git a/dom/identity/DOMIdentity.jsm b/dom/identity/DOMIdentity.jsm index 323f8442ad41..b2a1282fc037 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. -let EXPORTED_SYMBOLS = ["DOMIdentity"]; +this.EXPORTED_SYMBOLS = ["DOMIdentity"]; Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); @@ -123,7 +123,7 @@ RPWatchContext.prototype = { } }; -let DOMIdentity = { +this.DOMIdentity = { // nsIMessageListener receiveMessage: function DOMIdentity_receiveMessage(aMessage) { let msg = aMessage.json; diff --git a/dom/identity/nsDOMIdentity.js b/dom/identity/nsDOMIdentity.js index ddf891f76922..6bee460a1416 100644 --- a/dom/identity/nsDOMIdentity.js +++ b/dom/identity/nsDOMIdentity.js @@ -534,4 +534,4 @@ nsDOMIdentityInternal.prototype = { }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([nsDOMIdentityInternal]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsDOMIdentityInternal]); diff --git a/dom/identity/nsIDService.js b/dom/identity/nsIDService.js index d6d4bd648f6b..64137ef3b29f 100644 --- a/dom/identity/nsIDService.js +++ b/dom/identity/nsIDService.js @@ -31,4 +31,4 @@ IDService.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([IDService]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([IDService]); diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.js index d6b40c66b816..d89086d8824b 100644 --- a/dom/media/PeerConnection.js +++ b/dom/media/PeerConnection.js @@ -673,6 +673,6 @@ PeerConnectionObserver.prototype = { } }; -let NSGetFactory = XPCOMUtils.generateNSGetFactory( +this.NSGetFactory = XPCOMUtils.generateNSGetFactory( [IceCandidate, SessionDescription, PeerConnection] ); diff --git a/dom/messages/SystemMessageInternal.js b/dom/messages/SystemMessageInternal.js index aa942c63bea6..0a10bf3f4a76 100644 --- a/dom/messages/SystemMessageInternal.js +++ b/dom/messages/SystemMessageInternal.js @@ -361,4 +361,4 @@ SystemMessageInternal.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsISystemMessagesInternal, Ci.nsIObserver]) } -const NSGetFactory = XPCOMUtils.generateNSGetFactory([SystemMessageInternal]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SystemMessageInternal]); diff --git a/dom/messages/SystemMessageManager.js b/dom/messages/SystemMessageManager.js index 837d3ec86bc3..0015b797b249 100644 --- a/dom/messages/SystemMessageManager.js +++ b/dom/messages/SystemMessageManager.js @@ -217,4 +217,4 @@ SystemMessageManager.prototype = { classDescription: "System Messages"}) } -const NSGetFactory = XPCOMUtils.generateNSGetFactory([SystemMessageManager]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SystemMessageManager]); diff --git a/dom/mms/src/ril/MmsPduHelper.jsm b/dom/mms/src/ril/MmsPduHelper.jsm index fd7e69111ee7..3c388fe98ca2 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 -function translatePduErrorToStatus(error) { +this.translatePduErrorToStatus = 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 = */ -let BooleanValue = { +this.BooleanValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -76,7 +76,7 @@ let BooleanValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A section 8 */ -let Address = { +this.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 */ -let HeaderField = { +this.HeaderField = { /** * @param data * A wrapped object containing raw PDU data. @@ -224,7 +224,7 @@ let HeaderField = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.2 */ -let MmsHeader = { +this.MmsHeader = { /** * @param data * A wrapped object containing raw PDU data. @@ -300,7 +300,7 @@ let MmsHeader = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.9 */ -let ContentClassValue = { +this.ContentClassValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -345,7 +345,7 @@ let ContentClassValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.10 */ -let ContentLocationValue = { +this.ContentLocationValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -384,7 +384,7 @@ let ContentLocationValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.18 */ -let ElementDescriptorValue = { +this.ElementDescriptorValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -422,7 +422,7 @@ let ElementDescriptorValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.18 */ -let Parameter = { +this.Parameter = { /** * @param data * A wrapped object containing raw PDU data. @@ -532,7 +532,7 @@ let 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 */ -let EncodedStringValue = { +this.EncodedStringValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -670,7 +670,7 @@ let EncodedStringValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.20 */ -let ExpiryValue = { +this.ExpiryValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -743,7 +743,7 @@ let ExpiryValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.21 */ -let FromValue = { +this.FromValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -806,7 +806,7 @@ let FromValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.23 */ -let PreviouslySentByValue = { +this.PreviouslySentByValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -836,7 +836,7 @@ let 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 */ -let PreviouslySentDateValue = { +this.PreviouslySentDateValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -870,7 +870,7 @@ let PreviouslySentDateValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.27 */ -let MessageClassValue = { +this.MessageClassValue = { WELL_KNOWN_CLASSES: ["personal", "advertisement", "informational", "auto"], /** @@ -926,7 +926,7 @@ let MessageClassValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.30 */ -let MessageTypeValue = { +this.MessageTypeValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -969,7 +969,7 @@ let MessageTypeValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.32 */ -let MmFlagsValue = { +this.MmFlagsValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1032,7 +1032,7 @@ let MmFlagsValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.33 */ -let MmStateValue = { +this.MmStateValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1075,7 +1075,7 @@ let MmStateValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.35 */ -let PriorityValue = { +this.PriorityValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1114,7 +1114,7 @@ let PriorityValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.39 */ -let RecommendedRetrievalModeValue = { +this.RecommendedRetrievalModeValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1136,7 +1136,7 @@ let RecommendedRetrievalModeValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.43 */ -let ReplyChargingValue = { +this.ReplyChargingValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1180,7 +1180,7 @@ let ReplyChargingValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.49 */ -let ResponseText = { +this.ResponseText = { /** * @param data * A wrapped object containing raw PDU data. @@ -1232,7 +1232,7 @@ let ResponseText = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.50 */ -let RetrieveStatusValue = { +this.RetrieveStatusValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1270,7 +1270,7 @@ let RetrieveStatusValue = { * * @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.54 */ -let StatusValue = { +this.StatusValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1305,7 +1305,7 @@ let StatusValue = { }, }; -let PduHelper = { +this.PduHelper = { /** * @param data * A wrapped object containing raw PDU data. @@ -1695,7 +1695,7 @@ if (DEBUG) { debug = function (s) {}; } -const EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS.concat([ +this.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 84f07f40dd18..31fd26fcc10d 100644 --- a/dom/mms/src/ril/MmsService.js +++ b/dom/mms/src/ril/MmsService.js @@ -591,7 +591,7 @@ MmsService.prototype = { }, }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([MmsService]); +this.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 889db31ec8df..284d48203ab2 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"); +Cu.import("resource://gre/modules/WspPduHelper.jsm", this); const DEBUG = false; // set to true to see debug messages /** * Helpers for WAP PDU processing. */ -let WapPushManager = { +this.WapPushManager = { /** * Parse raw PDU data and deliver to a proper target. @@ -86,7 +86,7 @@ if (DEBUG) { debug = function (s) {}; } -const EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS.concat([ +this.EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS.concat([ "WapPushManager", ]); diff --git a/dom/mms/src/ril/WspPduHelper.jsm b/dom/mms/src/ril/WspPduHelper.jsm index 18fb69f6f5a9..60f9c1e212b4 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"); +Cu.import("resource://gre/modules/wap_consts.js", this); let DEBUG; // set to true to see debug messages @@ -26,7 +26,7 @@ const ASCIIS = 128; /** * Error class for generic encoding/decoding failures. */ -function CodeError(message) { +this.CodeError = 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. */ -function FatalCodeError(message) { +this.FatalCodeError = 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. */ -function NotWellKnownEncodingError(message) { +this.NotWellKnownEncodingError = 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. */ -function ensureHeader(headers, name) { +this.ensureHeader = function ensureHeader(headers, name) { let value = headers[name]; // Header field might have a null value as NoValue if (value === undefined) { @@ -130,7 +130,7 @@ function ensureHeader(headers, name) { * * @see WAP-230-WSP-20010705-a clause 8.4.1.2 */ -function skipValue(data) { +this.skipValue = function skipValue(data) { let begin = data.offset; let value = Octet.decode(data); if (value <= 31) { @@ -165,7 +165,7 @@ function skipValue(data) { * * @return Decoded value. */ -function decodeAlternatives(data, options) { +this.decodeAlternatives = function decodeAlternatives(data, options) { let begin = data.offset; for (let i = 2; i < arguments.length; i++) { try { @@ -191,7 +191,7 @@ function decodeAlternatives(data, options) { * @param options * Extra context for encoding. */ -function encodeAlternatives(data, value, options) { +this.encodeAlternatives = function encodeAlternatives(data, value, options) { let begin = data.offset; for (let i = 3; i < arguments.length; i++) { try { @@ -208,7 +208,7 @@ function encodeAlternatives(data, value, options) { } } -let Octet = { +this.Octet = { /** * @param data * A wrapped object containing raw PDU data. @@ -315,7 +315,7 @@ let Octet = { * * @see RFC 2616 clause 2.2 Basic Rules */ -let Text = { +this.Text = { /** * @param data * A wrapped object containing raw PDU data. @@ -399,7 +399,7 @@ let Text = { }, }; -let NullTerminatedTexts = { +this.NullTerminatedTexts = { /** * Decode internal referenced null terminated text string. * @@ -443,7 +443,7 @@ let NullTerminatedTexts = { * * @see RFC 2616 clause 2.2 Basic Rules */ -let Token = { +this.Token = { /** * @param data * A wrapped object containing raw PDU data. @@ -519,7 +519,7 @@ let Token = { * * @see RFC 2396 Uniform Resource Indentifiers (URI) */ -let URIC = { +this.URIC = { /** * @param data * A wrapped object containing raw PDU data. @@ -555,7 +555,7 @@ let URIC = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.1 */ -let TextString = { +this.TextString = { /** * @param data * A wrapped object containing raw PDU data. @@ -611,7 +611,7 @@ let TextString = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.1 */ -let TokenText = { +this.TokenText = { /** * @param data * A wrapped object containing raw PDU data. @@ -654,7 +654,7 @@ let TokenText = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.1 */ -let QuotedString = { +this.QuotedString = { /** * @param data * A wrapped object containing raw PDU data. @@ -693,7 +693,7 @@ let QuotedString = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.1 */ -let ShortInteger = { +this.ShortInteger = { /** * @param data * A wrapped object containing raw PDU data. @@ -739,7 +739,7 @@ let ShortInteger = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.1 */ -let LongInteger = { +this.LongInteger = { /** * @param data * A wrapped object containing raw PDU data. @@ -821,7 +821,7 @@ let LongInteger = { /** * @see WAP-230-WSP-20010705-a clause 8.4.2.1 */ -let UintVar = { +this.UintVar = { /** * @param data * A wrapped object containing raw PDU data. @@ -874,7 +874,7 @@ let UintVar = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.1 */ -let ConstrainedEncoding = { +this.ConstrainedEncoding = { /** * @param data * A wrapped object containing raw PDU data. @@ -908,7 +908,7 @@ let ConstrainedEncoding = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.2 */ -let ValueLength = { +this.ValueLength = { /** * @param data * A wrapped object containing raw PDU data. @@ -950,7 +950,7 @@ let ValueLength = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.3 */ -let NoValue = { +this.NoValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -981,7 +981,7 @@ let NoValue = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.3 */ -let TextValue = { +this.TextValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1008,7 +1008,7 @@ let TextValue = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.3 */ -let IntegerValue = { +this.IntegerValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1044,7 +1044,7 @@ let IntegerValue = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.3 */ -let DateValue = { +this.DateValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1087,7 +1087,7 @@ let DateValue = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.3 */ -let DeltaSecondsValue = IntegerValue; +this.DeltaSecondsValue = IntegerValue; /** * Quality factor 0 and quality factors with one or two decimal digits are @@ -1097,7 +1097,7 @@ let DeltaSecondsValue = IntegerValue; * * @see WAP-230-WSP-20010705-a clause 8.4.2.3 */ -let QValue = { +this.QValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1153,7 +1153,7 @@ let QValue = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.3 */ -let VersionValue = { +this.VersionValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1218,7 +1218,7 @@ let VersionValue = { * @see WAP-230-WSP-20010705-a clause 8.4.2.3 * @see RFC 2616 clause 2.2 Basic Rules */ -let UriValue = { +this.UriValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1245,7 +1245,7 @@ let UriValue = { * * @see WAP-230-WSP-20010705-a table 38 */ -let TypeValue = { +this.TypeValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1306,7 +1306,7 @@ let TypeValue = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.4 */ -let Parameter = { +this.Parameter = { /** * @param data * A wrapped object containing raw PDU data. @@ -1500,7 +1500,7 @@ let Parameter = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.6 */ -let Header = { +this.Header = { /** * @param data * A wrapped object containing raw PDU data. @@ -1551,7 +1551,7 @@ let Header = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.6 */ -let WellKnownHeader = { +this.WellKnownHeader = { /** * @param data * A wrapped object containing raw PDU data. @@ -1617,7 +1617,7 @@ let WellKnownHeader = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.6 */ -let ApplicationHeader = { +this.ApplicationHeader = { /** * @param data * A wrapped object containing raw PDU data. @@ -1674,7 +1674,7 @@ let ApplicationHeader = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.6 */ -let FieldName = { +this.FieldName = { /** * @param data * A wrapped object containing raw PDU data. @@ -1726,7 +1726,7 @@ let FieldName = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.8 */ -let AcceptCharsetValue = { +this.AcceptCharsetValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -1841,7 +1841,7 @@ let AcceptCharsetValue = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.8 */ -let WellKnownCharset = { +this.WellKnownCharset = { /** * @param data * A wrapped object containing raw PDU data. @@ -1915,7 +1915,7 @@ let WellKnownCharset = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.24 */ -let ContentTypeValue = { +this.ContentTypeValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -2103,7 +2103,7 @@ let ContentTypeValue = { * * @see WAP-230-WSP-20010705-a clause 8.4.2.54 */ -let ApplicationIdValue = { +this.ApplicationIdValue = { /** * @param data * A wrapped object containing raw PDU data. @@ -2139,7 +2139,7 @@ let ApplicationIdValue = { }, }; -let PduHelper = { +this.PduHelper = { /** * Parse multiple header fields with end mark. * @@ -2380,7 +2380,7 @@ let PduHelper = { // Deprecated items should only be supported for backward compatibility // purpose. // @see WAP-230-WSP-20010705-a Appendix A. Assigned Numbers. -const WSP_HEADER_FIELDS = (function () { +this.WSP_HEADER_FIELDS = (function () { let names = {}; function add(name, number, coder) { let entry = { @@ -2476,7 +2476,7 @@ const WSP_HEADER_FIELDS = (function () { // WSP Content Type Assignments // @see http://www.wapforum.org/wina -const WSP_WELL_KNOWN_CONTENT_TYPES = (function () { +this.WSP_WELL_KNOWN_CONTENT_TYPES = (function () { let types = {}; function add(type, number) { @@ -2504,7 +2504,7 @@ const 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. -const WSP_WELL_KNOWN_PARAMS = (function () { +this.WSP_WELL_KNOWN_PARAMS = (function () { let params = {}; function add(name, number, coder) { @@ -2559,7 +2559,7 @@ const 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 -const WSP_WELL_KNOWN_CHARSETS = (function () { +this.WSP_WELL_KNOWN_CHARSETS = (function () { let charsets = {}; function add(name, number, converter) { @@ -2582,7 +2582,7 @@ const WSP_WELL_KNOWN_CHARSETS = (function () { // OMNA PUSH Application ID // @see http://www.openmobilealliance.org/tech/omna/omna-push-app-id.aspx -const OMNA_PUSH_APPLICATION_IDS = (function () { +this.OMNA_PUSH_APPLICATION_IDS = (function () { let ids = {}; function add(urn, number) { @@ -2608,7 +2608,7 @@ if (DEBUG) { debug = function (s) {}; } -const EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS.concat([ +this.EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS.concat([ // Constant values "WSP_HEADER_FIELDS", "WSP_WELL_KNOWN_CONTENT_TYPES", @@ -2663,4 +2663,3 @@ const 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 1ee179e8b413..6f2d2937fb01 100644 --- a/dom/mms/src/ril/mms_consts.js +++ b/dom/mms/src/ril/mms_consts.js @@ -4,98 +4,99 @@ // Encoded X-Mms-Message-Type values // @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.30 -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; +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; // MMS version 1.3 // @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.34 -const MMS_VERSION = (0x01 << 4) | 0x03; +this.MMS_VERSION = (0x01 << 4) | 0x03; // Common Status Values -const MMS_PDU_ERROR_OK = 128; -const MMS_PDU_ERROR_TRANSIENT_FAILURE = 192; -const MMS_PDU_ERROR_PERMANENT_FAILURE = 224; +this.MMS_PDU_ERROR_OK = 128; +this.MMS_PDU_ERROR_TRANSIENT_FAILURE = 192; +this.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 -//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; +//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; // 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 -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; +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; // 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 -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; +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; // X-Mms-Status values // @see OMA-TS-MMS_ENC-V1_3-20110913-A clause 7.3.54 -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.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 ALL_CONST_SYMBOLS = Object.keys(this); +this.ALL_CONST_SYMBOLS = undefined; // We want ALL_CONST_SYMBOLS to be exported. +this.ALL_CONST_SYMBOLS = Object.keys(this); // Allow this file to be imported via Components.utils.import(). -const EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS; +this.EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS; diff --git a/dom/mms/src/ril/wap_consts.js b/dom/mms/src/ril/wap_consts.js index 322d0f370e5b..c376d9fb668a 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. -const WSP_PDU_TYPE_PUSH = 0x06; +this.WSP_PDU_TYPE_PUSH = 0x06; // Registered WDP Port Numbers // @see WAP-259-WDP-20010614-a Appendix B. Port Number Definitions. -const WDP_PORT_PUSH = 2948; +this.WDP_PORT_PUSH = 2948; // Bearer Type Assignments // @see WAP-259-WDP-20010614-a Appendix C. Network Bearer Table. -const WDP_BEARER_GSM_SMS_GSM_MSISDN = 0x03; +this.WDP_BEARER_GSM_SMS_GSM_MSISDN = 0x03; -const ALL_CONST_SYMBOLS = Object.keys(this); - -const EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS; +this.ALL_CONST_SYMBOLS = undefined; // We want ALL_CONST_SYMBOLS to be exported. +this.ALL_CONST_SYMBOLS = Object.keys(this); +this.EXPORTED_SYMBOLS = ALL_CONST_SYMBOLS; diff --git a/dom/network/src/NetworkStatsDB.jsm b/dom/network/src/NetworkStatsDB.jsm index bcfa70df7a4c..111732bbb3ce 100644 --- a/dom/network/src/NetworkStatsDB.jsm +++ b/dom/network/src/NetworkStatsDB.jsm @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = ['NetworkStatsDB']; +this.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; -function NetworkStatsDB(aGlobal) { +this.NetworkStatsDB = function NetworkStatsDB(aGlobal) { if (DEBUG) { debug("Constructor"); } diff --git a/dom/network/src/NetworkStatsManager.js b/dom/network/src/NetworkStatsManager.js index 75d4a8788ca6..8266bc2bc12c 100644 --- a/dom/network/src/NetworkStatsManager.js +++ b/dom/network/src/NetworkStatsManager.js @@ -233,6 +233,6 @@ NetworkStatsManager.prototype = { flags: nsIClassInfo.DOM_OBJECT}) } -const NSGetFactory = XPCOMUtils.generateNSGetFactory([NetworkStatsData, - NetworkStats, - NetworkStatsManager]) +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([NetworkStatsData, + NetworkStats, + NetworkStatsManager]) diff --git a/dom/network/src/NetworkStatsService.jsm b/dom/network/src/NetworkStatsService.jsm index 4b3ef3071c20..f13a7effb710 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; -let EXPORTED_SYMBOLS = ["NetworkStatsService"]; +this.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; -let NetworkStatsService = { +this.NetworkStatsService = { init: function() { if (DEBUG) { debug("Service started"); diff --git a/dom/network/src/TCPSocket.js b/dom/network/src/TCPSocket.js index 74587bf5ef8f..b19cec9a4a61 100644 --- a/dom/network/src/TCPSocket.js +++ b/dom/network/src/TCPSocket.js @@ -634,4 +634,4 @@ SecurityCallbacks.prototype = { }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([TCPSocket]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TCPSocket]); diff --git a/dom/network/src/TCPSocketParentIntermediary.js b/dom/network/src/TCPSocketParentIntermediary.js index b70034abaf8d..1b1712ac8495 100644 --- a/dom/network/src/TCPSocketParentIntermediary.js +++ b/dom/network/src/TCPSocketParentIntermediary.js @@ -52,4 +52,4 @@ TCPSocketParentIntermediary.prototype = { ]) }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([TCPSocketParentIntermediary]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TCPSocketParentIntermediary]); diff --git a/dom/payment/Payment.js b/dom/payment/Payment.js index ba8da152837c..24ad05b6d16c 100644 --- a/dom/payment/Payment.js +++ b/dom/payment/Payment.js @@ -104,4 +104,4 @@ PaymentContentHelper.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([PaymentContentHelper]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PaymentContentHelper]); diff --git a/dom/payment/Payment.jsm b/dom/payment/Payment.jsm index 0b760fbc9cba..2f37b9c40981 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"); -let EXPORTED_SYMBOLS = []; +this.EXPORTED_SYMBOLS = []; const PAYMENT_IPC_MSG_NAMES = ["Payment:Pay", "Payment:Success", diff --git a/dom/payment/PaymentFlowInfo.js b/dom/payment/PaymentFlowInfo.js index 175edceccb9e..4596891addac 100644 --- a/dom/payment/PaymentFlowInfo.js +++ b/dom/payment/PaymentFlowInfo.js @@ -19,4 +19,4 @@ PaymentFlowInfo.prototype = { requestMethod: null }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([PaymentFlowInfo]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PaymentFlowInfo]); diff --git a/dom/payment/PaymentRequestInfo.js b/dom/payment/PaymentRequestInfo.js index acf99bf44030..e824839bb923 100644 --- a/dom/payment/PaymentRequestInfo.js +++ b/dom/payment/PaymentRequestInfo.js @@ -126,7 +126,7 @@ PaymentRequestRefundInfo.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([ +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ PaymentProductPrice, PaymentRequestInfo, PaymentRequestPaymentInfo, diff --git a/dom/permission/PermissionPromptHelper.jsm b/dom/permission/PermissionPromptHelper.jsm index 5fa7e95ee7f9..f7e343a924db 100644 --- a/dom/permission/PermissionPromptHelper.jsm +++ b/dom/permission/PermissionPromptHelper.jsm @@ -20,6 +20,7 @@ "use strict"; let DEBUG = 0; +let debug; if (DEBUG) debug = function (s) { dump("-*- Permission Prompt Helper component: " + s + "\n"); } else @@ -29,7 +30,7 @@ const Cu = Components.utils; const Cc = Components.classes; const Ci = Components.interfaces; -let EXPORTED_SYMBOLS = ["PermissionPromptHelper"]; +this.EXPORTED_SYMBOLS = ["PermissionPromptHelper"]; Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/Services.jsm"); @@ -47,7 +48,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); -let PermissionPromptHelper = { +this.PermissionPromptHelper = { init: function() { debug("Init"); ppmm.addMessageListener("PermissionPromptHelper:AskPermission", this); diff --git a/dom/permission/PermissionSettings.js b/dom/permission/PermissionSettings.js index 29a3d4f64db2..27239e8dc154 100644 --- a/dom/permission/PermissionSettings.js +++ b/dom/permission/PermissionSettings.js @@ -102,4 +102,4 @@ PermissionSettings.prototype = { flags: Ci.nsIClassInfo.DOM_OBJECT}) } -const NSGetFactory = XPCOMUtils.generateNSGetFactory([PermissionSettings]) +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PermissionSettings]) diff --git a/dom/permission/PermissionSettings.jsm b/dom/permission/PermissionSettings.jsm index 15c288b22c04..f62a9e795f90 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; -let EXPORTED_SYMBOLS = ["PermissionSettingsModule"]; +this.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"); -let PermissionSettingsModule = { +this.PermissionSettingsModule = { init: function() { debug("Init"); ppmm.addMessageListener("PermissionSettings:AddPermission", this); diff --git a/dom/settings/SettingsChangeNotifier.jsm b/dom/settings/SettingsChangeNotifier.jsm index 7062070279c3..c4b99de5b3cf 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; -let EXPORTED_SYMBOLS = ["SettingsChangeNotifier"]; +this.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"); -let SettingsChangeNotifier = { +this.SettingsChangeNotifier = { init: function() { debug("init"); this.children = []; diff --git a/dom/settings/SettingsDB.jsm b/dom/settings/SettingsDB.jsm index fd6f3b7e7c08..441b624d4c6e 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; -let EXPORTED_SYMBOLS = ["SettingsDB", "SETTINGSDB_NAME", "SETTINGSSTORE_NAME"]; +this.EXPORTED_SYMBOLS = ["SettingsDB", "SETTINGSDB_NAME", "SETTINGSSTORE_NAME"]; function debug(s) { //dump("-*- SettingsDB: " + s + "\n"); } -const SETTINGSDB_NAME = "settings"; -const SETTINGSDB_VERSION = 1; -const SETTINGSSTORE_NAME = "settings"; +this.SETTINGSDB_NAME = "settings"; +this.SETTINGSDB_VERSION = 1; +this.SETTINGSSTORE_NAME = "settings"; Cu.import("resource://gre/modules/IndexedDBHelper.jsm"); Cu.import("resource://gre/modules/FileUtils.jsm"); Cu.import("resource://gre/modules/NetUtil.jsm"); -function SettingsDB() {} +this.SettingsDB = function SettingsDB() {} SettingsDB.prototype = { diff --git a/dom/settings/SettingsManager.js b/dom/settings/SettingsManager.js index 797f1b08b3b2..081eee0bdc1f 100644 --- a/dom/settings/SettingsManager.js +++ b/dom/settings/SettingsManager.js @@ -365,4 +365,4 @@ SettingsManager.prototype = { flags: nsIClassInfo.DOM_OBJECT}) } -const NSGetFactory = XPCOMUtils.generateNSGetFactory([SettingsManager, SettingsLock]) +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SettingsManager, SettingsLock]) diff --git a/dom/settings/SettingsQueue.jsm b/dom/settings/SettingsQueue.jsm index 6f8bb9c791af..746d3370aaf7 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/. */ -let EXPORTED_SYMBOLS = ["Queue"]; +this.EXPORTED_SYMBOLS = ["Queue"]; -function Queue() { +this.Queue = function Queue() { this._queue = []; this._index = 0; } diff --git a/dom/settings/SettingsService.js b/dom/settings/SettingsService.js index 6eba91f08e48..ff23624188b2 100644 --- a/dom/settings/SettingsService.js +++ b/dom/settings/SettingsService.js @@ -6,6 +6,7 @@ /* static functions */ let DEBUG = 0; +let debug; if (DEBUG) debug = function (s) { dump("-*- SettingsService: " + s + "\n"); } else @@ -182,4 +183,4 @@ SettingsService.prototype = { QueryInterface : XPCOMUtils.generateQI([Ci.nsISettingsService]), } -const NSGetFactory = XPCOMUtils.generateNSGetFactory([SettingsService, SettingsServiceLock]) +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SettingsService, SettingsServiceLock]) diff --git a/dom/sms/src/ril/SmsDatabaseService.js b/dom/sms/src/ril/SmsDatabaseService.js index a52883b08e3d..ea76f211a3a5 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); }); -const NSGetFactory = XPCOMUtils.generateNSGetFactory([SmsDatabaseService]); +this.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 f89eee7a6ae4..09b3866b91d1 100644 --- a/dom/system/GPSDGeolocationProvider.js +++ b/dom/system/GPSDGeolocationProvider.js @@ -201,4 +201,4 @@ GPSDProvider.prototype = { }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([GPSDProvider]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([GPSDProvider]); diff --git a/dom/system/NetworkGeolocationProvider.js b/dom/system/NetworkGeolocationProvider.js index 278ff1d6a962..8d260c5b9553 100755 --- a/dom/system/NetworkGeolocationProvider.js +++ b/dom/system/NetworkGeolocationProvider.js @@ -288,4 +288,4 @@ WifiGeoPositionProvider.prototype = { }, }; -let NSGetFactory = XPCOMUtils.generateNSGetFactory([WifiGeoPositionProvider]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WifiGeoPositionProvider]); diff --git a/dom/system/gonk/NetworkManager.js b/dom/system/gonk/NetworkManager.js index a5e78691d541..44036249b90b 100644 --- a/dom/system/gonk/NetworkManager.js +++ b/dom/system/gonk/NetworkManager.js @@ -773,7 +773,7 @@ NetworkManager.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([NetworkManager]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([NetworkManager]); let debug; diff --git a/dom/system/gonk/RILContentHelper.js b/dom/system/gonk/RILContentHelper.js index e282e6bda12b..040727106d3e 100644 --- a/dom/system/gonk/RILContentHelper.js +++ b/dom/system/gonk/RILContentHelper.js @@ -883,7 +883,7 @@ RILContentHelper.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([RILContentHelper]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RILContentHelper]); let debug; if (DEBUG) { diff --git a/dom/system/gonk/RadioInterfaceLayer.js b/dom/system/gonk/RadioInterfaceLayer.js index 470621b21549..4a44313d016d 100644 --- a/dom/system/gonk/RadioInterfaceLayer.js +++ b/dom/system/gonk/RadioInterfaceLayer.js @@ -2578,7 +2578,7 @@ RILNetworkInterface.prototype = { }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([RadioInterfaceLayer]); +this.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 68d8d2b6610e..a976cc6e98e3 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 -const DEBUG_ALL = false; +this.DEBUG_ALL = false; // Set individually to debug specific layers -const DEBUG_WORKER = false || DEBUG_ALL; -const DEBUG_CONTENT_HELPER = false || DEBUG_ALL; -const DEBUG_RIL = false || DEBUG_ALL; +this.DEBUG_WORKER = false || DEBUG_ALL; +this.DEBUG_CONTENT_HELPER = false || DEBUG_ALL; +this.DEBUG_RIL = false || DEBUG_ALL; -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; +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; // Akami/Maguro specific parcel types. -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.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 RESPONSE_TYPE_SOLICITED = 0; -const RESPONSE_TYPE_UNSOLICITED = 1; +this.RESPONSE_TYPE_SOLICITED = 0; +this.RESPONSE_TYPE_UNSOLICITED = 1; -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; +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; // Akami/Maguro specific parcels. -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.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 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.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 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.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 RIL_ERROR_TO_GECKO_ERROR = {}; +this.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. -const SMS_RETRY_MAX = 3; +this.SMS_RETRY_MAX = 3; -const RADIO_STATE_OFF = 0; -const RADIO_STATE_UNAVAILABLE = 1; -const RADIO_STATE_ON = 2; +this.RADIO_STATE_OFF = 0; +this.RADIO_STATE_UNAVAILABLE = 1; +this.RADIO_STATE_ON = 2; // RIL v5 legacy constants: -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.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 CARD_STATE_ABSENT = 0; -const CARD_STATE_PRESENT = 1; -const CARD_STATE_ERROR = 2; +this.CARD_STATE_ABSENT = 0; +this.CARD_STATE_PRESENT = 1; +this.CARD_STATE_ERROR = 2; -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_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_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 +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 // at when app_state is assigned // to this value. -const CARD_APPSTATE_READY = 5; +this.CARD_APPSTATE_READY = 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_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_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_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_MAX_APPS = 8; +this.CARD_MAX_APPS = 8; -const NETWORK_STATE_UNKNOWN = "unknown"; -const NETWORK_STATE_AVAILABLE = "available"; -const NETWORK_STATE_CONNECTED = "connected"; -const NETWORK_STATE_FORBIDDEN = "forbidden"; +this.NETWORK_STATE_UNKNOWN = "unknown"; +this.NETWORK_STATE_AVAILABLE = "available"; +this.NETWORK_STATE_CONNECTED = "connected"; +this.NETWORK_STATE_FORBIDDEN = "forbidden"; -const NETWORK_SELECTION_MODE_AUTOMATIC = 0; -const NETWORK_SELECTION_MODE_MANUAL = 1; +this.NETWORK_SELECTION_MODE_AUTOMATIC = 0; +this.NETWORK_SELECTION_MODE_MANUAL = 1; -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 = [ +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 = [ NETWORK_INFO_VOICE_REGISTRATION_STATE, NETWORK_INFO_DATA_REGISTRATION_STATE, NETWORK_INFO_OPERATOR, NETWORK_INFO_NETWORK_SELECTION_MODE ]; -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 = [ +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 = [ 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 -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_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_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.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 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.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 TOA_INTERNATIONAL = 0x91; -const TOA_UNKNOWN = 0x81; +this.TOA_INTERNATIONAL = 0x91; +this.TOA_UNKNOWN = 0x81; -const CALL_PRESENTATION_ALLOWED = 0; -const CALL_PRESENTATION_RESTRICTED = 1; -const CALL_PRESENTATION_UNKNOWN = 2; -const CALL_PRESENTATION_PAYPHONE = 3; +this.CALL_PRESENTATION_ALLOWED = 0; +this.CALL_PRESENTATION_RESTRICTED = 1; +this.CALL_PRESENTATION_UNKNOWN = 2; +this.CALL_PRESENTATION_PAYPHONE = 3; // ICC commands, see TS 27.007 +CRSM commands -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; +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; // ICC constants, GSM SIM file ids from TS 51.011 -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; +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; // Types of files TS 11.11 9.3 -const TYPE_RFU = 0; -const TYPE_MF = 1; -const TYPE_DF = 2; -const TYPE_EF = 4; +this.TYPE_RFU = 0; +this.TYPE_MF = 1; +this.TYPE_DF = 2; +this.TYPE_EF = 4; -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; +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; // Types of files TS 11.11 9.3 -const EF_TYPE_TRANSPARENT = 0; -const EF_TYPE_LINEAR_FIXED = 1; -const EF_TYPE_CYCLIC = 3; +this.EF_TYPE_TRANSPARENT = 0; +this.EF_TYPE_LINEAR_FIXED = 1; +this.EF_TYPE_CYCLIC = 3; // Status code of EFsms // see 3GPP TS 51.011 clause 10.5.3 -const EFSMS_STATUS_FREE = 0x00; -const EFSMS_STATUS_READ = 0x01; -const EFSMS_STATUS_TO_BE_READ = 0x03; -const EFSMS_STATUS_TO_BE_SENT = 0x07; +this.EFSMS_STATUS_FREE = 0x00; +this.EFSMS_STATUS_READ = 0x01; +this.EFSMS_STATUS_TO_BE_READ = 0x03; +this.EFSMS_STATUS_TO_BE_SENT = 0x07; // For retrieving MSISDN, TS 151.011 clause 10.5.5 -const MSISDN_FOOTER_SIZE_BYTES = 14; -const MSISDN_MAX_NUMBER_SIZE_BYTES = 10; +this.MSISDN_FOOTER_SIZE_BYTES = 14; +this.MSISDN_MAX_NUMBER_SIZE_BYTES = 10; // READ_RECORD mode, TS 102.221 -const READ_RECORD_ABSOLUTE_MODE = 4; +this.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.' -const GET_RESPONSE_EF_SIZE_BYTES = 15; +this.GET_RESPONSE_EF_SIZE_BYTES = 15; // EF path -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"; +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"; // Status code of sw1 for ICC I/O, // see GSM11.11 and TS 51.011 clause 9.4, and ISO 7816-4 -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; +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; // ICC call barring facility. // TS 27.007, clause 7.4, +CLCK -const ICC_CB_FACILITY_SIM = "SC"; +this.ICC_CB_FACILITY_SIM = "SC"; // ICC service class // TS 27.007, clause 7.4, +CLCK -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_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_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; +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; /** * STK constants. */ // Tags for Ber Tlv. -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; +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; // Flags in Comprehension TLV. -const COMPREHENSIONTLV_FLAG_CR = 0x80; // Comprehension required. +this.COMPREHENSIONTLV_FLAG_CR = 0x80; // Comprehension required. // Tags for Comprehension TLV. -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; +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; // Device identifiers, see TS 11.14, clause 12.7 -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; +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; // STK Proactive commands. -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; +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; // STK Result code. // TS 11.14, clause 12.12 @@ -588,189 +588,189 @@ const STK_CMD_SET_UP_IDLE_MODE_TEXT = 0x28; // Results '0X' and '1X' indicate that the command has been performed. // Command performed successfully. -const STK_RESULT_OK = 0x00; +this.STK_RESULT_OK = 0x00; // Command performed with partial comprehension. -const STK_RESULT_PRFRMD_WITH_PARTIAL_COMPREHENSION = 0x01; +this.STK_RESULT_PRFRMD_WITH_PARTIAL_COMPREHENSION = 0x01; // Command performed, with missing information. -const STK_RESULT_PRFRMD_WITH_MISSING_INFO = 0x02; +this.STK_RESULT_PRFRMD_WITH_MISSING_INFO = 0x02; // REFRESH performed with additional EFs read. -const STK_RESULT_PRFRMD_WITH_ADDITIONAL_EFS_READ = 0x03; +this.STK_RESULT_PRFRMD_WITH_ADDITIONAL_EFS_READ = 0x03; // Command performed successfully, but requested icon could not be // displayed. -const STK_RESULT_PRFRMD_ICON_NOT_DISPLAYED = 0x04; +this.STK_RESULT_PRFRMD_ICON_NOT_DISPLAYED = 0x04; // Command performed, but modified by call control by NAA. -const STK_RESULT_PRFRMD_MODIFIED_BY_NAA = 0x05; +this.STK_RESULT_PRFRMD_MODIFIED_BY_NAA = 0x05; // Command performed successfully, limited service. -const STK_RESULT_PRFRMD_LIMITED_SERVICE = 0x06; +this.STK_RESULT_PRFRMD_LIMITED_SERVICE = 0x06; // Command performed with modification. -const STK_RESULT_PRFRMD_WITH_MODIFICATION = 0x07; +this.STK_RESULT_PRFRMD_WITH_MODIFICATION = 0x07; // REFRESH performed but indicated NAA was not active. -const STK_RESULT_PRFRMD_NAA_NOT_ACTIVE = 0x08; +this.STK_RESULT_PRFRMD_NAA_NOT_ACTIVE = 0x08; // Command performed successfully; tone not played. -const STK_RESULT_PRFRMD_TONE_NOT_PLAYED = 0x09; +this.STK_RESULT_PRFRMD_TONE_NOT_PLAYED = 0x09; // Proactive UICC session terminated by the user. -const STK_RESULT_UICC_SESSION_TERM_BY_USER = 0x10; +this.STK_RESULT_UICC_SESSION_TERM_BY_USER = 0x10; // Backward move in the proactive UICC session requested by the user. -const STK_RESULT_BACKWARD_MOVE_BY_USER = 0x11; +this.STK_RESULT_BACKWARD_MOVE_BY_USER = 0x11; // No response from user. -const STK_RESULT_NO_RESPONSE_FROM_USER = 0x12; +this.STK_RESULT_NO_RESPONSE_FROM_USER = 0x12; // Help information required by the user. -const STK_RESULT_HELP_INFO_REQUIRED = 0x13; +this.STK_RESULT_HELP_INFO_REQUIRED = 0x13; // USSD or SS transaction terminated by the user. -const STK_RESULT_USSD_SS_SESSION_TERM_BY_USER = 0x14; +this.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. -const STK_RESULT_TERMINAL_CRNTLY_UNABLE_TO_PROCESS = 0x20; +this.STK_RESULT_TERMINAL_CRNTLY_UNABLE_TO_PROCESS = 0x20; // Network currently unable to process command. -const STK_RESULT_NETWORK_CRNTLY_UNABLE_TO_PROCESS = 0x21; +this.STK_RESULT_NETWORK_CRNTLY_UNABLE_TO_PROCESS = 0x21; // User did not accept the proactive command. -const STK_RESULT_USER_NOT_ACCEPT = 0x22; +this.STK_RESULT_USER_NOT_ACCEPT = 0x22; // User cleared down call before connection or network release. -const STK_RESULT_USER_CLEAR_DOWN_CALL = 0x23; +this.STK_RESULT_USER_CLEAR_DOWN_CALL = 0x23; // Action in contradiction with the current timer state. -const STK_RESULT_CONTRADICTION_WITH_TIMER = 0x24; +this.STK_RESULT_CONTRADICTION_WITH_TIMER = 0x24; // Interaction with call control by NAA; temporary problem. -const STK_RESULT_NAA_CALL_CONTROL_TEMPORARY = 0x25; +this.STK_RESULT_NAA_CALL_CONTROL_TEMPORARY = 0x25; // Launch browser generic error code. -const STK_RESULT_LAUNCH_BROWSER_ERROR = 0x26; +this.STK_RESULT_LAUNCH_BROWSER_ERROR = 0x26; // MMS temporary problem. -const STK_RESULT_MMS_TEMPORARY = 0x27; +this.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. -const STK_RESULT_BEYOND_TERMINAL_CAPABILITY = 0x30; +this.STK_RESULT_BEYOND_TERMINAL_CAPABILITY = 0x30; // Command type not understood by terminal. -const STK_RESULT_CMD_TYPE_NOT_UNDERSTOOD = 0x31; +this.STK_RESULT_CMD_TYPE_NOT_UNDERSTOOD = 0x31; // Command data not understood by terminal. -const STK_RESULT_CMD_DATA_NOT_UNDERSTOOD = 0x32; +this.STK_RESULT_CMD_DATA_NOT_UNDERSTOOD = 0x32; // Command number not known by terminal. -const STK_RESULT_CMD_NUM_NOT_KNOWN = 0x33; +this.STK_RESULT_CMD_NUM_NOT_KNOWN = 0x33; // SS Return Error. -const STK_RESULT_SS_RETURN_ERROR = 0x34; +this.STK_RESULT_SS_RETURN_ERROR = 0x34; // SMS RP-ERROR. -const STK_RESULT_SMS_RP_ERROR = 0x35; +this.STK_RESULT_SMS_RP_ERROR = 0x35; // Error, required values are missing. -const STK_RESULT_REQUIRED_VALUES_MISSING = 0x36; +this.STK_RESULT_REQUIRED_VALUES_MISSING = 0x36; // USSD Return Error. -const STK_RESULT_USSD_RETURN_ERROR = 0x37; +this.STK_RESULT_USSD_RETURN_ERROR = 0x37; // MultipleCard commands error. -const STK_RESULT_MULTI_CARDS_CMD_ERROR = 0x38; +this.STK_RESULT_MULTI_CARDS_CMD_ERROR = 0x38; // Interaction with call control by USIM or MO short message control by // USIM; permanent problem. -const STK_RESULT_USIM_CALL_CONTROL_PERMANENT = 0x39; +this.STK_RESULT_USIM_CALL_CONTROL_PERMANENT = 0x39; // Bearer Independent Protocol error. -const STK_RESULT_BIP_ERROR = 0x3a; +this.STK_RESULT_BIP_ERROR = 0x3a; // Access Technology unable to process command. -const STK_RESULT_ACCESS_TECH_UNABLE_TO_PROCESS = 0x3b; +this.STK_RESULT_ACCESS_TECH_UNABLE_TO_PROCESS = 0x3b; // Frames error. -const STK_RESULT_FRAMES_ERROR = 0x3c; +this.STK_RESULT_FRAMES_ERROR = 0x3c; // MMS Error. -const STK_RESULT_MMS_ERROR = 0x3d; +this.STK_RESULT_MMS_ERROR = 0x3d; // STK presentation types, TS 11.14, clause 12.6, Command Qualifier: Select Item -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. +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. // STK Coding Scheme. -const STK_TEXT_CODING_GSM_7BIT_PACKED = 0x00; -const STK_TEXT_CODING_GSM_8BIT = 0x04; -const STK_TEXT_CODING_UCS2 = 0x08; +this.STK_TEXT_CODING_GSM_7BIT_PACKED = 0x00; +this.STK_TEXT_CODING_GSM_8BIT = 0x04; +this.STK_TEXT_CODING_UCS2 = 0x08; // STK Event List. -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; +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; // STK Service state of Location Status. -const STK_SERVICE_STATE_NORMAL = 0x00; -const STK_SERVICE_STATE_LIMITED = 0x01; -const STK_SERVICE_STATE_UNAVAILABLE = 0x02; +this.STK_SERVICE_STATE_NORMAL = 0x00; +this.STK_SERVICE_STATE_LIMITED = 0x01; +this.STK_SERVICE_STATE_UNAVAILABLE = 0x02; // Refresh mode. -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; +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; // Tone type. -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; +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; // Time unit. -const STK_TIME_UNIT_MINUTE = 0x00; -const STK_TIME_UNIT_SECOND = 0x01; -const STK_TIME_UNIT_TENTH_SECOND = 0x02; +this.STK_TIME_UNIT_MINUTE = 0x00; +this.STK_TIME_UNIT_SECOND = 0x01; +this.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). */ -const GECKO_ICC_SERVICES = { +this.GECKO_ICC_SERVICES = { sim: { ADN: 2, FDN: 3, @@ -791,28 +791,28 @@ const GECKO_ICC_SERVICES = { */ // PDU TYPE-OF-ADDRESS -const PDU_TOA_UNKNOWN = 0x80; // Unknown. This is used when the user or +this.PDU_TOA_UNKNOWN = 0x80; // Unknown. This is used when the user or // network has no a priori information // about the numbering plan. -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 +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 // shall not be included -const PDU_TOA_NETWORK_SPEC = 0xB0; // Network specific number This is used to +this.PDU_TOA_NETWORK_SPEC = 0xB0; // Network specific number This is used to // indicate administration/service number // specific to the serving network -const PDU_TOA_SUBSCRIBER = 0xC0; // Subscriber number. This is used when a +this.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 -const PDU_TOA_ALPHANUMERIC = 0xD0; // Alphanumeric, (coded according to GSM TS +this.PDU_TOA_ALPHANUMERIC = 0xD0; // Alphanumeric, (coded according to GSM TS // 03.38 7-bit default alphabet) -const PDU_TOA_ABBREVIATED = 0xE0; // Abbreviated number +this.PDU_TOA_ABBREVIATED = 0xE0; // Abbreviated number /** * First octet of the SMS-DELIVER PDU @@ -843,220 +843,220 @@ const PDU_TOA_ABBREVIATED = 0xE0; // Abbreviated number * 1 0 SMS-COMMAND (MS ==> SMSC) * 1 1 Reserved */ -const PDU_RP = 0x80; // Reply path. Parameter indicating that +this.PDU_RP = 0x80; // Reply path. Parameter indicating that // reply path exists. -const PDU_UDHI = 0x40; // User data header indicator. This bit is +this.PDU_UDHI = 0x40; // User data header indicator. This bit is // set to 1 if the User Data field starts // with a header -const PDU_SRI_SRR = 0x20; // Status report indication (SMS-DELIVER) +this.PDU_SRI_SRR = 0x20; // Status report indication (SMS-DELIVER) // or request (SMS-SUBMIT) -const PDU_VPF_ABSOLUTE = 0x18;// Validity period aboslute format +this.PDU_VPF_ABSOLUTE = 0x18;// Validity period aboslute format // (SMS-SUBMIT only) -const PDU_VPF_RELATIVE = 0x10;// Validity period relative format +this.PDU_VPF_RELATIVE = 0x10;// Validity period relative format // (SMS-SUBMIT only) -const PDU_VPF_ENHANCED = 0x8; // Validity period enhance format +this.PDU_VPF_ENHANCED = 0x8; // Validity period enhance format // (SMS-SUBMIT only) -const PDU_MMS_RD = 0x04;// More messages to send. (SMS-DELIVER only) or +this.PDU_MMS_RD = 0x04;// More messages to send. (SMS-DELIVER only) or // Reject duplicates (SMS-SUBMIT only) // MTI - Message Type Indicator -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; +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; // PI - Parameter Indicator -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; +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; // 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 -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; +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; // ST - Status // Bit 7..0 = 000xxxxx, short message transaction completed -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; +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; // Bit 7..0 = 001xxxxx, temporary error, SC still trying to transfer SM -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; +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; // Bit 7..0 = 010xxxxx, permanent error, SC is not making any more transfer // attempts -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; +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; // Bit 7..0 = 011xxxxx, temporary error, SC is not making any more transfer // attempts -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.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 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"; +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"; // User Data max length in septets -const PDU_MAX_USER_DATA_7BIT = 160; +this.PDU_MAX_USER_DATA_7BIT = 160; // User Data max length in octets -const PDU_MAX_USER_DATA_8BIT = 140; +this.PDU_MAX_USER_DATA_8BIT = 140; // User Data max length in chars -const PDU_MAX_USER_DATA_UCS2 = 70; +this.PDU_MAX_USER_DATA_UCS2 = 70; // PID - Protocol Indicator -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; +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; // DCS - Data Coding Scheme -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; +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; // Because service center timestamp omit the century. Yay. -const PDU_TIMESTAMP_YEAR_OFFSET = 2000; +this.PDU_TIMESTAMP_YEAR_OFFSET = 2000; // See 9.2.3.24 TP‑User Data (TP‑UD) -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; +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; // Application Port Addressing, see 3GPP TS 23.040 9.2.3.24.3 -const PDU_APA_RESERVED_8BIT_PORTS = 240; -const PDU_APA_VALID_16BIT_PORTS = 49152; +this.PDU_APA_RESERVED_8BIT_PORTS = 240; +this.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. -const PDU_NL_EXTENDED_ESCAPE = 0x1B; +this.PDU_NL_EXTENDED_ESCAPE = 0x1B; // , , are only defined in locking shift tables. -const PDU_NL_SPACE = 0x20; -const PDU_NL_LINE_FEED = 0x0A; -const PDU_NL_CARRIAGE_RETURN = 0x0D; +this.PDU_NL_SPACE = 0x20; +this.PDU_NL_LINE_FEED = 0x0A; +this.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. -const PDU_NL_PAGE_BREAK = 0x0A; +this.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. -const PDU_NL_RESERVED_CONTROL = 0x0D; +this.PDU_NL_RESERVED_CONTROL = 0x0D; -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; +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; // National Language Locking Shift Tables, see 3GPP TS 23.038 -const PDU_NL_LOCKING_SHIFT_TABLES = [ +this.PDU_NL_LOCKING_SHIFT_TABLES = [ /** * National Language Identifier: 0x00 * 6.2.1 GSM 7 bit Default Alphabet @@ -1353,7 +1353,7 @@ const PDU_NL_LOCKING_SHIFT_TABLES = [ ]; // National Language Single Shift Tables, see 3GPP TS 23.038 -const PDU_NL_SINGLE_SHIFT_TABLES = [ +this.PDU_NL_SINGLE_SHIFT_TABLES = [ /** * National Language Identifier: 0x00 * 6.2.1.1 GSM 7 bit default alphabet extension table @@ -1650,11 +1650,11 @@ const PDU_NL_SINGLE_SHIFT_TABLES = [ ]; // Special SMS Message Indication constants -const PDU_MWI_STORE_TYPE_BIT = 0x80; -const PDU_MWI_STORE_TYPE_DISCARD = 0x00; -const PDU_MWI_STORE_TYPE_STORE = 0x80; +this.PDU_MWI_STORE_TYPE_BIT = 0x80; +this.PDU_MWI_STORE_TYPE_DISCARD = 0x00; +this.PDU_MWI_STORE_TYPE_STORE = 0x80; -const GSM_SMS_STRICT_7BIT_CHARMAP = { +this.GSM_SMS_STRICT_7BIT_CHARMAP = { "\u00C1": "\u0041", // Á(\u00C1) => A(\u0041) "\u00E1": "\u0061", // á(\u00E1) => a(\u0061) "\u00CD": "\u0049", // Í(\u00CD) => I(\u0049) @@ -1666,108 +1666,108 @@ const GSM_SMS_STRICT_7BIT_CHARMAP = { "\u00E7": "\u00C7" // ç(\u00E7) => Ç(\u00C7) }; -const RADIOTECH_FAMILY_3GPP = 1; // GSM, WCDMA, LTE -const RADIOTECH_FAMILY_3GPP2 = 2; // CDMA, EVDO +this.RADIOTECH_FAMILY_3GPP = 1; // GSM, WCDMA, LTE +this.RADIOTECH_FAMILY_3GPP2 = 2; // CDMA, EVDO -const DATACALL_RADIOTECHNOLOGY_CDMA = 0; -const DATACALL_RADIOTECHNOLOGY_GSM = 1; +this.DATACALL_RADIOTECHNOLOGY_CDMA = 0; +this.DATACALL_RADIOTECHNOLOGY_GSM = 1; -const DATACALL_AUTH_NONE = 0; -const DATACALL_AUTH_PAP = 1; -const DATACALL_AUTH_CHAP = 2; -const DATACALL_AUTH_PAP_OR_CHAP = 3; +this.DATACALL_AUTH_NONE = 0; +this.DATACALL_AUTH_PAP = 1; +this.DATACALL_AUTH_CHAP = 2; +this.DATACALL_AUTH_PAP_OR_CHAP = 3; -const DATACALL_PROFILE_DEFAULT = 0; -const DATACALL_PROFILE_TETHERED = 1; -const DATACALL_PROFILE_OEM_BASE = 1000; +this.DATACALL_PROFILE_DEFAULT = 0; +this.DATACALL_PROFILE_TETHERED = 1; +this.DATACALL_PROFILE_OEM_BASE = 1000; -const DATACALL_DEACTIVATE_NO_REASON = 0; -const DATACALL_DEACTIVATE_RADIO_SHUTDOWN = 1; +this.DATACALL_DEACTIVATE_NO_REASON = 0; +this.DATACALL_DEACTIVATE_RADIO_SHUTDOWN = 1; -const DATACALL_ACTIVE_UNKNOWN = -1; -const DATACALL_INACTIVE = 0; -const DATACALL_ACTIVE_DOWN = 1; -const DATACALL_ACTIVE_UP = 2; +this.DATACALL_ACTIVE_UNKNOWN = -1; +this.DATACALL_INACTIVE = 0; +this.DATACALL_ACTIVE_DOWN = 1; +this.DATACALL_ACTIVE_UP = 2; -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; +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; // Keep consistent with nsINetworkManager.NETWORK_STATE_*. -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; +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; // Used for QUERY_AVAILABLE_NETWORKS status of "unknown" -const GECKO_QAN_STATE_UNKNOWN = null; +this.GECKO_QAN_STATE_UNKNOWN = null; -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; +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; // Other Gecko-specific constants -const GECKO_RADIOSTATE_UNAVAILABLE = null; -const GECKO_RADIOSTATE_OFF = "off"; -const GECKO_RADIOSTATE_READY = "ready"; +this.GECKO_RADIOSTATE_UNAVAILABLE = null; +this.GECKO_RADIOSTATE_OFF = "off"; +this.GECKO_RADIOSTATE_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_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_NETWORK_SELECTION_UNKNOWN = null; -const GECKO_NETWORK_SELECTION_AUTOMATIC = "automatic"; -const GECKO_NETWORK_SELECTION_MANUAL = "manual"; +this.GECKO_NETWORK_SELECTION_UNKNOWN = null; +this.GECKO_NETWORK_SELECTION_AUTOMATIC = "automatic"; +this.GECKO_NETWORK_SELECTION_MANUAL = "manual"; -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.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 NETWORK_CREG_TO_GECKO_MOBILE_CONNECTION_STATE = {}; +this.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; -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.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 RIL_CALL_FAILCAUSE_TO_GECKO_CALL_ERROR = {}; +this.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; -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.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 RIL_DATACALL_FAILCAUSE_TO_GECKO_DATACALL_ERROR = {}; +this.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; -const GECKO_RADIO_TECH = [ +this.GECKO_RADIO_TECH = [ null, "gprs", "edge", @@ -1889,49 +1889,49 @@ const GECKO_RADIO_TECH = [ "hspa+", ]; -const GECKO_VOICEMAIL_MESSAGE_COUNT_UNKNOWN = -1; +this.GECKO_VOICEMAIL_MESSAGE_COUNT_UNKNOWN = -1; // MMI procedure as defined in TS.22.030 6.5.2 -const MMI_PROCEDURE_ACTIVATION = "*"; -const MMI_PROCEDURE_DEACTIVATION = "#"; -const MMI_PROCEDURE_INTERROGATION = "*#"; -const MMI_PROCEDURE_REGISTRATION = "**"; -const MMI_PROCEDURE_ERASURE = "##"; +this.MMI_PROCEDURE_ACTIVATION = "*"; +this.MMI_PROCEDURE_DEACTIVATION = "#"; +this.MMI_PROCEDURE_INTERROGATION = "*#"; +this.MMI_PROCEDURE_REGISTRATION = "**"; +this.MMI_PROCEDURE_ERASURE = "##"; // MMI call forwarding service codes as defined in TS.22.030 Annex B -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"; +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"; // MMI service codes for PIN/PIN2/PUK/PUK2 management as defined in TS.22.030 // sec 6.6 -const MMI_SC_PIN = "04"; -const MMI_SC_PIN2 = "042"; -const MMI_SC_PUK = "05"; -const MMI_SC_PUK2 = "052"; +this.MMI_SC_PIN = "04"; +this.MMI_SC_PIN2 = "042"; +this.MMI_SC_PUK = "05"; +this.MMI_SC_PUK2 = "052"; // MMI service code for IMEI presentation as defined in TS.22.030 sec 6.7 -const MMI_SC_IMEI = "06"; +this.MMI_SC_IMEI = "06"; // MMI called line presentation service codes -const MMI_SC_CLIP = "30"; -const MMI_SC_CLIR = "31"; +this.MMI_SC_CLIP = "30"; +this.MMI_SC_CLIR = "31"; // MMI call waiting service code -const MMI_SC_CALL_WAITING = "43"; +this.MMI_SC_CALL_WAITING = "43"; // MMI call barring service codes -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"; +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"; // Allow this file to be imported via Components.utils.import(). -const EXPORTED_SYMBOLS = Object.keys(this); +this.EXPORTED_SYMBOLS = Object.keys(this); diff --git a/dom/system/gonk/systemlibs.js b/dom/system/gonk/systemlibs.js index 8ba723dbd8f3..9c42da0a37ec 100644 --- a/dom/system/gonk/systemlibs.js +++ b/dom/system/gonk/systemlibs.js @@ -13,10 +13,9 @@ * limitations under the License. */ -let EXPORTED_SYMBOLS; if (!this.ctypes) { // We're likely being loaded as a JSM. - EXPORTED_SYMBOLS = [ "libcutils", "libnetutils", "netHelpers" ]; + this.EXPORTED_SYMBOLS = [ "libcutils", "libnetutils", "netHelpers" ]; Components.utils.import("resource://gre/modules/ctypes.jsm"); } @@ -31,7 +30,7 @@ let DEBUG; /** * Expose some system-level functions. */ -let libcutils = (function() { +this.libcutils = (function() { let lib; try { lib = ctypes.open("libcutils.so"); @@ -106,7 +105,7 @@ let libcutils = (function() { /** * Network-related functions from libnetutils. */ -let libnetutils = (function () { +this.libnetutils = (function () { let library; try { library = ctypes.open("libnetutils.so"); @@ -329,7 +328,7 @@ let libnetutils = (function () { /** * Helpers for conversions. */ -let netHelpers = { +this.netHelpers = { /** * Swap byte orders for 32-bit value diff --git a/dom/wifi/DOMWifiManager.js b/dom/wifi/DOMWifiManager.js index 666d6a66f254..c46481dc697b 100644 --- a/dom/wifi/DOMWifiManager.js +++ b/dom/wifi/DOMWifiManager.js @@ -393,7 +393,7 @@ DOMWifiManager.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([DOMWifiManager]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DOMWifiManager]); let debug; if (DEBUG) { diff --git a/dom/wifi/WifiWorker.js b/dom/wifi/WifiWorker.js index 1787dcbd32b4..50752f6297db 100644 --- a/dom/wifi/WifiWorker.js +++ b/dom/wifi/WifiWorker.js @@ -2598,7 +2598,7 @@ WifiWorker.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([WifiWorker]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WifiWorker]); let debug; if (DEBUG) { diff --git a/dom/workers/test/WorkerTest.jsm b/dom/workers/test/WorkerTest.jsm index b639ab1fee58..86431b7f8926 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/ */ -let EXPORTED_SYMBOLS = [ +this.EXPORTED_SYMBOLS = [ "WorkerTest" ]; -const WorkerTest = { +this.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 13a1c33643b7..5fdd14d9d2cd 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}") }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([WorkerTest]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WorkerTest]); diff --git a/extensions/cookie/test/unit/cookieprompt.js b/extensions/cookie/test/unit/cookieprompt.js index b01dd3662519..fa4257caf9ee 100644 --- a/extensions/cookie/test/unit/cookieprompt.js +++ b/extensions/cookie/test/unit/cookieprompt.js @@ -19,4 +19,4 @@ CookiePromptService.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([CookiePromptService]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([CookiePromptService]); diff --git a/image/decoders/icon/qt/gtkqticonsconverter.js b/image/decoders/icon/qt/gtkqticonsconverter.js index 2317f5201ddd..cbaf4260f3a3 100644 --- a/image/decoders/icon/qt/gtkqticonsconverter.js +++ b/image/decoders/icon/qt/gtkqticonsconverter.js @@ -133,5 +133,5 @@ GtkQtIconsConverter.prototype = { }, } var components = [GtkQtIconsConverter]; -const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/intl/locale/src/PluralForm.jsm b/intl/locale/src/PluralForm.jsm index 3f8640424099..36f3471896a7 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/. */ -var EXPORTED_SYMBOLS = [ "PluralForm" ]; +this.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], ]; -let PluralForm = { +this.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 d7383a2d36c7..10fafdfa795a 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/. */ -let EXPORTED_SYMBOLS = [ "addDebuggerToGlobal" ]; +this.EXPORTED_SYMBOLS = [ "addDebuggerToGlobal" ]; /* * This is the js module for Debugger. Import it like so: @@ -19,6 +19,6 @@ let EXPORTED_SYMBOLS = [ "addDebuggerToGlobal" ]; */ const init = Components.classes["@mozilla.org/jsdebugger;1"].createInstance(Components.interfaces.IJSDebugger); -function addDebuggerToGlobal(global) { +this.addDebuggerToGlobal = function addDebuggerToGlobal(global) { init.addClass(global); }; diff --git a/js/xpconnect/loader/ISO8601DateUtils.jsm b/js/xpconnect/loader/ISO8601DateUtils.jsm index b4140542d3ff..534667cefc39 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; -var EXPORTED_SYMBOLS = ["ISO8601DateUtils"]; +this.EXPORTED_SYMBOLS = ["ISO8601DateUtils"]; debug("*** loading ISO8601DateUtils\n"); -var ISO8601DateUtils = { +this.ISO8601DateUtils = { /** * XXX Thunderbird's W3C-DTF function diff --git a/js/xpconnect/loader/XPCOMUtils.jsm b/js/xpconnect/loader/XPCOMUtils.jsm index bb24ce1ca174..49a052d568af 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: - * const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); + * this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); */ -var EXPORTED_SYMBOLS = [ "XPCOMUtils" ]; +this.EXPORTED_SYMBOLS = [ "XPCOMUtils" ]; const Cc = Components.classes; const Ci = Components.interfaces; const Cr = Components.results; const Cu = Components.utils; -var XPCOMUtils = { +this.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 334ab453fd23..ceea7c52b5de 100644 --- a/js/xpconnect/loader/mozJSComponentLoader.cpp +++ b/js/xpconnect/loader/mozJSComponentLoader.cpp @@ -352,7 +352,8 @@ ReportOnCaller(JSCLContextHelper &helper, mozJSComponentLoader::mozJSComponentLoader() : mRuntime(nullptr), mContext(nullptr), - mInitialized(false) + mInitialized(false), + mReuseLoaderGlobal(false) { NS_ASSERTION(!sSelf, "mozJSComponentLoader should be a singleton"); @@ -388,6 +389,7 @@ mozJSComponentLoader::ReallyInit() { nsresult rv; + mReuseLoaderGlobal = Preferences::GetBool("jsloader.reuseGlobal"); /* * Get the JSRuntime from the runtime svc, if possible. @@ -472,15 +474,10 @@ mozJSComponentLoader::LoadModule(FileLocation &aFile) return mod; nsAutoPtr entry(new ModuleEntry); - if (!entry) - return NULL; - rv = GlobalForLocation(file, uri, &entry->global, + rv = ObjectForLocation(file, uri, &entry->obj, &entry->location, nullptr); if (NS_FAILED(rv)) { -#ifdef DEBUG_shaver - fprintf(stderr, "GlobalForLocation failed!\n"); -#endif return NULL; } @@ -495,11 +492,11 @@ mozJSComponentLoader::LoadModule(FileLocation &aFile) return NULL; JSCLContextHelper cx(this); - JSAutoCompartment ac(cx, entry->global); + JSAutoCompartment ac(cx, entry->obj); JSObject* cm_jsobj; nsCOMPtr cm_holder; - rv = xpc->WrapNative(cx, entry->global, cm, + rv = xpc->WrapNative(cx, entry->obj, cm, NS_GET_IID(nsIComponentManager), getter_AddRefs(cm_holder)); @@ -521,7 +518,7 @@ mozJSComponentLoader::LoadModule(FileLocation &aFile) JSObject* file_jsobj; nsCOMPtr file_holder; - rv = xpc->WrapNative(cx, entry->global, file, + rv = xpc->WrapNative(cx, entry->obj, file, NS_GET_IID(nsIFile), getter_AddRefs(file_holder)); @@ -538,7 +535,7 @@ mozJSComponentLoader::LoadModule(FileLocation &aFile) jsval NSGetFactory_val; - if (!JS_GetProperty(cx, entry->global, "NSGetFactory", &NSGetFactory_val) || + if (!JS_GetProperty(cx, entry->obj, "NSGetFactory", &NSGetFactory_val) || JSVAL_IS_VOID(NSGetFactory_val)) { return NULL; } @@ -573,7 +570,9 @@ mozJSComponentLoader::LoadModule(FileLocation &aFile) // Set the location information for the new global, so that tools like // about:memory may use that information - xpc::SetLocationForGlobal(entry->global, spec); + if (!mReuseLoaderGlobal) { + xpc::SetLocationForGlobal(entry->obj, spec); + } // The hash owns the ModuleEntry now, forget about it return entry.forget(); @@ -609,47 +608,66 @@ class ANSIFileAutoCloser }; #endif -nsresult -mozJSComponentLoader::GlobalForLocation(nsIFile *aComponentFile, - nsIURI *aURI, - JSObject **aGlobal, - char **aLocation, - jsval *exception) +JSObject* +mozJSComponentLoader::PrepareObjectForLocation(JSCLContextHelper& aCx, + nsIFile *aComponentFile, + nsIURI *aURI, + bool aReuseLoaderGlobal, + bool *aRealFile) { - 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); - - nsCOMPtr xpc = - do_GetService(kXPConnectServiceContractID, &rv); - NS_ENSURE_SUCCESS(rv, rv); - nsCOMPtr holder; - rv = xpc->InitClassesWithNewWrappedGlobal(cx, backstagePass, - mSystemPrincipal, - 0, - getter_AddRefs(holder)); - NS_ENSURE_SUCCESS(rv, rv); - - JSObject *global; - rv = holder->GetJSObject(&global); - NS_ENSURE_SUCCESS(rv, rv); - - JSAutoCompartment ac(cx, global); - if (!JS_DefineFunctions(cx, global, gGlobalFun) || - !JS_DefineProfilingFunctions(cx, global)) { - return NS_ERROR_FAILURE; + if (aReuseLoaderGlobal) { + holder = mLoaderGlobal; } - bool realFile = false; + nsresult rv = NS_OK; + nsCOMPtr xpc = + do_GetService(kXPConnectServiceContractID, &rv); + NS_ENSURE_SUCCESS(rv, nullptr); + + if (!mLoaderGlobal) { + nsCOMPtr backstagePass; + rv = mRuntimeService->GetBackstagePass(getter_AddRefs(backstagePass)); + NS_ENSURE_SUCCESS(rv, nullptr); + + 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, nullptr); + + JSAutoCompartment ac(aCx, global); + if (!JS_DefineFunctions(aCx, global, gGlobalFun) || + !JS_DefineProfilingFunctions(aCx, global)) { + return nullptr; + } + + if (aReuseLoaderGlobal) { + mLoaderGlobal = holder; + } + } + + 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; + // 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 @@ -660,36 +678,67 @@ mozJSComponentLoader::GlobalForLocation(nsIFile *aComponentFile, } if (testFile) { - realFile = true; + *aRealFile = true; nsCOMPtr locationHolder; - rv = xpc->WrapNative(cx, global, aComponentFile, + rv = xpc->WrapNative(aCx, obj, aComponentFile, NS_GET_IID(nsIFile), getter_AddRefs(locationHolder)); - NS_ENSURE_SUCCESS(rv, rv); + NS_ENSURE_SUCCESS(rv, nullptr); JSObject *locationObj; rv = locationHolder->GetJSObject(&locationObj); - NS_ENSURE_SUCCESS(rv, rv); + NS_ENSURE_SUCCESS(rv, nullptr); - if (!JS_DefineProperty(cx, global, "__LOCATION__", - OBJECT_TO_JSVAL(locationObj), nullptr, nullptr, 0)) - return NS_ERROR_FAILURE; + if (!JS_DefineProperty(aCx, obj, "__LOCATION__", + OBJECT_TO_JSVAL(locationObj), + nullptr, nullptr, 0)) { + return nullptr; + } } nsAutoCString nativePath; rv = aURI->GetSpec(nativePath); - NS_ENSURE_SUCCESS(rv, rv); + NS_ENSURE_SUCCESS(rv, nullptr); // Expose the URI from which the script was imported through a special // variable that we insert into the JSM. - 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; + JSString *exposedUri = JS_NewStringCopyN(aCx, nativePath.get(), + nativePath.Length()); + if (!JS_DefineProperty(aCx, obj, "__URI__", + STRING_TO_JSVAL(exposedUri), nullptr, nullptr, 0)) { + return nullptr; + } + 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 @@ -703,7 +752,14 @@ mozJSComponentLoader::GlobalForLocation(nsIFile *aComponentFile, NS_ENSURE_SUCCESS(rv, rv); if (cache) { - rv = ReadCachedScript(cache, cachePath, cx, mSystemPrincipal, &script); + if (!mReuseLoaderGlobal) { + rv = ReadCachedScript(cache, cachePath, cx, mSystemPrincipal, + &script); + } else { + rv = ReadCachedFunction(cache, cachePath, cx, mSystemPrincipal, + &function); + } + if (NS_SUCCEEDED(rv)) { LOG(("Successfully loaded %s from startupcache\n", nativePath.get())); } else { @@ -714,7 +770,7 @@ mozJSComponentLoader::GlobalForLocation(nsIFile *aComponentFile, } } - if (!script) { + if (!script && !function) { // The script wasn't in the cache , so compile it now. LOG(("Slow loading %s\n", nativePath.get())); @@ -726,11 +782,13 @@ mozJSComponentLoader::GlobalForLocation(nsIFile *aComponentFile, JS_SetOptions(cx, oldopts | JSOPTION_DONT_REPORT_UNCAUGHT); JS::CompileOptions options(cx); options.setPrincipals(nsJSPrincipals::get(mSystemPrincipal)) - .setNoScriptRval(true) + .setNoScriptRval(mReuseLoaderGlobal ? false : true) .setVersion(JSVERSION_LATEST) .setFileAndLine(nativePath.get(), 1) - .setSourcePolicy(JS::CompileOptions::LAZY_SOURCE); - js::RootedObject rootedGlobal(cx, global); + .setSourcePolicy(mReuseLoaderGlobal ? + JS::CompileOptions::NO_SOURCE : + JS::CompileOptions::LAZY_SOURCE); + js::RootedObject rootedObject(cx, obj); if (realFile) { #ifdef HAVE_PR_MEMMAP @@ -778,7 +836,14 @@ mozJSComponentLoader::GlobalForLocation(nsIFile *aComponentFile, return NS_ERROR_FAILURE; } - script = JS::Compile(cx, rootedGlobal, options, buf, fileSize32); + if (!mReuseLoaderGlobal) { + script = JS::Compile(cx, rootedObject, options, buf, + fileSize32); + } else { + function = JS::CompileFunction(cx, rootedObject, options, + nullptr, 0, nullptr, + buf, fileSize32); + } PR_MemUnmap(buf, fileSize32); @@ -820,7 +885,15 @@ mozJSComponentLoader::GlobalForLocation(nsIFile *aComponentFile, NS_WARNING("Failed to read file"); return NS_ERROR_FAILURE; } - script = JS::Compile(cx, rootedGlobal, options, buf, rlen); + + if (!mReuseLoaderGlobal) { + script = JS::Compile(cx, rootedObject, options, buf, + fileSize32); + } else { + function = JS::CompileFunction(cx, rootedObject, options, + nullptr, 0, nullptr, + buf, fileSize32); + } free(buf); @@ -859,33 +932,37 @@ mozJSComponentLoader::GlobalForLocation(nsIFile *aComponentFile, buf[len] = '\0'; - script = JS::Compile(cx, rootedGlobal, options, buf, bytesRead); + if (!mReuseLoaderGlobal) { + script = JS::Compile(cx, rootedObject, options, buf, + bytesRead); + } else { + function = JS::CompileFunction(cx, rootedObject, options, + nullptr, 0, nullptr, + buf, bytesRead); + } } // Propagate the exception, if one exists. Also, don't leave the stale // exception on this context. JS_SetOptions(cx, oldopts); - if (!script && exception) { + if (!script && !function && exception) { JS_GetPendingException(cx, exception); JS_ClearPendingException(cx); } } - if (!script) { -#ifdef DEBUG_shaver_off - fprintf(stderr, "mJCL: script compilation of %s FAILED\n", - nativePath.get()); -#endif + if (!script && !function) { 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. - rv = WriteCachedScript(cache, cachePath, cx, mSystemPrincipal, script); + if (script) { + rv = WriteCachedScript(cache, cachePath, cx, mSystemPrincipal, + script); + } else { + rv = WriteCachedFunction(cache, cachePath, cx, mSystemPrincipal, + function); + } // Don't treat failure to write as fatal, since we might be working // with a read-only cache. @@ -896,14 +973,20 @@ mozJSComponentLoader::GlobalForLocation(nsIFile *aComponentFile, } } - // Assign aGlobal here so that it's available to recursive imports. + // Assign aObject here so that it's available to recursive imports. // See bug 384168. - *aGlobal = global; + *aObject = obj; uint32_t oldopts = JS_GetOptions(cx); JS_SetOptions(cx, oldopts | (exception ? JSOPTION_DONT_REPORT_UNCAUGHT : 0)); - bool ok = JS_ExecuteScriptVersion(cx, global, script, NULL, JSVERSION_LATEST); + 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); + } JS_SetOptions(cx, oldopts); if (!ok) { @@ -914,18 +997,18 @@ mozJSComponentLoader::GlobalForLocation(nsIFile *aComponentFile, JS_GetPendingException(cx, exception); JS_ClearPendingException(cx); } - *aGlobal = nullptr; + *aObject = nullptr; return NS_ERROR_FAILURE; } /* Freed when we remove from the table. */ *aLocation = ToNewCString(nativePath); if (!*aLocation) { - *aGlobal = nullptr; + *aObject = nullptr; return NS_ERROR_OUT_OF_MEMORY; } - JS_AddNamedObjectRoot(cx, aGlobal, *aLocation); + JS_AddNamedObjectRoot(cx, aObject, *aLocation); return NS_OK; } @@ -941,6 +1024,20 @@ 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(); @@ -1117,7 +1214,7 @@ mozJSComponentLoader::ImportInto(const nsACString & aLocation, mInProgressImports.Put(key, newEntry); JS::Anchor exception(JSVAL_VOID); - rv = GlobalForLocation(sourceLocalFile, resURI, &newEntry->global, + rv = ObjectForLocation(sourceLocalFile, resURI, &newEntry->obj, &newEntry->location, &exception.get()); mInProgressImports.Remove(key); @@ -1140,20 +1237,22 @@ mozJSComponentLoader::ImportInto(const nsACString & aLocation, // Set the location information for the new global, so that tools like // about:memory may use that information - xpc::SetLocationForGlobal(newEntry->global, aLocation); + if (!mReuseLoaderGlobal) { + xpc::SetLocationForGlobal(newEntry->obj, aLocation); + } mod = newEntry; } - NS_ASSERTION(mod->global, "Import table contains entry with no global"); - *_retval = mod->global; + NS_ASSERTION(mod->obj, "Import table contains entry with no object"); + *_retval = mod->obj; if (targetObj) { JSCLContextHelper cxhelper(this); - JSAutoCompartment ac(mContext, mod->global); + JSAutoCompartment ac(mContext, mod->obj); JS::Value symbols; - if (!JS_GetProperty(mContext, mod->global, + if (!JS_GetProperty(mContext, mod->obj, "EXPORTED_SYMBOLS", &symbols)) { return ReportOnCaller(cxhelper, ERROR_NOT_PRESENT, PromiseFlatCString(aLocation).get()); @@ -1190,7 +1289,7 @@ mozJSComponentLoader::ImportInto(const nsACString & aLocation, PromiseFlatCString(aLocation).get(), i); } - if (!JS_GetPropertyById(mContext, mod->global, symbolId, &val)) { + if (!JS_GetPropertyById(mContext, mod->obj, 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 d42e8703d7aa..eca351e50407 100644 --- a/js/xpconnect/loader/mozJSComponentLoader.h +++ b/js/xpconnect/loader/mozJSComponentLoader.h @@ -32,6 +32,8 @@ { 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 @@ -54,9 +56,15 @@ class mozJSComponentLoader : public mozilla::ModuleLoader, nsresult ReallyInit(); void UnloadModules(); - nsresult GlobalForLocation(nsIFile* aComponentFile, + JSObject* PrepareObjectForLocation(JSCLContextHelper& aCx, + nsIFile* aComponentFile, + nsIURI *aComponent, + bool aReuseLoaderGlobal, + bool *aRealFile); + + nsresult ObjectForLocation(nsIFile* aComponentFile, nsIURI *aComponent, - JSObject **aGlobal, + JSObject **aObject, char **location, jsval *exception); @@ -69,6 +77,7 @@ class mozJSComponentLoader : public mozilla::ModuleLoader, nsCOMPtr mRuntimeService; nsCOMPtr mContextStack; nsCOMPtr mSystemPrincipal; + nsCOMPtr mLoaderGlobal; JSRuntime *mRuntime; JSContext *mContext; @@ -84,7 +93,7 @@ class mozJSComponentLoader : public mozilla::ModuleLoader, loadProc = NULL; unloadProc = NULL; - global = nullptr; + obj = nullptr; location = nullptr; } @@ -95,19 +104,19 @@ class mozJSComponentLoader : public mozilla::ModuleLoader, void Clear() { getfactoryobj = NULL; - if (global) { + if (obj) { JSAutoRequest ar(sSelf->mContext); - JSAutoCompartment ac(sSelf->mContext, global); + JSAutoCompartment ac(sSelf->mContext, obj); - JS_SetAllNonReservedSlotsToUndefined(sSelf->mContext, global); - JS_RemoveObjectRoot(sSelf->mContext, &global); + JS_SetAllNonReservedSlotsToUndefined(sSelf->mContext, obj); + JS_RemoveObjectRoot(sSelf->mContext, &obj); } if (location) NS_Free(location); - global = NULL; + obj = NULL; location = NULL; } @@ -115,7 +124,7 @@ class mozJSComponentLoader : public mozilla::ModuleLoader, const mozilla::Module::CIDEntry& entry); nsCOMPtr getfactoryobj; - JSObject *global; + JSObject *obj; char *location; }; @@ -129,4 +138,5 @@ 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 121091b4c69a..49ef941a1d48 100644 --- a/js/xpconnect/loader/mozJSLoaderUtils.cpp +++ b/js/xpconnect/loader/mozJSLoaderUtils.cpp @@ -36,6 +36,27 @@ 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) @@ -53,3 +74,21 @@ 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 e29a1d1467b6..dfabddbf1c80 100644 --- a/js/xpconnect/loader/mozJSLoaderUtils.h +++ b/js/xpconnect/loader/mozJSLoaderUtils.h @@ -22,9 +22,18 @@ 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 19e18ebdbb49..2e7ffe5416cb 100644 --- a/js/xpconnect/tests/chrome/file_expandosharing.jsm +++ b/js/xpconnect/tests/chrome/file_expandosharing.jsm @@ -1,6 +1,6 @@ -var EXPORTED_SYMBOLS = ['checkFromJSM']; +this.EXPORTED_SYMBOLS = ['checkFromJSM']; -function checkFromJSM(target, is_op) { +this.checkFromJSM = 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 204d4f1b151b..6576f9d558e7 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 = { }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([TestObjectReadWrite, TestObjectReadOnly]); +this.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 124be7fe691e..7e99c1c7509e 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 = { }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([TestInterfaceA, TestInterfaceB]); +this.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 d6bb8db0222e..5bb09627643d 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, }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([TestParams]); +this.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 882ca5680941..ba6583bba1d8 100644 --- a/js/xpconnect/tests/unit/bogus_element_type.jsm +++ b/js/xpconnect/tests/unit/bogus_element_type.jsm @@ -1 +1 @@ -var EXPORTED_SYMBOLS = [{}]; +this.EXPORTED_SYMBOLS = [{}]; diff --git a/js/xpconnect/tests/unit/bogus_exports_type.jsm b/js/xpconnect/tests/unit/bogus_exports_type.jsm index 4b306e4e89d0..4ec23b215375 100644 --- a/js/xpconnect/tests/unit/bogus_exports_type.jsm +++ b/js/xpconnect/tests/unit/bogus_exports_type.jsm @@ -1 +1 @@ -var EXPORTED_SYMBOLS = "not an array"; +this.EXPORTED_SYMBOLS = "not an array"; diff --git a/js/xpconnect/tests/unit/component-file.js b/js/xpconnect/tests/unit/component-file.js index 13eba402f0ef..70321a2d0c2d 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]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(gComponentsArray); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(gComponentsArray); diff --git a/js/xpconnect/tests/unit/component_import.js b/js/xpconnect/tests/unit/component_import.js index 63a8d250393f..7f79e1d5c8cd 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]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(gComponentsArray); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(gComponentsArray); diff --git a/js/xpconnect/tests/unit/recursive_importA.jsm b/js/xpconnect/tests/unit/recursive_importA.jsm index d100e67cbf97..ebd9a2ddd9a1 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/. */ -var EXPORTED_SYMBOLS = ["foo", "bar"]; +this.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 30b1e3f6d972..6ef2b864470d 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/. */ -var EXPORTED_SYMBOLS = ["baz", "qux"]; +this.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 ccddd3788462..af4b7433a6b0 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" }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([RefTestCmdLineHandler]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RefTestCmdLineHandler]); diff --git a/layout/tools/reftest/reftest.js b/layout/tools/reftest/reftest.js index 42f76d385bd4..f3de4a5a8250 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 -var EXPORTED_SYMBOLS = ["OnRefTestLoad"]; +this.EXPORTED_SYMBOLS = ["OnRefTestLoad"]; #endif @@ -202,7 +202,7 @@ function IDForEventTarget(event) } } -function OnRefTestLoad(win) +this.OnRefTestLoad = 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 4a0a1f38c34d..60172575a9ac 100644 --- a/mobile/android/components/AboutRedirector.js +++ b/mobile/android/components/AboutRedirector.js @@ -112,4 +112,4 @@ AboutRedirector.prototype = { }; const components = [AboutRedirector]; -const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/mobile/android/components/AddonUpdateService.js b/mobile/android/components/AddonUpdateService.js index be7647224627..6e7603aa5261 100644 --- a/mobile/android/components/AddonUpdateService.js +++ b/mobile/android/components/AddonUpdateService.js @@ -197,5 +197,5 @@ var RecommendedSearchResults = { } } -const NSGetFactory = XPCOMUtils.generateNSGetFactory([AddonUpdateService]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AddonUpdateService]); diff --git a/mobile/android/components/AlertsService.js b/mobile/android/components/AlertsService.js index e4cdd71b4d95..e07e38f5f6ac 100644 --- a/mobile/android/components/AlertsService.js +++ b/mobile/android/components/AlertsService.js @@ -24,4 +24,4 @@ AlertsService.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([AlertsService]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AlertsService]); diff --git a/mobile/android/components/BlocklistPrompt.js b/mobile/android/components/BlocklistPrompt.js index ebf0aada38cd..81bf52ad7f77 100644 --- a/mobile/android/components/BlocklistPrompt.js +++ b/mobile/android/components/BlocklistPrompt.js @@ -57,5 +57,5 @@ BlocklistPrompt.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIBlocklistPrompt]) }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([BlocklistPrompt]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([BlocklistPrompt]); diff --git a/mobile/android/components/BrowserCLH.js b/mobile/android/components/BrowserCLH.js index 1e53ef67db0d..54fab3bf8746 100644 --- a/mobile/android/components/BrowserCLH.js +++ b/mobile/android/components/BrowserCLH.js @@ -115,4 +115,4 @@ BrowserCLH.prototype = { }; var components = [ BrowserCLH ]; -const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/mobile/android/components/ContentDispatchChooser.js b/mobile/android/components/ContentDispatchChooser.js index 4ca500bad1b6..03e7e28c0a42 100644 --- a/mobile/android/components/ContentDispatchChooser.js +++ b/mobile/android/components/ContentDispatchChooser.js @@ -34,5 +34,5 @@ ContentDispatchChooser.prototype = } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentDispatchChooser]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentDispatchChooser]); diff --git a/mobile/android/components/ContentPermissionPrompt.js b/mobile/android/components/ContentPermissionPrompt.js index 8f1067a38ea2..c7602dbca3ea 100644 --- a/mobile/android/components/ContentPermissionPrompt.js +++ b/mobile/android/components/ContentPermissionPrompt.js @@ -98,4 +98,4 @@ ContentPermissionPrompt.prototype = { //module initialization -const NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermissionPrompt]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermissionPrompt]); diff --git a/mobile/android/components/DirectoryProvider.js b/mobile/android/components/DirectoryProvider.js index 01430f148b2a..62b0184e5c47 100644 --- a/mobile/android/components/DirectoryProvider.js +++ b/mobile/android/components/DirectoryProvider.js @@ -56,5 +56,5 @@ DirectoryProvider.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]); diff --git a/mobile/android/components/DownloadManagerUI.js b/mobile/android/components/DownloadManagerUI.js index 79a4b691e0b0..befb28d06728 100644 --- a/mobile/android/components/DownloadManagerUI.js +++ b/mobile/android/components/DownloadManagerUI.js @@ -43,4 +43,4 @@ DownloadManagerUI.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIDownloadManagerUI]) }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadManagerUI]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadManagerUI]); diff --git a/mobile/android/components/FormAutoComplete.js b/mobile/android/components/FormAutoComplete.js index d4ab286dedf3..eb31d48fc743 100644 --- a/mobile/android/components/FormAutoComplete.js +++ b/mobile/android/components/FormAutoComplete.js @@ -134,4 +134,4 @@ FormAutoComplete.prototype = { }; let components = [FormAutoComplete]; -const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/mobile/android/components/HelperAppDialog.js b/mobile/android/components/HelperAppDialog.js index 3d0c688e5d4d..cfc3d74d40b2 100644 --- a/mobile/android/components/HelperAppDialog.js +++ b/mobile/android/components/HelperAppDialog.js @@ -213,4 +213,4 @@ HelperAppLauncherDialog.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([HelperAppLauncherDialog]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([HelperAppLauncherDialog]); diff --git a/mobile/android/components/LoginManagerPrompter.js b/mobile/android/components/LoginManagerPrompter.js index 07c089ac403a..c16440a1b0ca 100644 --- a/mobile/android/components/LoginManagerPrompter.js +++ b/mobile/android/components/LoginManagerPrompter.js @@ -516,5 +516,5 @@ LoginManagerPrompter.prototype = { var component = [LoginManagerPrompter]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/mobile/android/components/PromptService.js b/mobile/android/components/PromptService.js index cd5f29778b1c..c5ce54aaaf2b 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"); }); -const NSGetFactory = XPCOMUtils.generateNSGetFactory([PromptService]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PromptService]); diff --git a/mobile/android/components/SafeBrowsing.jsm b/mobile/android/components/SafeBrowsing.jsm index 9041d548a497..82fca71d77e0 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/. */ -var EXPORTED_SYMBOLS = ["SafeBrowsing"]; +this.EXPORTED_SYMBOLS = ["SafeBrowsing"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -24,7 +24,7 @@ function log(...stuff) { dump(msg + "\n"); } -var SafeBrowsing = { +this.SafeBrowsing = { init: function() { if (this.initialized) { diff --git a/mobile/android/components/SessionStore.js b/mobile/android/components/SessionStore.js index 8f8c18db24c0..ff7677233e68 100644 --- a/mobile/android/components/SessionStore.js +++ b/mobile/android/components/SessionStore.js @@ -1042,4 +1042,4 @@ SessionStore.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStore]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStore]); diff --git a/mobile/android/components/Sidebar.js b/mobile/android/components/Sidebar.js index c0356e2c4463..ef3a7d683a94 100644 --- a/mobile/android/components/Sidebar.js +++ b/mobile/android/components/Sidebar.js @@ -146,4 +146,4 @@ Sidebar.prototype = { classID: SIDEBAR_CID, }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([Sidebar]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([Sidebar]); diff --git a/mobile/android/components/XPIDialogService.js b/mobile/android/components/XPIDialogService.js index 1f96c3a9c773..88a8821eac84 100644 --- a/mobile/android/components/XPIDialogService.js +++ b/mobile/android/components/XPIDialogService.js @@ -36,4 +36,4 @@ WebInstallPrompt.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([WebInstallPrompt]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WebInstallPrompt]); diff --git a/mobile/android/modules/JNI.jsm b/mobile/android/modules/JNI.jsm index 5dbccbc7972c..aca61e9f461d 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(); */ -let EXPORTED_SYMBOLS = ["JNI"]; +this.EXPORTED_SYMBOLS = ["JNI"]; Components.utils.import("resource://gre/modules/ctypes.jsm") Components.utils.import("resource://gre/modules/Services.jsm") -function JNI() { } +this.JNI = function JNI() { } JNI.prototype = { get lib() { diff --git a/mobile/android/modules/LocaleRepository.jsm b/mobile/android/modules/LocaleRepository.jsm index 41bec43269e3..18fa7ec2a3db 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/. */ -let EXPORTED_SYMBOLS = ["LocaleRepository"]; +this.EXPORTED_SYMBOLS = ["LocaleRepository"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -24,7 +24,7 @@ const STRING_KEY_MAP = { strings: "strings" }; -var LocaleRepository = { +this.LocaleRepository = { loggingEnabled: false, log: function(aMessage) { diff --git a/mobile/android/modules/contacts.jsm b/mobile/android/modules/contacts.jsm index b3e0ec49964c..88a61083e228 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/. */ -let EXPORTED_SYMBOLS = ["Contacts"]; +this.EXPORTED_SYMBOLS = ["Contacts"]; const Cu = Components.utils; -let Contacts = { +this.Contacts = { _providers: [], _contacts: [], diff --git a/mobile/android/modules/linuxTypes.jsm b/mobile/android/modules/linuxTypes.jsm index 3719c5cd1fae..49b1c55c29df 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/. */ -let EXPORTED_SYMBOLS = ["GLib", "EBook"]; +this.EXPORTED_SYMBOLS = ["GLib", "EBook"]; const Cu = Components.utils; Cu.import("resource://gre/modules/ctypes.jsm"); -let GLib = { +this.GLib = { lib: null, init: function glib_init() { @@ -31,7 +31,7 @@ let GLib = { } }; -let EBook = { +this.EBook = { lib: null, E_CONTACT_FULL_NAME: 4, diff --git a/mobile/android/modules/video.jsm b/mobile/android/modules/video.jsm index bad67a3e83d7..10e142b49175 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/. */ -var EXPORTED_SYMBOLS = ["Video"]; +this.EXPORTED_SYMBOLS = ["Video"]; -var Video = { +this.Video = { fullScreenSourceElement: null }; diff --git a/mobile/xul/components/AboutRedirector.js b/mobile/xul/components/AboutRedirector.js index 9657961001ca..eb5222d78fba 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]; -const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/mobile/xul/components/AddonUpdateService.js b/mobile/xul/components/AddonUpdateService.js index 5b77093a1b32..1d1acecef4b8 100644 --- a/mobile/xul/components/AddonUpdateService.js +++ b/mobile/xul/components/AddonUpdateService.js @@ -198,5 +198,5 @@ var RecommendedSearchResults = { } } -const NSGetFactory = XPCOMUtils.generateNSGetFactory([AddonUpdateService]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AddonUpdateService]); diff --git a/mobile/xul/components/AlertsService.js b/mobile/xul/components/AlertsService.js index e4cdd71b4d95..e07e38f5f6ac 100644 --- a/mobile/xul/components/AlertsService.js +++ b/mobile/xul/components/AlertsService.js @@ -24,4 +24,4 @@ AlertsService.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([AlertsService]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AlertsService]); diff --git a/mobile/xul/components/AutoCompleteCache.js b/mobile/xul/components/AutoCompleteCache.js index a74dc7f01c11..7bc4920bd86a 100644 --- a/mobile/xul/components/AutoCompleteCache.js +++ b/mobile/xul/components/AutoCompleteCache.js @@ -364,4 +364,4 @@ BookmarkObserver.prototype = { }; const components = [AutoCompleteCache, BookmarkObserver]; -const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/mobile/xul/components/BlocklistPrompt.js b/mobile/xul/components/BlocklistPrompt.js index ebf0aada38cd..81bf52ad7f77 100644 --- a/mobile/xul/components/BlocklistPrompt.js +++ b/mobile/xul/components/BlocklistPrompt.js @@ -57,5 +57,5 @@ BlocklistPrompt.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIBlocklistPrompt]) }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([BlocklistPrompt]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([BlocklistPrompt]); diff --git a/mobile/xul/components/BrowserCLH.js b/mobile/xul/components/BrowserCLH.js index f831ce3c0075..f5572cca3d0c 100644 --- a/mobile/xul/components/BrowserCLH.js +++ b/mobile/xul/components/BrowserCLH.js @@ -271,4 +271,4 @@ BrowserCLH.prototype = { }; var components = [ BrowserCLH ]; -const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/mobile/xul/components/BrowserStartup.js b/mobile/xul/components/BrowserStartup.js index 3bb286f56a1c..c0a06c662b75 100644 --- a/mobile/xul/components/BrowserStartup.js +++ b/mobile/xul/components/BrowserStartup.js @@ -128,4 +128,4 @@ BrowserStartup.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([BrowserStartup]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([BrowserStartup]); diff --git a/mobile/xul/components/CapturePicker.js b/mobile/xul/components/CapturePicker.js index cd5d392f95cf..8458dfcf4543 100644 --- a/mobile/xul/components/CapturePicker.js +++ b/mobile/xul/components/CapturePicker.js @@ -82,4 +82,4 @@ CapturePicker.prototype = { }; var components = [ CapturePicker ]; -const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/mobile/xul/components/ContentDispatchChooser.js b/mobile/xul/components/ContentDispatchChooser.js index 4ca500bad1b6..03e7e28c0a42 100644 --- a/mobile/xul/components/ContentDispatchChooser.js +++ b/mobile/xul/components/ContentDispatchChooser.js @@ -34,5 +34,5 @@ ContentDispatchChooser.prototype = } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentDispatchChooser]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentDispatchChooser]); diff --git a/mobile/xul/components/ContentPermissionPrompt.js b/mobile/xul/components/ContentPermissionPrompt.js index de8d0e941fe9..0c66d7bf493d 100644 --- a/mobile/xul/components/ContentPermissionPrompt.js +++ b/mobile/xul/components/ContentPermissionPrompt.js @@ -126,4 +126,4 @@ ContentPermissionPrompt.prototype = { //module initialization -const NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermissionPrompt]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermissionPrompt]); diff --git a/mobile/xul/components/DirectoryProvider.js b/mobile/xul/components/DirectoryProvider.js index b36dbeb56769..b9318b2d3603 100644 --- a/mobile/xul/components/DirectoryProvider.js +++ b/mobile/xul/components/DirectoryProvider.js @@ -63,5 +63,5 @@ DirectoryProvider.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]); diff --git a/mobile/xul/components/DownloadManagerUI.js b/mobile/xul/components/DownloadManagerUI.js index 79a4b691e0b0..befb28d06728 100644 --- a/mobile/xul/components/DownloadManagerUI.js +++ b/mobile/xul/components/DownloadManagerUI.js @@ -43,4 +43,4 @@ DownloadManagerUI.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIDownloadManagerUI]) }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadManagerUI]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DownloadManagerUI]); diff --git a/mobile/xul/components/FormAutoComplete.js b/mobile/xul/components/FormAutoComplete.js index d4ab286dedf3..eb31d48fc743 100644 --- a/mobile/xul/components/FormAutoComplete.js +++ b/mobile/xul/components/FormAutoComplete.js @@ -134,4 +134,4 @@ FormAutoComplete.prototype = { }; let components = [FormAutoComplete]; -const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/mobile/xul/components/HelperAppDialog.js b/mobile/xul/components/HelperAppDialog.js index 6cf561ce410f..f12fbdc472bd 100644 --- a/mobile/xul/components/HelperAppDialog.js +++ b/mobile/xul/components/HelperAppDialog.js @@ -217,4 +217,4 @@ HelperAppLauncherDialog.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([HelperAppLauncherDialog]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([HelperAppLauncherDialog]); diff --git a/mobile/xul/components/LoginManager.js b/mobile/xul/components/LoginManager.js index 9724c559a5db..d9ed14d80205 100644 --- a/mobile/xul/components/LoginManager.js +++ b/mobile/xul/components/LoginManager.js @@ -683,4 +683,4 @@ UserAutoCompleteResult.prototype = { } }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([LoginManager]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([LoginManager]); diff --git a/mobile/xul/components/LoginManagerPrompter.js b/mobile/xul/components/LoginManagerPrompter.js index 081bd9d0269a..35cebc46c806 100644 --- a/mobile/xul/components/LoginManagerPrompter.js +++ b/mobile/xul/components/LoginManagerPrompter.js @@ -606,5 +606,5 @@ LoginManagerPrompter.prototype = { var component = [LoginManagerPrompter]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/mobile/xul/components/PromptService.js b/mobile/xul/components/PromptService.js index b9dcf1fd25eb..de780b04be22 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"); }); -const NSGetFactory = XPCOMUtils.generateNSGetFactory([PromptService]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PromptService]); diff --git a/mobile/xul/components/SafeBrowsing.js b/mobile/xul/components/SafeBrowsing.js index f1d252c8335d..d1d31bcf5d59 100644 --- a/mobile/xul/components/SafeBrowsing.js +++ b/mobile/xul/components/SafeBrowsing.js @@ -165,4 +165,4 @@ SafeBrowsing.prototype = { } } -const NSGetFactory = XPCOMUtils.generateNSGetFactory([SafeBrowsing]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SafeBrowsing]); diff --git a/mobile/xul/components/SessionStore.js b/mobile/xul/components/SessionStore.js index d3626b3d202a..3b3839e3c24d 100644 --- a/mobile/xul/components/SessionStore.js +++ b/mobile/xul/components/SessionStore.js @@ -778,4 +778,4 @@ SessionStore.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStore]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SessionStore]); diff --git a/mobile/xul/components/Sidebar.js b/mobile/xul/components/Sidebar.js index c0356e2c4463..ef3a7d683a94 100644 --- a/mobile/xul/components/Sidebar.js +++ b/mobile/xul/components/Sidebar.js @@ -146,4 +146,4 @@ Sidebar.prototype = { classID: SIDEBAR_CID, }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([Sidebar]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([Sidebar]); diff --git a/mobile/xul/components/UpdatePrompt.js b/mobile/xul/components/UpdatePrompt.js index 4eb3f73383bf..02fe596ac649 100644 --- a/mobile/xul/components/UpdatePrompt.js +++ b/mobile/xul/components/UpdatePrompt.js @@ -305,4 +305,4 @@ UpdatePrompt.prototype = { }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([UpdatePrompt]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([UpdatePrompt]); diff --git a/mobile/xul/components/XPIDialogService.js b/mobile/xul/components/XPIDialogService.js index 584e238d736a..f31ecdea5e8d 100644 --- a/mobile/xul/components/XPIDialogService.js +++ b/mobile/xul/components/XPIDialogService.js @@ -45,4 +45,4 @@ WebInstallPrompt.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([WebInstallPrompt]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([WebInstallPrompt]); diff --git a/mobile/xul/modules/LocaleRepository.jsm b/mobile/xul/modules/LocaleRepository.jsm index 41bec43269e3..18fa7ec2a3db 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/. */ -let EXPORTED_SYMBOLS = ["LocaleRepository"]; +this.EXPORTED_SYMBOLS = ["LocaleRepository"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -24,7 +24,7 @@ const STRING_KEY_MAP = { strings: "strings" }; -var LocaleRepository = { +this.LocaleRepository = { loggingEnabled: false, log: function(aMessage) { diff --git a/mobile/xul/modules/contacts.jsm b/mobile/xul/modules/contacts.jsm index 6e8b274d2338..d82746c94867 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/. */ -let EXPORTED_SYMBOLS = ["Contacts"]; +this.EXPORTED_SYMBOLS = ["Contacts"]; const Cu = Components.utils; -let Contacts = { +this.Contacts = { _providers: [], _contacts: [], diff --git a/mobile/xul/modules/linuxTypes.jsm b/mobile/xul/modules/linuxTypes.jsm index 3719c5cd1fae..49b1c55c29df 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/. */ -let EXPORTED_SYMBOLS = ["GLib", "EBook"]; +this.EXPORTED_SYMBOLS = ["GLib", "EBook"]; const Cu = Components.utils; Cu.import("resource://gre/modules/ctypes.jsm"); -let GLib = { +this.GLib = { lib: null, init: function glib_init() { @@ -31,7 +31,7 @@ let GLib = { } }; -let EBook = { +this.EBook = { lib: null, E_CONTACT_FULL_NAME: 4, diff --git a/mobile/xul/modules/video.jsm b/mobile/xul/modules/video.jsm index bad67a3e83d7..10e142b49175 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/. */ -var EXPORTED_SYMBOLS = ["Video"]; +this.EXPORTED_SYMBOLS = ["Video"]; -var Video = { +this.Video = { fullScreenSourceElement: null }; diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index 47c17bdda307..7136fdcb66c9 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -3818,6 +3818,12 @@ 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 1e09a2204a84..50dbf07a3b27 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/. */ -let EXPORTED_SYMBOLS = [ +this.EXPORTED_SYMBOLS = [ "NetUtil", ]; @@ -25,7 +25,7 @@ const PR_UINT32_MAX = 0xffffffff; //////////////////////////////////////////////////////////////////////////////// //// NetUtil Object -const NetUtil = { +this.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 51ad4106305a..089a549218ec 100644 --- a/netwerk/protocol/app/AppProtocolHandler.js +++ b/netwerk/protocol/app/AppProtocolHandler.js @@ -75,4 +75,4 @@ AppProtocolHandler.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([AppProtocolHandler]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AppProtocolHandler]); diff --git a/netwerk/protocol/http/UserAgentOverrides.jsm b/netwerk/protocol/http/UserAgentOverrides.jsm index d7bae185404e..481f5200e88e 100644 --- a/netwerk/protocol/http/UserAgentOverrides.jsm +++ b/netwerk/protocol/http/UserAgentOverrides.jsm @@ -4,7 +4,7 @@ "use strict"; -var EXPORTED_SYMBOLS = [ "UserAgentOverrides" ]; +this.EXPORTED_SYMBOLS = [ "UserAgentOverrides" ]; const Ci = Components.interfaces; const Cc = Components.classes; @@ -23,7 +23,7 @@ var gOverrideFunctions = [ function (aHttpChannel) UserAgentOverrides.getOverrideForURI(aHttpChannel.URI) ]; -var UserAgentOverrides = { +this.UserAgentOverrides = { init: function uao_init() { if (gInitialized) return; diff --git a/netwerk/test/httpserver/httpd.js b/netwerk/test/httpserver/httpd.js index 03ead581747b..16f1663f8014 100644 --- a/netwerk/test/httpserver/httpd.js +++ b/netwerk/test/httpserver/httpd.js @@ -5236,7 +5236,7 @@ Request.prototype = // XPCOM trappings -var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsHttpServer]); +this.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 d90d6f8f4600..e622d09102e5 100644 --- a/services/aitc/Aitc.js +++ b/services/aitc/Aitc.js @@ -101,4 +101,4 @@ AboutApps.prototype = { }; const components = [AitcService, AboutApps]; -const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/services/aitc/modules/browserid.js b/services/aitc/modules/browserid.js index 41d82271ba6a..990474137f6f 100644 --- a/services/aitc/modules/browserid.js +++ b/services/aitc/modules/browserid.js @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = ["BrowserID"]; +this.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 ef630431b033..fdf4d775ac16 100644 --- a/services/aitc/modules/client.js +++ b/services/aitc/modules/client.js @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = ["AitcClient"]; +this.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. */ -function AitcClient(token, state) { +this.AitcClient = 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 075a4c79ff82..6e0219793da8 100644 --- a/services/aitc/modules/main.js +++ b/services/aitc/modules/main.js @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = ["Aitc"]; +this.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"); -function Aitc() { +this.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 d13bfb3f7329..03aff26f135f 100644 --- a/services/aitc/modules/manager.js +++ b/services/aitc/modules/manager.js @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = ["AitcManager"]; +this.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. */ -function AitcManager(cb, premadeClient, premadeToken) { +this.AitcManager = 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 bf64a4eb4e91..566aa3d3b436 100644 --- a/services/aitc/modules/storage.js +++ b/services/aitc/modules/storage.js @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = ["AitcStorage", "AitcQueue"]; +this.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. * */ -function AitcQueue(filename, cb) { +this.AitcQueue = 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 f2047a31b692..e27d14a11625 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/. */ -const EXPORTED_SYMBOLS = ["Async"]; +this.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. */ -let Async = { +this.Async = { /** * Execute an arbitrary number of asynchronous functions one after the diff --git a/services/common/log4moz.js b/services/common/log4moz.js index 713e72353450..5512cb559440 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/. */ -const EXPORTED_SYMBOLS = ['Log4Moz']; +this.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"); -let Log4Moz = { +this.Log4Moz = { Level: { Fatal: 70, Error: 60, diff --git a/services/common/modules-testing/aitcserver.js b/services/common/modules-testing/aitcserver.js index 3fad0b20806c..daa29af3d1dc 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; -const EXPORTED_SYMBOLS = [ +this.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. */ -function AITCServer10User() { +this.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. */ -function AITCServer10Server() { +this.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 caba912bf13d..3ef88e698dc0 100644 --- a/services/common/modules-testing/logging.js +++ b/services/common/modules-testing/logging.js @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = [ +this.EXPORTED_SYMBOLS = [ "getTestLogger", "initTestLogging", ]; @@ -13,7 +13,7 @@ const {utils: Cu} = Components; Cu.import("resource://services-common/log4moz.js"); -function initTestLogging(level) { +this.initTestLogging = function initTestLogging(level) { function LogStats() { this.errorsLogged = 0; } @@ -48,7 +48,7 @@ function initTestLogging(level) { return logStats; } -function getTestLogger(component) { +this.getTestLogger = 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 42ddcddae2b3..11ae06fff504 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; -const EXPORTED_SYMBOLS = [ +this.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. */ -function ServerBSO(id, payload, modified) { +this.ServerBSO = function ServerBSO(id, payload, modified) { if (!id) { throw new Error("No ID for ServerBSO!"); } @@ -274,7 +274,8 @@ ServerBSO.prototype = { * An optional timestamp value to initialize the modified time of the * collection. This should be in the format returned by new_timestamp(). */ -function StorageServerCollection(bsos, acceptNew, timestamp=new_timestamp()) { +this.StorageServerCollection = + function StorageServerCollection(bsos, acceptNew, timestamp=new_timestamp()) { this._bsos = bsos || {}; this.acceptNew = acceptNew || false; @@ -848,7 +849,7 @@ StorageServerCollection.prototype = { * find out what it needs without monkeypatching. Use this object as your * prototype, and override as appropriate. */ -let StorageServerCallback = { +this.StorageServerCallback = { onCollectionDeleted: function onCollectionDeleted(user, collection) {}, onItemDeleted: function onItemDeleted(user, collection, bsoID) {}, @@ -865,7 +866,7 @@ let StorageServerCallback = { * Construct a new test Storage server. Takes a callback object (e.g., * StorageServerCallback) as input. */ -function StorageServer(callback) { +this.StorageServer = function StorageServer(callback) { this.callback = callback || {__proto__: StorageServerCallback}; this.server = new HttpServer(); this.started = false; @@ -1644,7 +1645,8 @@ StorageServer.prototype = { * * Each user is specified by a map of username to password. */ -function storageServerForUsers(users, contents, callback) { +this.storageServerForUsers = + 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 a588b78ddffa..ee7e56aa57db 100644 --- a/services/common/modules-testing/utils.js +++ b/services/common/modules-testing/utils.js @@ -4,11 +4,11 @@ "use strict"; -const EXPORTED_SYMBOLS = [ +this.EXPORTED_SYMBOLS = [ "TestingUtils", ]; -let TestingUtils = { +this.TestingUtils = { /** * Perform a deep copy of an Array or Object. */ diff --git a/services/common/observers.js b/services/common/observers.js index 1bd23d720ba3..957d958e0988 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/. */ -let EXPORTED_SYMBOLS = ["Observers"]; +this.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 */ -let Observers = { +this.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 dec58a9bb8fb..44477d58ed12 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/. */ -let EXPORTED_SYMBOLS = ["Preferences"]; +this.EXPORTED_SYMBOLS = ["Preferences"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -18,7 +18,8 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm"); const MAX_INT = Math.pow(2, 31) - 1; const MIN_INT = -MAX_INT; -function Preferences(args) { +this.Preferences = + 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 63110b67b566..0ceb878ffb65 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; -const EXPORTED_SYMBOLS = [ +this.EXPORTED_SYMBOLS = [ "RESTRequest", "RESTResponse", "TokenAuthenticatedRESTRequest" @@ -74,7 +74,7 @@ const Prefs = new Preferences("services.common.rest."); * }); * request.get(); */ -function RESTRequest(uri) { +this.RESTRequest = 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. */ -function RESTResponse() { +this.RESTResponse = function RESTResponse() { this._log = Log4Moz.repository.getLogger(this._logName); this._log.level = Log4Moz.Level[Prefs.get("log.logger.rest.response")]; @@ -671,7 +671,8 @@ RESTResponse.prototype = { * nonce, and ext. See CrytoUtils.computeHTTPMACSHA1 for information on * the purpose of these values. */ -function TokenAuthenticatedRESTRequest(uri, authToken, extra) { +this.TokenAuthenticatedRESTRequest = + 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 a1af5ea8e025..89670a31a5da 100644 --- a/services/common/storageservice.js +++ b/services/common/storageservice.js @@ -25,7 +25,7 @@ "use strict"; -const EXPORTED_SYMBOLS = [ +this.EXPORTED_SYMBOLS = [ "BasicStorageObject", "StorageServiceClient", "StorageServiceRequestError", @@ -70,7 +70,8 @@ const Prefs = new Preferences("services.common.storageservice."); * (string) ID of BSO. Can be null. * (string) Collection BSO belongs to. Can be null; */ -function BasicStorageObject(id=null, collection=null) { +this.BasicStorageObject = + function BasicStorageObject(id=null, collection=null) { this.data = {}; this.id = id; this.collection = collection; @@ -266,7 +267,7 @@ BasicStorageObject.prototype = { * never happen. But, it does. If set, this will be an Error which * describes the error as reported by the server. */ -function StorageServiceRequestError() { +this.StorageServiceRequestError = function StorageServiceRequestError() { this.serverModified = false; this.notFound = false; this.conflict = false; @@ -1519,7 +1520,7 @@ Object.freeze(StorageCollectionBatchedDelete.prototype); * @param baseURI * (string) Base URI for all requests. */ -function StorageServiceClient(baseURI) { +this.StorageServiceClient = 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 22fc5446da7d..230fd78a612d 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/. */ -const EXPORTED_SYMBOLS = ["StringBundle"]; +this.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 */ -function StringBundle(url) { +this.StringBundle = function StringBundle(url) { this.url = url; } diff --git a/services/common/tokenserverclient.js b/services/common/tokenserverclient.js index f80eaabf121a..db7f4cf879ca 100644 --- a/services/common/tokenserverclient.js +++ b/services/common/tokenserverclient.js @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = [ +this.EXPORTED_SYMBOLS = [ "TokenServerClient", "TokenServerClientError", "TokenServerClientNetworkError", @@ -28,7 +28,7 @@ const Prefs = new Preferences("services.common.tokenserverclient."); * @param message * (string) Error message. */ -function TokenServerClientError(message) { +this.TokenServerClientError = function TokenServerClientError(message) { this.name = "TokenServerClientError"; this.message = message || "Client error."; } @@ -41,7 +41,8 @@ TokenServerClientError.prototype.constructor = TokenServerClientError; * @param error * The underlying error thrown by the network layer. */ -function TokenServerClientNetworkError(error) { +this.TokenServerClientNetworkError = + function TokenServerClientNetworkError(error) { this.name = "TokenServerClientNetworkError"; this.error = error; } @@ -79,7 +80,8 @@ TokenServerClientNetworkError.prototype.constructor = * @param message * (string) Error message. */ -function TokenServerClientServerError(message, cause="general") { +this.TokenServerClientServerError = + function TokenServerClientServerError(message, cause="general") { this.name = "TokenServerClientServerError"; this.message = message || "Server error."; this.cause = cause; @@ -111,7 +113,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). */ -function TokenServerClient() { +this.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 1899469b177e..abb64318598e 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; -const EXPORTED_SYMBOLS = ["CommonUtils"]; +this.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"); -let CommonUtils = { +this.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 771b91023149..f7583e4cb3eb 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/. */ -const EXPORTED_SYMBOLS = ["WeaveCrypto"]; +this.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; -function WeaveCrypto() { +this.WeaveCrypto = function WeaveCrypto() { this.init(); } diff --git a/services/crypto/modules/utils.js b/services/crypto/modules/utils.js index dc7185df2fc5..c507813a5f41 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; -const EXPORTED_SYMBOLS = ["CryptoUtils"]; +this.EXPORTED_SYMBOLS = ["CryptoUtils"]; Cu.import("resource://services-common/observers.js"); Cu.import("resource://services-common/utils.js"); Cu.import("resource://gre/modules/XPCOMUtils.jsm"); -let CryptoUtils = { +this.CryptoUtils = { /** * Generate a string of random bytes. */ diff --git a/services/notifications/service.js b/services/notifications/service.js index 514b0aacc9fb..fc52a515a411 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/. */ -const EXPORTED_SYMBOLS = ["Service"]; +this.EXPORTED_SYMBOLS = ["Service"]; const {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components; @@ -24,5 +24,5 @@ NotificationSvc.prototype = { } }; -let Service = new NotificationSvc(); +this.Service = new NotificationSvc(); Service.onStartup(); diff --git a/services/sync/Weave.js b/services/sync/Weave.js index 2af3608db91c..ae4c348cc217 100644 --- a/services/sync/Weave.js +++ b/services/sync/Weave.js @@ -70,4 +70,4 @@ AboutWeaveLog.prototype = { }; const components = [WeaveService, AboutWeaveLog]; -const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/services/sync/modules-testing/fakeservices.js b/services/sync/modules-testing/fakeservices.js index 48e4922c88c5..b7c17b3d9be0 100644 --- a/services/sync/modules-testing/fakeservices.js +++ b/services/sync/modules-testing/fakeservices.js @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = [ +this.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; -function FakeFilesystemService(contents) { +this.FakeFilesystemService = function FakeFilesystemService(contents) { this.fakeContents = contents; let self = this; @@ -38,7 +38,7 @@ function FakeFilesystemService(contents) { }; }; -function fakeSHA256HMAC(message) { +this.fakeSHA256HMAC = function fakeSHA256HMAC(message) { message = message.substr(0, 64); while (message.length < 64) { message += " "; @@ -46,7 +46,7 @@ function fakeSHA256HMAC(message) { return message; } -function FakeGUIDService() { +this.FakeGUIDService = function FakeGUIDService() { let latestGUID = 0; Utils.makeGUID = function makeGUID() { @@ -58,7 +58,7 @@ function FakeGUIDService() { * Mock implementation of WeaveCrypto. It does not encrypt or * decrypt, merely returning the input verbatim. */ -function FakeCryptoService() { +this.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 1104af9192c3..d86c1a75e445 100644 --- a/services/sync/modules-testing/rotaryengine.js +++ b/services/sync/modules-testing/rotaryengine.js @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = [ +this.EXPORTED_SYMBOLS = [ "RotaryEngine", "RotaryRecord", "RotaryStore", @@ -24,7 +24,7 @@ Cu.import("resource://services-sync/util.js"); * Complete with record, store, and tracker implementations. */ -function RotaryRecord(collection, id) { +this.RotaryRecord = function RotaryRecord(collection, id) { CryptoWrapper.call(this, collection, id); } RotaryRecord.prototype = { @@ -32,7 +32,7 @@ RotaryRecord.prototype = { }; Utils.deferGetSet(RotaryRecord, "cleartext", ["denomination"]); -function RotaryStore(engine) { +this.RotaryStore = function RotaryStore(engine) { Store.call(this, "Rotary", engine); this.items = {}; } @@ -88,7 +88,7 @@ RotaryStore.prototype = { } }; -function RotaryTracker(engine) { +this.RotaryTracker = function RotaryTracker(engine) { Tracker.call(this, "Rotary", engine); } RotaryTracker.prototype = { @@ -96,7 +96,7 @@ RotaryTracker.prototype = { }; -function RotaryEngine(service) { +this.RotaryEngine = 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 8a06e346b74d..33b10ed37a2e 100644 --- a/services/sync/modules-testing/utils.js +++ b/services/sync/modules-testing/utils.js @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = [ +this.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"); -const TEST_SERVER_URL = "http://localhost:8080/"; -const TEST_CLUSTER_URL = TEST_SERVER_URL; +this.TEST_SERVER_URL = "http://localhost:8080/"; +this.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). */ -function waitForZeroTimer(callback) { +this.waitForZeroTimer = function waitForZeroTimer(callback) { let ticks = 2; function wait() { if (ticks) { @@ -42,7 +42,8 @@ function waitForZeroTimer(callback) { CommonUtils.namedTimer(wait, 150, {}, "timer"); } -function setBasicCredentials(username, password, syncKey) { +this.setBasicCredentials = + function setBasicCredentials(username, password, syncKey) { let ns = {}; Cu.import("resource://services-sync/service.js", ns); @@ -52,7 +53,8 @@ function setBasicCredentials(username, password, syncKey) { auth.syncKey = syncKey; } -function SyncTestingInfrastructure(username, password, syncKey) { +this.SyncTestingInfrastructure = + function SyncTestingInfrastructure(username, password, syncKey) { let ns = {}; Cu.import("resource://services-sync/service.js", ns); @@ -73,7 +75,7 @@ function SyncTestingInfrastructure(username, password, syncKey) { /** * Turn WBO cleartext into fake "encrypted" payload as it goes over the wire. */ -function encryptPayload(cleartext) { +this.encryptPayload = 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 f222540db092..9308a46fca5e 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"; -const CHANGE_INSTALLED = 1; -const CHANGE_UNINSTALLED = 2; -const CHANGE_ENABLED = 3; -const CHANGE_DISABLED = 4; +this.CHANGE_INSTALLED = 1; +this.CHANGE_UNINSTALLED = 2; +this.CHANGE_ENABLED = 3; +this.CHANGE_DISABLED = 4; -const EXPORTED_SYMBOLS = ["AddonsReconciler", "CHANGE_INSTALLED", - "CHANGE_UNINSTALLED", "CHANGE_ENABLED", - "CHANGE_DISABLED"]; +this.EXPORTED_SYMBOLS = ["AddonsReconciler", "CHANGE_INSTALLED", + "CHANGE_UNINSTALLED", "CHANGE_ENABLED", + "CHANGE_DISABLED"]; /** * Maintains state of add-ons. * @@ -113,7 +113,7 @@ const 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. */ -function AddonsReconciler() { +this.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 ea693a20fa68..fee7649f61ba 100644 --- a/services/sync/modules/addonutils.js +++ b/services/sync/modules/addonutils.js @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = ["AddonUtils"]; +this.EXPORTED_SYMBOLS = ["AddonUtils"]; const {interfaces: Ci, utils: Cu} = Components; diff --git a/services/sync/modules/engines.js b/services/sync/modules/engines.js index 256b70626a48..f0ca10f7e332 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/. */ -const EXPORTED_SYMBOLS = [ +this.EXPORTED_SYMBOLS = [ "EngineManager", "Engine", "SyncEngine", @@ -33,7 +33,7 @@ Cu.import("resource://services-sync/util.js"); * want to sync. * */ -function Tracker(name, engine) { +this.Tracker = 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. */ -function Store(name, engine) { +this.Store = function Store(name, engine) { if (!engine) { throw new Error("Store must be associated with an Engine instance."); } @@ -362,7 +362,7 @@ Store.prototype = { } }; -function EngineManager(service) { +this.EngineManager = function EngineManager(service) { this.service = service; this._engines = {}; @@ -449,7 +449,7 @@ EngineManager.prototype = { }, }; -function Engine(name, service) { +this.Engine = function Engine(name, service) { if (!service) { throw new Error("Engine must be associated with a Service instance."); } @@ -527,7 +527,7 @@ Engine.prototype = { } }; -function SyncEngine(name, service) { +this.SyncEngine = 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 b0b7e2c10287..c9299eb04964 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"); -const EXPORTED_SYMBOLS = ["AddonsEngine"]; +this.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. */ -function AddonsEngine(service) { +this.AddonsEngine = 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 ae35c409074a..58967acad411 100644 --- a/services/sync/modules/engines/apps.js +++ b/services/sync/modules/engines/apps.js @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = ['AppsEngine', 'AppRec']; +this.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"); -function AppRec(collection, id) { +this.AppRec = function AppRec(collection, id) { CryptoWrapper.call(this, collection, id); } @@ -123,7 +123,7 @@ AppTracker.prototype = { } } -function AppsEngine(service) { +this.AppsEngine = 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 ee105ca59c68..460ad2f6f265 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/. */ -const EXPORTED_SYMBOLS = ['BookmarksEngine', "PlacesItem", "Bookmark", - "BookmarkFolder", "BookmarkQuery", - "Livemark", "BookmarkSeparator"]; +this.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; -function PlacesItem(collection, id, type) { +this.PlacesItem = 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"]); -function Bookmark(collection, id, type) { +this.Bookmark = 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"]); -function BookmarkQuery(collection, id) { +this.BookmarkQuery = function BookmarkQuery(collection, id) { Bookmark.call(this, collection, id, "query"); } BookmarkQuery.prototype = { @@ -101,7 +101,7 @@ Utils.deferGetSet(BookmarkQuery, "cleartext", ["folderName", "queryId"]); -function BookmarkFolder(collection, id, type) { +this.BookmarkFolder = 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"]); -function Livemark(collection, id) { +this.Livemark = function Livemark(collection, id) { BookmarkFolder.call(this, collection, id, "livemark"); } Livemark.prototype = { @@ -122,7 +122,7 @@ Livemark.prototype = { Utils.deferGetSet(Livemark, "cleartext", ["siteUri", "feedUri"]); -function BookmarkSeparator(collection, id) { +this.BookmarkSeparator = function BookmarkSeparator(collection, id) { PlacesItem.call(this, collection, id, "separator"); } BookmarkSeparator.prototype = { @@ -191,7 +191,7 @@ let kSpecialIds = { get mobile() this.findMobileRoot(true), }; -function BookmarksEngine(service) { +this.BookmarksEngine = 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 c515a0ffdbea..432393c01f9e 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/. */ -const EXPORTED_SYMBOLS = [ +this.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 -function ClientsRec(collection, id) { +this.ClientsRec = function ClientsRec(collection, id) { CryptoWrapper.call(this, collection, id); } ClientsRec.prototype = { @@ -30,7 +30,7 @@ ClientsRec.prototype = { Utils.deferGetSet(ClientsRec, "cleartext", ["name", "type", "commands"]); -function ClientEngine(service) { +this.ClientEngine = 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 713c256f4ce6..fbbafac87b23 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/. */ -const EXPORTED_SYMBOLS = ['FormEngine', 'FormRec']; +this.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 -function FormRec(collection, id) { +this.FormRec = function FormRec(collection, id) { CryptoWrapper.call(this, collection, id); } FormRec.prototype = { @@ -151,7 +151,7 @@ let FormWrapper = { }; -function FormEngine(service) { +this.FormEngine = 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 6559947e4612..a97515733c70 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/. */ -const EXPORTED_SYMBOLS = ['HistoryEngine', 'HistoryRec']; +this.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"); -function HistoryRec(collection, id) { +this.HistoryRec = function HistoryRec(collection, id) { CryptoWrapper.call(this, collection, id); } HistoryRec.prototype = { @@ -31,7 +31,7 @@ HistoryRec.prototype = { Utils.deferGetSet(HistoryRec, "cleartext", ["histUri", "title", "visits"]); -function HistoryEngine(service) { +this.HistoryEngine = 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 cd045c092cd0..5952b01f3803 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/. */ -const EXPORTED_SYMBOLS = ['PasswordEngine', 'LoginRec']; +this.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"); -function LoginRec(collection, id) { +this.LoginRec = 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"]); -function PasswordEngine(service) { +this.PasswordEngine = 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 b5277691cfca..d6363c6f9e7f 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/. */ -const EXPORTED_SYMBOLS = ['PrefsEngine', 'PrefRec']; +this.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); -function PrefRec(collection, id) { +this.PrefRec = function PrefRec(collection, id) { CryptoWrapper.call(this, collection, id); } PrefRec.prototype = { @@ -31,7 +31,7 @@ PrefRec.prototype = { Utils.deferGetSet(PrefRec, "cleartext", ["value"]); -function PrefsEngine(service) { +this.PrefsEngine = 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 b7d63fe410f2..3b5a0bf48932 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/. */ -const EXPORTED_SYMBOLS = ['TabEngine', 'TabSetRecord']; +this.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."); -function TabSetRecord(collection, id) { +this.TabSetRecord = function TabSetRecord(collection, id) { CryptoWrapper.call(this, collection, id); } TabSetRecord.prototype = { @@ -38,7 +38,7 @@ TabSetRecord.prototype = { Utils.deferGetSet(TabSetRecord, "cleartext", ["clientName", "tabs"]); -function TabEngine(service) { +this.TabEngine = 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 918a6119d5f0..ca4a16146512 100644 --- a/services/sync/modules/identity.js +++ b/services/sync/modules/identity.js @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = ["IdentityManager"]; +this.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. */ -function IdentityManager() { +this.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 f65705bb4346..a8e3435437b8 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/. */ -const EXPORTED_SYMBOLS = ["JPAKEClient", "SendCredentialsController"]; +this.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. */ -function JPAKEClient(controller) { +this.JPAKEClient = function JPAKEClient(controller) { this.controller = controller; this._log = Log4Moz.repository.getLogger("Sync.JPAKEClient"); @@ -698,7 +698,8 @@ JPAKEClient.prototype = { * service); * */ -function SendCredentialsController(jpakeclient, service) { +this.SendCredentialsController = + 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 1f775235063d..e228db31f4c2 100644 --- a/services/sync/modules/keys.js +++ b/services/sync/modules/keys.js @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = [ +this.EXPORTED_SYMBOLS = [ "BulkKeyBundle", "SyncKeyBundle" ]; @@ -119,7 +119,7 @@ KeyBundle.prototype = { * * This is just a KeyBundle with a collection attached. */ -function BulkKeyBundle(collection) { +this.BulkKeyBundle = 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. */ -function SyncKeyBundle(username, syncKey) { +this.SyncKeyBundle = 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 8cb021733351..df3868e20eaa 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/. */ -const EXPORTED_SYMBOLS = ['Weave']; +this.EXPORTED_SYMBOLS = ['Weave']; -let Weave = {}; +this.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 15b1587ef525..18955aa45ab0 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/. */ -const EXPORTED_SYMBOLS = ["Notifications", "Notification", "NotificationButton"]; +this.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"); -let Notifications = { +this.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,7 +83,8 @@ let Notifications = { /** * A basic notification. Subclass this to create more complex notifications. */ -function Notification(title, description, iconURL, priority, buttons) { +this.Notification = + function Notification(title, description, iconURL, priority, buttons) { this.title = title; this.description = description; @@ -108,7 +109,8 @@ Notification.prototype.buttons = []; /** * A button to display in a notification. */ -function NotificationButton(label, accessKey, callback) { +this.NotificationButton = + 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 e90671392b7f..058505ec03e3 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/. */ -const EXPORTED_SYMBOLS = [ +this.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"); -function SyncScheduler(service) { +this.SyncScheduler = function SyncScheduler(service) { this.service = service; this.init(); } @@ -467,7 +467,7 @@ SyncScheduler.prototype = { const LOG_PREFIX_SUCCESS = "success-"; const LOG_PREFIX_ERROR = "error-"; -function ErrorHandler(service) { +this.ErrorHandler = function ErrorHandler(service) { this.service = service; this.init(); } diff --git a/services/sync/modules/record.js b/services/sync/modules/record.js index 4f34ae26acd1..b1194bea6b7d 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/. */ -const EXPORTED_SYMBOLS = [ +this.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"); -function WBORecord(collection, id) { +this.WBORecord = 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. */ -function RecordManager(service) { +this.RecordManager = function RecordManager(service) { this.service = service; this._log = Log4Moz.repository.getLogger(this._logName); @@ -167,7 +167,7 @@ RecordManager.prototype = { } }; -function CryptoWrapper(collection, id) { +this.CryptoWrapper = 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. */ -function CollectionKeyManager() { +this.CollectionKeyManager = function CollectionKeyManager() { this.lastModified = 0; this._collections = {}; this._default = null; @@ -505,7 +505,7 @@ CollectionKeyManager.prototype = { } } -function Collection(uri, recordObj, service) { +this.Collection = 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 422680a9e259..457b92e35da5 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/. */ -const EXPORTED_SYMBOLS = [ +this.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. */ -function AsyncResource(uri) { +this.AsyncResource = 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. */ -function Resource(uri) { +this.Resource = function Resource(uri) { AsyncResource.call(this, uri); } Resource.prototype = { diff --git a/services/sync/modules/rest.js b/services/sync/modules/rest.js index d3770a3b88f6..15e83a24f86e 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"); -const EXPORTED_SYMBOLS = ["SyncStorageRequest"]; +this.EXPORTED_SYMBOLS = ["SyncStorageRequest"]; const STORAGE_REQUEST_TIMEOUT = 5 * 60; // 5 minutes /** * RESTRequest variant for use against a Sync storage server. */ -function SyncStorageRequest(uri) { +this.SyncStorageRequest = 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 3c09b6799728..887a6756c663 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/. */ -const EXPORTED_SYMBOLS = ["Service"]; +this.EXPORTED_SYMBOLS = ["Service"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -1475,5 +1475,5 @@ Sync11Service.prototype = { }, }; -let Service = new Sync11Service(); +this.Service = new Sync11Service(); Service.onStartup(); diff --git a/services/sync/modules/stages/cluster.js b/services/sync/modules/stages/cluster.js index 19e7de62f07b..dd7717201b86 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/. */ -const EXPORTED_SYMBOLS = ["ClusterManager"]; +this.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. */ -function ClusterManager(service) { +this.ClusterManager = 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 da5204ef4d19..823c71ffcb26 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. */ -const EXPORTED_SYMBOLS = ["EngineSynchronizer"]; +this.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. */ -function EngineSynchronizer(service) { +this.EngineSynchronizer = 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 6ffc26e4093e..f17736a94b7a 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/. */ -const EXPORTED_SYMBOLS = ["Status"]; +this.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"); -let Status = { +this.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 e3da2786c06b..d09a98d5d417 100644 --- a/services/sync/modules/userapi.js +++ b/services/sync/modules/userapi.js @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = [ +this.EXPORTED_SYMBOLS = [ "UserAPI10Client", ]; @@ -23,7 +23,7 @@ Cu.import("resource://services-sync/util.js"); * * Instances are constructed with the base URI of the service. */ -function UserAPI10Client(baseURI) { +this.UserAPI10Client = 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 29b7aa0ff0d3..18d42aa8d4aa 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/. */ -const EXPORTED_SYMBOLS = ["XPCOMUtils", "Services", "NetUtil", "PlacesUtils", - "FileUtils", "Utils", "Async", "Svc", "Str"]; +this.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"); +Cu.import("resource://services-common/async.js", this); Cu.import("resource://services-crypto/utils.js"); Cu.import("resource://services-sync/constants.js"); -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"); +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); /* * Utility functions */ -let Utils = { +this.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 */ -let Svc = {}; +this.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; }); -let Str = {}; +this.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 e80655b38b16..a8576643cca5 100644 --- a/storage/test/unit/vacuumParticipant.js +++ b/storage/test/unit/vacuumParticipant.js @@ -114,4 +114,4 @@ vacuumParticipant.prototype = }; let gComponentsArray = [vacuumParticipant]; -let NSGetFactory = XPCOMUtils.generateNSGetFactory(gComponentsArray); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(gComponentsArray); diff --git a/testing/marionette/components/marionettecomponent.js b/testing/marionette/components/marionettecomponent.js index 61ba66a07964..b569d1a75ce3 100644 --- a/testing/marionette/components/marionettecomponent.js +++ b/testing/marionette/components/marionettecomponent.js @@ -102,4 +102,4 @@ MarionetteComponent.prototype = { }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([MarionetteComponent]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([MarionetteComponent]); diff --git a/testing/marionette/marionette-elements.js b/testing/marionette/marionette-elements.js index 056431672715..cbbf935193c0 100644 --- a/testing/marionette/marionette-elements.js +++ b/testing/marionette/marionette-elements.js @@ -11,19 +11,29 @@ * server uses maps this reference to the actual element when it executes the command. */ -let EXPORTED_SYMBOLS = ["ElementManager", "CLASS_NAME", "SELECTOR", "ID", "NAME", "LINK_TEXT", "PARTIAL_LINK_TEXT", "TAG", "XPATH"]; +this.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); -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"; +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"; function ElementException(msg, num, stack) { this.message = msg; @@ -32,7 +42,7 @@ function ElementException(msg, num, stack) { } /* NOTE: Bug 736592 has been created to replace seenItems with a weakRef map */ -function ElementManager(notSupported) { +this.ElementManager = 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 eab9a5934776..81a5c9e3e057 100644 --- a/testing/specialpowers/components/SpecialPowersObserver.js +++ b/testing/specialpowers/components/SpecialPowersObserver.js @@ -148,4 +148,4 @@ SpecialPowersObserver.prototype = new SpecialPowersObserverAPI(); } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([SpecialPowersObserver]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SpecialPowersObserver]); diff --git a/testing/specialpowers/content/MockFilePicker.jsm b/testing/specialpowers/content/MockFilePicker.jsm index b6e13ae1671b..137b65ba52cb 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/. */ -var EXPORTED_SYMBOLS = ["MockFilePicker"]; +this.EXPORTED_SYMBOLS = ["MockFilePicker"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -30,7 +30,7 @@ var newFactory = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIFactory]) }; -var MockFilePicker = { +this.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 990a0e476b64..3a28f52061e6 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]), }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([jsConsoleHandler]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([jsConsoleHandler]); diff --git a/toolkit/components/contentprefs/nsContentPrefService.js b/toolkit/components/contentprefs/nsContentPrefService.js index edca9542e89a..4dc9d4f09c3e 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]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/toolkit/components/ctypes/ctypes.cpp b/toolkit/components/ctypes/ctypes.cpp index 9481f19e5b25..fd1ea1fae9a8 100644 --- a/toolkit/components/ctypes/ctypes.cpp +++ b/toolkit/components/ctypes/ctypes.cpp @@ -9,6 +9,7 @@ #include "nsMemory.h" #include "nsString.h" #include "nsNativeCharsetUtils.h" +#include "mozilla/Preferences.h" #define JSCTYPES_CONTRACTID \ "@mozilla.org/jsctypes;1" @@ -90,6 +91,10 @@ 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 270aa1c2cff9..22b4023a6461 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/. */ -let EXPORTED_SYMBOLS = [ "ctypes" ]; +this.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 fd95b47e4f1b..29021756111a 100644 --- a/toolkit/components/downloads/nsDownloadManagerUI.js +++ b/toolkit/components/downloads/nsDownloadManagerUI.js @@ -117,5 +117,5 @@ nsDownloadManagerUI.prototype = { //// Module let components = [nsDownloadManagerUI]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.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 839ba0241ba7..a24622a6d265 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 = { } -const NSGetFactory = XPCOMUtils.generateNSGetFactory([HelperAppDlg]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([HelperAppDlg]); diff --git a/toolkit/components/feeds/FeedProcessor.js b/toolkit/components/feeds/FeedProcessor.js index 9e094bf4a38d..7a6e7e404bfe 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]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/toolkit/components/filepicker/nsFilePicker.js b/toolkit/components/filepicker/nsFilePicker.js index 773af3efc710..b1357e0cf51f 100644 --- a/toolkit/components/filepicker/nsFilePicker.js +++ b/toolkit/components/filepicker/nsFilePicker.js @@ -259,7 +259,7 @@ if (DEBUG) else debug = function (s) {}; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsFilePicker]); +this.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 7b2d4c3b9c02..c291160314f7 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/. */ -var EXPORTED_SYMBOLS = ["Microformats", "adr", "tag", "hCard", "hCalendar", "geo"]; +this.EXPORTED_SYMBOLS = ["Microformats", "adr", "tag", "hCard", "hCalendar", "geo"]; -var Microformats = { +this.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 @@ var Microformats = { /* MICROFORMAT DEFINITIONS BEGIN HERE */ -function adr(node, validate) { +this.adr = 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); -function hCard(node, validate) { +this.hCard = 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); -function hCalendar(node, validate) { +this.hCalendar = 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); -function geo(node, validate) { +this.geo = 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); -function tag(node, validate) { +this.tag = 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 b81eed725eed..33130090895d 100644 --- a/toolkit/components/nsDefaultCLH.js +++ b/toolkit/components/nsDefaultCLH.js @@ -122,4 +122,4 @@ nsDefaultCLH.prototype = { helpInfo : "", }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsDefaultCLH]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsDefaultCLH]); diff --git a/toolkit/components/osfile/osfile.jsm b/toolkit/components/osfile/osfile.jsm index 5c7f8c5e3672..e624798e8501 100644 --- a/toolkit/components/osfile/osfile.jsm +++ b/toolkit/components/osfile/osfile.jsm @@ -7,8 +7,8 @@ */ if (typeof Components != "undefined") { - var EXPORTED_SYMBOLS = ["OS"]; - Components.utils.import("resource://gre/modules/osfile/osfile_async_front.jsm"); + this.EXPORTED_SYMBOLS = ["OS"]; + Components.utils.import("resource://gre/modules/osfile/osfile_async_front.jsm", this); } 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 68fd42840bc5..b52278571482 100644 --- a/toolkit/components/osfile/osfile_async_front.jsm +++ b/toolkit/components/osfile/osfile_async_front.jsm @@ -19,9 +19,9 @@ * @rejects {B} reason */ -let EXPORTED_SYMBOLS = ["OS"]; +this.EXPORTED_SYMBOLS = ["OS"]; -Components.utils.import("resource://gre/modules/osfile/osfile_shared_allthreads.jsm"); +Components.utils.import("resource://gre/modules/osfile/osfile_shared_allthreads.jsm", this); 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 56a4f6df62e3..d3e6a086ff61 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") { - var EXPORTED_SYMBOLS = ["OS"]; + this.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 9b0a3aabc795..761ad5034015 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 - var EXPORTED_SYMBOLS = ["OS"]; + this.EXPORTED_SYMBOLS = ["OS"]; Components.utils.import("resource://gre/modules/ctypes.jsm"); - Components.utils.import("resource://gre/modules/osfile/osfile_shared_allthreads.jsm"); + Components.utils.import("resource://gre/modules/osfile/osfile_shared_allthreads.jsm", this); } 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 64f4721986ae..e6eafc07a32d 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 - var EXPORTED_SYMBOLS = ["OS"]; + this.EXPORTED_SYMBOLS = ["OS"]; Components.utils.import("resource://gre/modules/ctypes.jsm"); - Components.utils.import("resource://gre/modules/osfile/osfile_shared_allthreads.jsm"); + Components.utils.import("resource://gre/modules/osfile/osfile_shared_allthreads.jsm", this); } 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 0672e8c5ebb7..551187044fbf 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") { - var EXPORTED_SYMBOLS = ["OS"]; - Components.utils.import("resource://gre/modules/osfile/osfile_unix_allthreads.jsm"); + this.EXPORTED_SYMBOLS = ["OS"]; + Components.utils.import("resource://gre/modules/osfile/osfile_unix_allthreads.jsm", this); } (function(exports) { "use strict"; diff --git a/toolkit/components/osfile/ospath_win_back.jsm b/toolkit/components/osfile/ospath_win_back.jsm index 5fefaebb10b3..8aa193b79d3b 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") { - var EXPORTED_SYMBOLS = ["OS"]; - Components.utils.import("resource://gre/modules/osfile/osfile_win_allthreads.jsm"); + this.EXPORTED_SYMBOLS = ["OS"]; + Components.utils.import("resource://gre/modules/osfile/osfile_win_allthreads.jsm", this); } (function(exports) { "use strict"; diff --git a/toolkit/components/passwordmgr/crypto-SDR.js b/toolkit/components/passwordmgr/crypto-SDR.js index 6a7bff39da5a..df9c0f0158fa 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]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/toolkit/components/passwordmgr/nsLoginInfo.js b/toolkit/components/passwordmgr/nsLoginInfo.js index 574ad704840e..f2de7c4ed786 100644 --- a/toolkit/components/passwordmgr/nsLoginInfo.js +++ b/toolkit/components/passwordmgr/nsLoginInfo.js @@ -107,4 +107,4 @@ nsLoginInfo.prototype = { }; // end of nsLoginInfo implementation -var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsLoginInfo]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsLoginInfo]); diff --git a/toolkit/components/passwordmgr/nsLoginManager.js b/toolkit/components/passwordmgr/nsLoginManager.js index 913032ce3534..92c01bc9cb43 100644 --- a/toolkit/components/passwordmgr/nsLoginManager.js +++ b/toolkit/components/passwordmgr/nsLoginManager.js @@ -1388,4 +1388,4 @@ UserAutoCompleteResult.prototype = { } }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([LoginManager]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([LoginManager]); diff --git a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js index 9bb43a3076c2..77c34349283e 100644 --- a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js +++ b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js @@ -1482,4 +1482,4 @@ LoginManagerPrompter.prototype = { var component = [LoginManagerPromptFactory, LoginManagerPrompter]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/toolkit/components/passwordmgr/storage-Legacy.js b/toolkit/components/passwordmgr/storage-Legacy.js index cab84469aa91..594eaeaa81dd 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 -var NSGetFactory = XPCOMUtils.generateNSGetFactory([LoginManagerStorage_legacy]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([LoginManagerStorage_legacy]); diff --git a/toolkit/components/passwordmgr/storage-mozStorage.js b/toolkit/components/passwordmgr/storage-mozStorage.js index d33ba6d59e3e..e560c9f1058e 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]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/toolkit/components/perf/PerfMeasurement.cpp b/toolkit/components/perf/PerfMeasurement.cpp index 9fc9129472fe..1fb4ade90dfc 100644 --- a/toolkit/components/perf/PerfMeasurement.cpp +++ b/toolkit/components/perf/PerfMeasurement.cpp @@ -7,6 +7,7 @@ #include "jsperf.h" #include "mozilla/ModuleUtils.h" #include "nsMemory.h" +#include "mozilla/Preferences.h" #define JSPERF_CONTRACTID \ "@mozilla.org/jsperf;1" @@ -58,6 +59,10 @@ 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 57878b8aee88..d68298baaab4 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/. */ -let EXPORTED_SYMBOLS = [ "PerfMeasurement" ]; +this.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 98bc17f1632c..2c9fcbcb43cc 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/. */ -const EXPORTED_SYMBOLS = [ "BookmarkHTMLUtils" ]; +this.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 -let BookmarkHTMLUtils = Object.freeze({ +this.BookmarkHTMLUtils = Object.freeze({ importFromURL: function importFromFile(aUrlString, aInitialImport, aCallback) { diff --git a/toolkit/components/places/ColorAnalyzer.js b/toolkit/components/places/ColorAnalyzer.js index 7a85007dc8a4..86d8f36d1d7f 100644 --- a/toolkit/components/places/ColorAnalyzer.js +++ b/toolkit/components/places/ColorAnalyzer.js @@ -87,4 +87,4 @@ ColorAnalyzer.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.mozIColorAnalyzer]) }; -let NSGetFactory = XPCOMUtils.generateNSGetFactory([ColorAnalyzer]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ColorAnalyzer]); diff --git a/toolkit/components/places/PlacesCategoriesStarter.js b/toolkit/components/places/PlacesCategoriesStarter.js index 92e29397c6af..fb50ceeed1cd 100644 --- a/toolkit/components/places/PlacesCategoriesStarter.js +++ b/toolkit/components/places/PlacesCategoriesStarter.js @@ -109,4 +109,4 @@ PlacesCategoriesStarter.prototype = { //// Module Registration let components = [PlacesCategoriesStarter]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/toolkit/components/places/PlacesDBUtils.jsm b/toolkit/components/places/PlacesDBUtils.jsm index 7924703fed0d..ee8de0d1ea16 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"); -let EXPORTED_SYMBOLS = [ "PlacesDBUtils" ]; +this.EXPORTED_SYMBOLS = [ "PlacesDBUtils" ]; //////////////////////////////////////////////////////////////////////////////// //// Constants @@ -32,7 +32,7 @@ XPCOMUtils.defineLazyGetter(this, "DBConn", function() { //////////////////////////////////////////////////////////////////////////////// //// PlacesDBUtils -let PlacesDBUtils = { +this.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 20d509259d56..f843ae1c315b 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/. */ -const EXPORTED_SYMBOLS = [ +this.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); -var PlacesUtils = { +this.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,7 +2349,8 @@ BaseTransaction.prototype = { * * @return nsITransaction object */ -function PlacesAggregatedTransaction(aName, aTransactions) +this.PlacesAggregatedTransaction = + function PlacesAggregatedTransaction(aName, aTransactions) { // Copy the transactions array to decouple it from its prototype, which // otherwise keeps alive its associated global object. @@ -2432,8 +2433,9 @@ PlacesAggregatedTransaction.prototype = { * * @return nsITransaction object */ -function PlacesCreateFolderTransaction(aTitle, aParentId, aIndex, aAnnotations, - aChildTransactions) +this.PlacesCreateFolderTransaction = + function PlacesCreateFolderTransaction(aTitle, aParentId, aIndex, aAnnotations, + aChildTransactions) { this.item = new TransactionItemCache(); this.item.title = aTitle; @@ -2505,9 +2507,10 @@ PlacesCreateFolderTransaction.prototype = { * * @return nsITransaction object */ -function PlacesCreateBookmarkTransaction(aURI, aParentId, aIndex, aTitle, - aKeyword, aAnnotations, - aChildTransactions) +this.PlacesCreateBookmarkTransaction = + function PlacesCreateBookmarkTransaction(aURI, aParentId, aIndex, aTitle, + aKeyword, aAnnotations, + aChildTransactions) { this.item = new TransactionItemCache(); this.item.uri = aURI; @@ -2571,7 +2574,8 @@ PlacesCreateBookmarkTransaction.prototype = { * * @return nsITransaction object */ -function PlacesCreateSeparatorTransaction(aParentId, aIndex) +this.PlacesCreateSeparatorTransaction = + function PlacesCreateSeparatorTransaction(aParentId, aIndex) { this.item = new TransactionItemCache(); this.item.parentId = aParentId; @@ -2614,8 +2618,9 @@ PlacesCreateSeparatorTransaction.prototype = { * * @return nsITransaction object */ -function PlacesCreateLivemarkTransaction(aFeedURI, aSiteURI, aTitle, aParentId, - aIndex, aAnnotations) +this.PlacesCreateLivemarkTransaction = + function PlacesCreateLivemarkTransaction(aFeedURI, aSiteURI, aTitle, aParentId, + aIndex, aAnnotations) { this.item = new TransactionItemCache(); this.item.feedURI = aFeedURI; @@ -2752,7 +2757,8 @@ PlacesRemoveLivemarkTransaction.prototype = { * * @return nsITransaction object */ -function PlacesMoveItemTransaction(aItemId, aNewParentId, aNewIndex) +this.PlacesMoveItemTransaction = + function PlacesMoveItemTransaction(aItemId, aNewParentId, aNewIndex) { this.item = new TransactionItemCache(); this.item.id = aItemId; @@ -2798,7 +2804,8 @@ PlacesMoveItemTransaction.prototype = { * * @return nsITransaction object */ -function PlacesRemoveItemTransaction(aItemId) +this.PlacesRemoveItemTransaction = + function PlacesRemoveItemTransaction(aItemId) { if (PlacesUtils.isRootItem(aItemId)) throw Cr.NS_ERROR_INVALID_ARG; @@ -2931,7 +2938,8 @@ PlacesRemoveItemTransaction.prototype = { * * @return nsITransaction object */ -function PlacesEditItemTitleTransaction(aItemId, aNewTitle) +this.PlacesEditItemTitleTransaction = + function PlacesEditItemTitleTransaction(aItemId, aNewTitle) { this.item = new TransactionItemCache(); this.item.id = aItemId; @@ -2965,7 +2973,8 @@ PlacesEditItemTitleTransaction.prototype = { * * @return nsITransaction object */ -function PlacesEditBookmarkURITransaction(aItemId, aNewURI) { +this.PlacesEditBookmarkURITransaction = + function PlacesEditBookmarkURITransaction(aItemId, aNewURI) { this.item = new TransactionItemCache(); this.item.id = aItemId; this.new = new TransactionItemCache(); @@ -3016,7 +3025,8 @@ PlacesEditBookmarkURITransaction.prototype = { * * @return nsITransaction object */ -function PlacesSetItemAnnotationTransaction(aItemId, aAnnotationObject) +this.PlacesSetItemAnnotationTransaction = + function PlacesSetItemAnnotationTransaction(aItemId, aAnnotationObject) { this.item = new TransactionItemCache(); this.item.id = aItemId; @@ -3075,7 +3085,8 @@ PlacesSetItemAnnotationTransaction.prototype = { * * @return nsITransaction object */ -function PlacesSetPageAnnotationTransaction(aURI, aAnnotationObject) +this.PlacesSetPageAnnotationTransaction = + function PlacesSetPageAnnotationTransaction(aURI, aAnnotationObject) { this.item = new TransactionItemCache(); this.item.uri = aURI; @@ -3131,7 +3142,8 @@ PlacesSetPageAnnotationTransaction.prototype = { * * @return nsITransaction object */ -function PlacesEditBookmarkKeywordTransaction(aItemId, aNewKeyword) +this.PlacesEditBookmarkKeywordTransaction = + function PlacesEditBookmarkKeywordTransaction(aItemId, aNewKeyword) { this.item = new TransactionItemCache(); this.item.id = aItemId; @@ -3165,7 +3177,8 @@ PlacesEditBookmarkKeywordTransaction.prototype = { * * @return nsITransaction object */ -function PlacesEditBookmarkPostDataTransaction(aItemId, aPostData) +this.PlacesEditBookmarkPostDataTransaction = + function PlacesEditBookmarkPostDataTransaction(aItemId, aPostData) { this.item = new TransactionItemCache(); this.item.id = aItemId; @@ -3199,7 +3212,8 @@ PlacesEditBookmarkPostDataTransaction.prototype = { * * @return nsITransaction object */ -function PlacesEditItemDateAddedTransaction(aItemId, aNewDateAdded) +this.PlacesEditItemDateAddedTransaction = + function PlacesEditItemDateAddedTransaction(aItemId, aNewDateAdded) { this.item = new TransactionItemCache(); this.item.id = aItemId; @@ -3237,7 +3251,8 @@ PlacesEditItemDateAddedTransaction.prototype = { * * @return nsITransaction object */ -function PlacesEditItemLastModifiedTransaction(aItemId, aNewLastModified) +this.PlacesEditItemLastModifiedTransaction = + function PlacesEditItemLastModifiedTransaction(aItemId, aNewLastModified) { this.item = new TransactionItemCache(); this.item.id = aItemId; @@ -3277,7 +3292,8 @@ PlacesEditItemLastModifiedTransaction.prototype = { * * @return nsITransaction object */ -function PlacesSortFolderByNameTransaction(aFolderId) +this.PlacesSortFolderByNameTransaction = + function PlacesSortFolderByNameTransaction(aFolderId) { this.item = new TransactionItemCache(); this.item.id = aFolderId; @@ -3363,7 +3379,8 @@ PlacesSortFolderByNameTransaction.prototype = { * @param aTags * Array of tags to set for the given URL. */ -function PlacesTagURITransaction(aURI, aTags) +this.PlacesTagURITransaction = + function PlacesTagURITransaction(aURI, aTags) { this.item = new TransactionItemCache(); this.item.uri = aURI; @@ -3410,7 +3427,8 @@ PlacesTagURITransaction.prototype = { * Array of tags to unset. pass null to remove all tags from the given * url. */ -function PlacesUntagURITransaction(aURI, aTags) +this.PlacesUntagURITransaction = + 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 fc5d18cf2ca2..fe5269fb722e 100644 --- a/toolkit/components/places/nsLivemarkService.js +++ b/toolkit/components/places/nsLivemarkService.js @@ -1244,4 +1244,4 @@ LivemarkLoadListener.prototype = { ]) } -const NSGetFactory = XPCOMUtils.generateNSGetFactory([LivemarkService]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([LivemarkService]); diff --git a/toolkit/components/places/nsPlacesAutoComplete.js b/toolkit/components/places/nsPlacesAutoComplete.js index e051120f0bc9..c817e046985f 100644 --- a/toolkit/components/places/nsPlacesAutoComplete.js +++ b/toolkit/components/places/nsPlacesAutoComplete.js @@ -1651,4 +1651,4 @@ urlInlineComplete.prototype = { }; let components = [nsPlacesAutoComplete, urlInlineComplete]; -const NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/toolkit/components/places/nsPlacesExpiration.js b/toolkit/components/places/nsPlacesExpiration.js index 48fa1c34319b..46d4c4195e7f 100644 --- a/toolkit/components/places/nsPlacesExpiration.js +++ b/toolkit/components/places/nsPlacesExpiration.js @@ -994,4 +994,4 @@ nsPlacesExpiration.prototype = { //// Module Registration let components = [nsPlacesExpiration]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/toolkit/components/places/nsTaggingService.js b/toolkit/components/places/nsTaggingService.js index f60bacd6cca5..9a84df4dabc4 100644 --- a/toolkit/components/places/nsTaggingService.js +++ b/toolkit/components/places/nsTaggingService.js @@ -678,4 +678,4 @@ TagAutoCompleteSearch.prototype = { }; let component = [TaggingService, TagAutoCompleteSearch]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/toolkit/components/places/tests/unit/nsDummyObserver.js b/toolkit/components/places/tests/unit/nsDummyObserver.js index afc4421ef9bd..6f45a8d6aaaf 100644 --- a/toolkit/components/places/tests/unit/nsDummyObserver.js +++ b/toolkit/components/places/tests/unit/nsDummyObserver.js @@ -52,4 +52,4 @@ DummyObserver.prototype = { ]) }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([DummyObserver]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DummyObserver]); diff --git a/toolkit/components/prompts/src/CommonDialog.jsm b/toolkit/components/prompts/src/CommonDialog.jsm index 1a037fc9b451..bc61902b314f 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/. */ -var EXPORTED_SYMBOLS = ["CommonDialog"]; +this.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"); -function CommonDialog(args, ui) { +this.CommonDialog = 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 d4ba688fec86..871292212b40 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]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/toolkit/components/reflect/reflect.jsm b/toolkit/components/reflect/reflect.jsm index dfb0c7a93b95..abdfdcabbf84 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/. */ -let EXPORTED_SYMBOLS = [ "Reflect" ]; +this.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 d4999fc53463..961cc93f1baf 100644 --- a/toolkit/components/satchel/nsFormAutoComplete.js +++ b/toolkit/components/satchel/nsFormAutoComplete.js @@ -427,4 +427,4 @@ FormAutoCompleteResult.prototype = { }; let component = [FormAutoComplete]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/toolkit/components/satchel/nsFormAutoCompleteResult.jsm b/toolkit/components/satchel/nsFormAutoCompleteResult.jsm index 3c4d10badb41..fd71d941cafd 100644 --- a/toolkit/components/satchel/nsFormAutoCompleteResult.jsm +++ b/toolkit/components/satchel/nsFormAutoCompleteResult.jsm @@ -2,21 +2,22 @@ * 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/. */ -let EXPORTED_SYMBOLS = [ "FormAutoCompleteResult" ]; +this.EXPORTED_SYMBOLS = [ "FormAutoCompleteResult" ]; const Ci = Components.interfaces; const Cr = Components.results; Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); -function FormAutoCompleteResult(searchString, - searchResult, - defaultIndex, - errorDescription, - values, - labels, - comments, - prevResult) { +this.FormAutoCompleteResult = + 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 b97d9d05cab8..494a2a336ad6 100644 --- a/toolkit/components/satchel/nsFormHistory.js +++ b/toolkit/components/satchel/nsFormHistory.js @@ -961,4 +961,4 @@ FormHistory.prototype = { }; let component = [FormHistory]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/toolkit/components/satchel/nsInputListAutoComplete.js b/toolkit/components/satchel/nsInputListAutoComplete.js index 9dd159f885b8..357ba93bb0f8 100644 --- a/toolkit/components/satchel/nsInputListAutoComplete.js +++ b/toolkit/components/satchel/nsInputListAutoComplete.js @@ -87,4 +87,4 @@ InputListAutoComplete.prototype = { }; let component = [InputListAutoComplete]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/toolkit/components/search/nsSearchService.js b/toolkit/components/search/nsSearchService.js index 0ca4a23b7498..2e9f32ab443a 100644 --- a/toolkit/components/search/nsSearchService.js +++ b/toolkit/components/search/nsSearchService.js @@ -3848,6 +3848,6 @@ var engineUpdateService = { } }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([SearchService]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SearchService]); #include ../../../toolkit/content/debug.js diff --git a/toolkit/components/search/nsSearchSuggestions.js b/toolkit/components/search/nsSearchSuggestions.js index ba7449b38fba..6d756c1069d5 100644 --- a/toolkit/components/search/nsSearchSuggestions.js +++ b/toolkit/components/search/nsSearchSuggestions.js @@ -565,4 +565,4 @@ SearchSuggestAutoComplete.prototype = { }; var component = [SearchSuggestAutoComplete]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/toolkit/components/social/FrameWorker.jsm b/toolkit/components/social/FrameWorker.jsm index 3c3c99a281a5..5cfdce72124f 100644 --- a/toolkit/components/social/FrameWorker.jsm +++ b/toolkit/components/social/FrameWorker.jsm @@ -17,14 +17,15 @@ const {classes: Cc, interfaces: Ci, utils: Cu} = Components; Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/MessagePortBase.jsm"); -const EXPORTED_SYMBOLS = ["getFrameWorkerHandle"]; +this.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. -function getFrameWorkerHandle(url, clientWindow, name) { +this.getFrameWorkerHandle = + 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 7a24c4e67f92..0d317b7efb6c 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. -const EXPORTED_SYMBOLS = ["AbstractPort"]; +this.EXPORTED_SYMBOLS = ["AbstractPort"]; -function AbstractPort(portid) { +this.AbstractPort = 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 bd6f574dd8ab..1deb2be77084 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"); -const EXPORTED_SYMBOLS = ["MozSocialAPI", "openChatWindow"]; +this.EXPORTED_SYMBOLS = ["MozSocialAPI", "openChatWindow"]; -var MozSocialAPI = { +this.MozSocialAPI = { _enabled: false, _everEnabled: false, set enabled(val) { @@ -249,7 +249,8 @@ function ensureProviderOrigin(provider, url) { return fullURL; } -function openChatWindow(chromeWindow, provider, url, callback, mode) { +this.openChatWindow = + 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 bb0798055226..308bdf486168 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/. */ -const EXPORTED_SYMBOLS = ["SocialService"]; +this.EXPORTED_SYMBOLS = ["SocialService"]; const { classes: Cc, interfaces: Ci, utils: Cu } = Components; @@ -82,7 +82,7 @@ function schedule(callback) { } // Public API -const SocialService = { +this.SocialService = { get enabled() { return SocialServiceInternal.enabled; }, diff --git a/toolkit/components/social/WorkerAPI.jsm b/toolkit/components/social/WorkerAPI.jsm index 5d443e6260a0..f35393e00287 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"); -const EXPORTED_SYMBOLS = ["WorkerAPI"]; +this.EXPORTED_SYMBOLS = ["WorkerAPI"]; -function WorkerAPI(provider, port) { +this.WorkerAPI = 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 79e2a90a6a99..66a0fb1f8354 100644 --- a/toolkit/components/telemetry/TelemetryPing.js +++ b/toolkit/components/telemetry/TelemetryPing.js @@ -1036,4 +1036,4 @@ TelemetryPing.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]), }; -let NSGetFactory = XPCOMUtils.generateNSGetFactory([TelemetryPing]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TelemetryPing]); diff --git a/toolkit/components/telemetry/TelemetryStopwatch.jsm b/toolkit/components/telemetry/TelemetryStopwatch.jsm index 9c88e3c32fb8..a1d7cafbceac 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; -let EXPORTED_SYMBOLS = ["TelemetryStopwatch"]; +this.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(); -let TelemetryStopwatch = { +this.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 313ac4827e3b..675eb7b81f66 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/. */ -var EXPORTED_SYMBOLS = ["SafeBrowsing"]; +this.EXPORTED_SYMBOLS = ["SafeBrowsing"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -23,7 +23,7 @@ function log(...stuff) { dump(msg + "\n"); } -var SafeBrowsing = { +this.SafeBrowsing = { init: function() { if (this.initialized) { diff --git a/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js b/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js index 75c0ddbcf3d8..d9ad1d0a7d6d 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js +++ b/toolkit/components/url-classifier/nsUrlClassifierHashCompleter.js @@ -574,4 +574,4 @@ function errorWithStack() { return err; } -var NSGetFactory = XPCOMUtils.generateNSGetFactory([HashCompleter]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([HashCompleter]); diff --git a/toolkit/components/url-classifier/nsUrlClassifierLib.js b/toolkit/components/url-classifier/nsUrlClassifierLib.js index 70b3af2d14fe..8c782d56f326 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([]); -var NSGetFactory = XPCOMUtils.generateNSGetFactory([UrlClassifierLib]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([UrlClassifierLib]); diff --git a/toolkit/components/url-classifier/nsUrlClassifierListManager.js b/toolkit/components/url-classifier/nsUrlClassifierListManager.js index 26caff286b24..070a2d274381 100644 --- a/toolkit/components/url-classifier/nsUrlClassifierListManager.js +++ b/toolkit/components/url-classifier/nsUrlClassifierListManager.js @@ -46,4 +46,4 @@ RegistrationData.prototype = { }, }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([RegistrationData]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([RegistrationData]); diff --git a/toolkit/components/urlformatter/nsURLFormatter.js b/toolkit/components/urlformatter/nsURLFormatter.js index 82b610ebd3a5..738c12560d52 100644 --- a/toolkit/components/urlformatter/nsURLFormatter.js +++ b/toolkit/components/urlformatter/nsURLFormatter.js @@ -139,4 +139,4 @@ nsURLFormatterService.prototype = { } }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsURLFormatterService]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsURLFormatterService]); diff --git a/toolkit/content/DeferredTask.jsm b/toolkit/content/DeferredTask.jsm index 99ea301194ad..03b53d536bde 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/. */ -const EXPORTED_SYMBOLS = ["DeferredTask"]; +this.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. */ -function DeferredTask(aCallback, aDelay) { +this.DeferredTask = 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 34bcb66a8f0a..2d276113adfa 100644 --- a/toolkit/content/Dict.jsm +++ b/toolkit/content/Dict.jsm @@ -4,7 +4,7 @@ "use strict"; -var EXPORTED_SYMBOLS = ["Dict"]; +this.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. */ -function Dict(aInitial) { +this.Dict = function Dict(aInitial) { if (aInitial === undefined) aInitial = {}; if (typeof aInitial == "string") diff --git a/toolkit/content/Geometry.jsm b/toolkit/content/Geometry.jsm index dad754edb2a1..47072b7445ea 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/. */ -let EXPORTED_SYMBOLS = ["Point", "Rect"]; +this.EXPORTED_SYMBOLS = ["Point", "Rect"]; /** * Simple Point class. * * Any method that takes an x and y may also take a point. */ -function Point(x, y) { +this.Point = function Point(x, y) { this.set(x, y); } @@ -84,7 +84,7 @@ Point.prototype = { * non-positive widths and heights in that case. */ -function Rect(x, y, w, h) { +this.Rect = 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 9601c69fcfb8..bbbdaa63defa 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/. */ -var EXPORTED_SYMBOLS = [ "InlineSpellChecker" ]; +this.EXPORTED_SYMBOLS = [ "InlineSpellChecker" ]; var gLanguageBundle; var gRegionBundle; const MAX_UNDO_STACK_DEPTH = 1; -function InlineSpellChecker(aEditor) { +this.InlineSpellChecker = 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 d0a4aec8a455..91b5d87e65a8 100644 --- a/toolkit/content/LightweightThemeConsumer.jsm +++ b/toolkit/content/LightweightThemeConsumer.jsm @@ -2,14 +2,15 @@ * 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/. */ -let EXPORTED_SYMBOLS = ["LightweightThemeConsumer"]; +this.EXPORTED_SYMBOLS = ["LightweightThemeConsumer"]; Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeImageOptimizer", "resource://gre/modules/LightweightThemeImageOptimizer.jsm"); -function LightweightThemeConsumer(aDocument) { +this.LightweightThemeConsumer = + 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 febe94a981b3..865c45914744 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/. */ -let EXPORTED_SYMBOLS = ["PageMenu"]; +this.EXPORTED_SYMBOLS = ["PageMenu"]; -function PageMenu() { +this.PageMenu = function PageMenu() { } PageMenu.prototype = { diff --git a/toolkit/content/PopupNotifications.jsm b/toolkit/content/PopupNotifications.jsm index 258b95d6c4dd..68ed9861c118 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/. */ -var EXPORTED_SYMBOLS = ["PopupNotifications"]; +this.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. */ -function PopupNotifications(tabbrowser, panel, iconBox) { +this.PopupNotifications = 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 f91d10e8f826..b5cbaf633162 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/. */ -var EXPORTED_SYMBOLS = ["PrivateBrowsingUtils"]; +this.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; -var PrivateBrowsingUtils = { +this.PrivateBrowsingUtils = { isWindowPrivate: function pbu_isWindowPrivate(aWindow) { return this.privacyContextFromWindow(aWindow).usePrivateBrowsing; }, diff --git a/toolkit/content/PropertyListUtils.jsm b/toolkit/content/PropertyListUtils.jsm index 8925feea27d9..7a41e45ba5bc 100644 --- a/toolkit/content/PropertyListUtils.jsm +++ b/toolkit/content/PropertyListUtils.jsm @@ -55,7 +55,7 @@ "use strict"; -let EXPORTED_SYMBOLS = ["PropertyListUtils"]; +this.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"); -let PropertyListUtils = Object.freeze({ +this.PropertyListUtils = Object.freeze({ /** * Asynchronously reads a file as a property list. * diff --git a/toolkit/content/Services.jsm b/toolkit/content/Services.jsm index 0813bf3e74e7..6e97215e3614 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/. */ -let EXPORTED_SYMBOLS = ["Services"]; +this.EXPORTED_SYMBOLS = ["Services"]; const Ci = Components.interfaces; const Cc = Components.classes; Components.utils.import("resource://gre/modules/XPCOMUtils.jsm"); -let Services = {}; +this.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 d79db8617e13..3d7a7290f798 100644 --- a/toolkit/content/Task.jsm +++ b/toolkit/content/Task.jsm @@ -6,7 +6,7 @@ "use strict"; -let EXPORTED_SYMBOLS = [ +this.EXPORTED_SYMBOLS = [ "Task" ]; @@ -103,7 +103,7 @@ Cu.import("resource://gre/modules/commonjs/promise/core.js"); /** * This object provides the public module functions. */ -const Task = { +this.Task = { /** * Creates and starts a new task. * diff --git a/toolkit/content/Troubleshoot.jsm b/toolkit/content/Troubleshoot.jsm index 83e5a5d67683..d10b7dc29c67 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/. */ -let EXPORTED_SYMBOLS = [ +this.EXPORTED_SYMBOLS = [ "Troubleshoot", ]; @@ -73,7 +73,7 @@ const PREFS_BLACKLIST = [ /[.]print_to_filename$/, ]; -let Troubleshoot = { +this.Troubleshoot = { /** * Captures a snapshot of data that may help troubleshooters troubleshoot diff --git a/toolkit/content/UpdateChannel.jsm b/toolkit/content/UpdateChannel.jsm index 46237e95b98d..e220a60aabd9 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/. */ -const EXPORTED_SYMBOLS = ["UpdateChannel"]; +this.EXPORTED_SYMBOLS = ["UpdateChannel"]; const Cu = Components.utils; Cu.import("resource://gre/modules/Services.jsm"); -let UpdateChannel = { +this.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 fb2640ddc647..458843c13c74 100644 --- a/toolkit/content/WindowDraggingUtils.jsm +++ b/toolkit/content/WindowDraggingUtils.jsm @@ -8,9 +8,9 @@ #define USE_HITTEST #endif -let EXPORTED_SYMBOLS = [ "WindowDraggingElement" ]; +this.EXPORTED_SYMBOLS = [ "WindowDraggingElement" ]; -function WindowDraggingElement(elem) { +this.WindowDraggingElement = function WindowDraggingElement(elem) { this._elem = elem; this._window = elem.ownerDocument.defaultView; #ifdef USE_HITTEST @@ -19,7 +19,7 @@ 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 ba647dedd142..822ae9068e51 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. -var EXPORTED_SYMBOLS = ["NS_ASSERT"]; +this.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 */ -function NS_ASSERT(condition, message) { +this.NS_ASSERT = function NS_ASSERT(condition, message) { if (condition) return; diff --git a/toolkit/crashreporter/CrashSubmit.jsm b/toolkit/crashreporter/CrashSubmit.jsm index 7d05dd31af32..dfa43ab9c620 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"); -let EXPORTED_SYMBOLS = [ +this.EXPORTED_SYMBOLS = [ "CrashSubmit" ]; @@ -301,7 +301,7 @@ Submitter.prototype = { //=================================== // External API goes here -let CrashSubmit = { +this.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 a05bd87d4b7c..d8b095761ad4 100644 --- a/toolkit/crashreporter/KeyValueParser.jsm +++ b/toolkit/crashreporter/KeyValueParser.jsm @@ -4,7 +4,7 @@ Components.utils.import("resource://gre/modules/Services.jsm"); -let EXPORTED_SYMBOLS = [ +this.EXPORTED_SYMBOLS = [ "parseKeyValuePairs", "parseKeyValuePairsFromFile" ]; @@ -12,7 +12,7 @@ let EXPORTED_SYMBOLS = [ const Cc = Components.classes; const Ci = Components.interfaces; -function parseKeyValuePairs(text) { +this.parseKeyValuePairs = function parseKeyValuePairs(text) { let lines = text.split('\n'); let data = {}; for (let i = 0; i < lines.length; i++) { @@ -31,7 +31,7 @@ function parseKeyValuePairs(text) { return data; } -function parseKeyValuePairsFromFile(file) { +this.parseKeyValuePairsFromFile = 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 18f9d42d5271..9ba544473f85 100644 --- a/toolkit/crashreporter/test/CrashTestUtils.jsm +++ b/toolkit/crashreporter/test/CrashTestUtils.jsm @@ -1,6 +1,8 @@ -var EXPORTED_SYMBOLS = ["CrashTestUtils"]; +// XXXkhuey this needs a license header. -let CrashTestUtils = { +this.EXPORTED_SYMBOLS = ["CrashTestUtils"]; + +this.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 b222031f6781..40bb414e3f8a 100644 --- a/toolkit/devtools/Console.jsm +++ b/toolkit/devtools/Console.jsm @@ -20,7 +20,7 @@ * implementation isn't always required (or even well defined) */ -const EXPORTED_SYMBOLS = [ "console" ]; +this.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) */ -const console = { +this.console = { debug: createMultiLineDumper("debug"), log: createDumper("log"), info: createDumper("info"), diff --git a/toolkit/devtools/Require.jsm b/toolkit/devtools/Require.jsm index 48ab49905688..dfd998b37f83 100644 --- a/toolkit/devtools/Require.jsm +++ b/toolkit/devtools/Require.jsm @@ -15,7 +15,7 @@ * serves the projects it loads. */ -const EXPORTED_SYMBOLS = [ "define", "require" ]; +this.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 */ -function define(moduleName, deps, payload) { +this.define = 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. */ -const require = define.globalDomain.require.bind(define.globalDomain); +this.require = define.globalDomain.require.bind(define.globalDomain); diff --git a/toolkit/devtools/_Promise.jsm b/toolkit/devtools/_Promise.jsm index ac615558aea0..0ea8c54d040b 100644 --- a/toolkit/devtools/_Promise.jsm +++ b/toolkit/devtools/_Promise.jsm @@ -5,7 +5,7 @@ */ -var EXPORTED_SYMBOLS = [ "Promise" ]; +this.EXPORTED_SYMBOLS = [ "Promise" ]; /** * Create an unfulfilled promise @@ -14,7 +14,7 @@ var EXPORTED_SYMBOLS = [ "Promise" ]; * * @constructor */ -function Promise(aTrace) { +this.Promise = 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 eb38a8fc4dfb..e7ea804e2c9a 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; -var EXPORTED_SYMBOLS = ["DebuggerTransport", - "DebuggerClient", - "debuggerSocketConnect"]; +this.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. */ -function DebuggerClient(aTransport) +this.DebuggerClient = 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. */ -function debuggerSocketConnect(aHost, aPort) +this.debuggerSocketConnect = 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 bdd85eda5c8a..d65ac84cdecc 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. */ -function DebuggerTransport(aInput, aOutput) +this.DebuggerTransport = 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 07a22589768d..ece7be88dc5a 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; -var EXPORTED_SYMBOLS = ["DebuggerServer"]; +this.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"); -var DebuggerServer = gGlobal.DebuggerServer; +this.DebuggerServer = gGlobal.DebuggerServer; diff --git a/toolkit/devtools/sourcemap/SourceMap.jsm b/toolkit/devtools/sourcemap/SourceMap.jsm index dd7c525b999d..bde9257b74ba 100644 --- a/toolkit/devtools/sourcemap/SourceMap.jsm +++ b/toolkit/devtools/sourcemap/SourceMap.jsm @@ -15,7 +15,7 @@ /////////////////////////////////////////////////////////////////////////////// -var EXPORTED_SYMBOLS = [ "SourceMapConsumer", "SourceMapGenerator", "SourceNode" ]; +this.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 90d2d36b14ad..af7d1b1edf9d 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'); -let EXPORTED_SYMBOLS = [ "define", "runSourceMapTests" ]; +this.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 853d44483255..c4b6d1c0d2b8 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; }); -var EXPORTED_SYMBOLS = ["NetworkHelper"]; +this.EXPORTED_SYMBOLS = ["NetworkHelper"]; /** * Helper object for networking stuff. @@ -73,7 +73,7 @@ var EXPORTED_SYMBOLS = ["NetworkHelper"]; * have been modified to match the Firefox coding rules. */ -var NetworkHelper = +this.NetworkHelper = { /** * Converts aText with a given aCharset to unicode. diff --git a/toolkit/devtools/webconsole/WebConsoleClient.jsm b/toolkit/devtools/webconsole/WebConsoleClient.jsm index da27e34f1e07..b257e0acd8fc 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; -var EXPORTED_SYMBOLS = ["WebConsoleClient"]; +this.EXPORTED_SYMBOLS = ["WebConsoleClient"]; /** * A WebConsoleClient is used as a front end for the WebConsoleActor that is @@ -21,7 +21,7 @@ var EXPORTED_SYMBOLS = ["WebConsoleClient"]; * @param string aActor * The WebConsoleActor ID. */ -function WebConsoleClient(aDebuggerClient, aActor) +this.WebConsoleClient = 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 e936c3acb4ba..b4abc490a4a2 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"); -var EXPORTED_SYMBOLS = ["WebConsoleUtils", "JSPropertyProvider", "JSTermHelpers", - "PageErrorListener", "ConsoleAPIListener", - "NetworkResponseListener", "NetworkMonitor", - "ConsoleProgressListener"]; +this.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*\((.+?)\)/; -var WebConsoleUtils = { +this.WebConsoleUtils = { /** * Convenience function to unwrap a wrapped object. * @@ -914,7 +914,7 @@ WebConsoleUtils.l10n.prototype = { // JS Completer ////////////////////////////////////////////////////////////////////////// -var JSPropertyProvider = (function _JSPP(WCU) { +this.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. */ -function PageErrorListener(aWindow, aListener) +this.PageErrorListener = 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. */ -function ConsoleAPIListener(aWindow, aOwner) +this.ConsoleAPIListener = function ConsoleAPIListener(aWindow, aOwner) { this.window = aWindow; this.owner = aOwner; @@ -1475,7 +1475,7 @@ ConsoleAPIListener.prototype = * @param object aOwner * The owning object. */ -function JSTermHelpers(aOwner) +this.JSTermHelpers = function JSTermHelpers(aOwner) { /** * Find a node by ID. @@ -1679,7 +1679,7 @@ function JSTermHelpers(aOwner) aOwner.helperResult = { rawOutput: true }; return String(aString); }; -} +}; (function(_global, WCU) { @@ -2582,7 +2582,6 @@ _global.NetworkMonitor = NetworkMonitor; _global.NetworkResponseListener = NetworkResponseListener; })(this, WebConsoleUtils); - /** * A WebProgressListener that listens for location changes. * @@ -2597,7 +2596,8 @@ _global.NetworkResponseListener = NetworkResponseListener; * - onFileActivity(aFileURI) * - onLocationChange(aState, aTabURI, aPageTitle) */ -function ConsoleProgressListener(aWindow, aOwner) +this.ConsoleProgressListener = + function ConsoleProgressListener(aWindow, aOwner) { this.window = aWindow; this.owner = aOwner; diff --git a/toolkit/forgetaboutsite/ForgetAboutSite.jsm b/toolkit/forgetaboutsite/ForgetAboutSite.jsm index ed0789cb8485..30e86c9ef4f6 100644 --- a/toolkit/forgetaboutsite/ForgetAboutSite.jsm +++ b/toolkit/forgetaboutsite/ForgetAboutSite.jsm @@ -4,7 +4,7 @@ Components.utils.import("resource://gre/modules/Services.jsm"); -var EXPORTED_SYMBOLS = ["ForgetAboutSite"]; +this.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; -var ForgetAboutSite = { +this.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 08d8a5a4729f..a3d5e37d739b 100644 --- a/toolkit/identity/Identity.jsm +++ b/toolkit/identity/Identity.jsm @@ -6,7 +6,7 @@ "use strict"; -const EXPORTED_SYMBOLS = ["IdentityService"]; +this.EXPORTED_SYMBOLS = ["IdentityService"]; const Cu = Components.utils; const Ci = Components.interfaces; @@ -302,4 +302,4 @@ IDService.prototype = { }; -let IdentityService = new IDService(); +this.IdentityService = new IDService(); diff --git a/toolkit/identity/IdentityProvider.jsm b/toolkit/identity/IdentityProvider.jsm index 93e8b91455fa..f0fb5ed5d91d 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"); -const EXPORTED_SYMBOLS = ["IdentityProvider"]; +this.EXPORTED_SYMBOLS = ["IdentityProvider"]; const FALLBACK_PROVIDER = "browserid.org"; XPCOMUtils.defineLazyModuleGetter(this, @@ -491,4 +491,4 @@ IdentityProviderService.prototype = { }; -let IdentityProvider = new IdentityProviderService(); +this.IdentityProvider = new IdentityProviderService(); diff --git a/toolkit/identity/IdentityStore.jsm b/toolkit/identity/IdentityStore.jsm index fda9e277d39c..ed761ca26d13 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"); -const EXPORTED_SYMBOLS = ["IdentityStore"]; +this.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 = { }, }; -let IdentityStore = new IDServiceStore(); +this.IdentityStore = new IDServiceStore(); diff --git a/toolkit/identity/LogUtils.jsm b/toolkit/identity/LogUtils.jsm index 85d8e5d7159d..61dba9d3ba9f 100644 --- a/toolkit/identity/LogUtils.jsm +++ b/toolkit/identity/LogUtils.jsm @@ -6,7 +6,7 @@ "use strict"; -const EXPORTED_SYMBOLS = ["Logger"]; +this.EXPORTED_SYMBOLS = ["Logger"]; const PREF_DEBUG = "toolkit.identity.debug"; const Cu = Components.utils; @@ -100,4 +100,4 @@ IdentityLogger.prototype = { }; -let Logger = new IdentityLogger(); +this.Logger = new IdentityLogger(); diff --git a/toolkit/identity/RelyingParty.jsm b/toolkit/identity/RelyingParty.jsm index cf81b4949276..6a6dfaf461df 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"); -const EXPORTED_SYMBOLS = ["RelyingParty"]; +this.EXPORTED_SYMBOLS = ["RelyingParty"]; XPCOMUtils.defineLazyModuleGetter(this, "jwcrypto", @@ -365,4 +365,4 @@ IdentityRelyingParty.prototype = { }; -let RelyingParty = new IdentityRelyingParty(); +this.RelyingParty = new IdentityRelyingParty(); diff --git a/toolkit/identity/Sandbox.jsm b/toolkit/identity/Sandbox.jsm index 0196687ac236..90a9095e3858 100644 --- a/toolkit/identity/Sandbox.jsm +++ b/toolkit/identity/Sandbox.jsm @@ -4,7 +4,7 @@ "use strict"; -const EXPORTED_SYMBOLS = ["Sandbox"]; +this.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. */ -function Sandbox(aURL, aCallback) { +this.Sandbox = 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 159ce68e6ea8..783be6bda83e 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"); -const EXPORTED_SYMBOLS = ["jwcrypto"]; +this.EXPORTED_SYMBOLS = ["jwcrypto"]; const ALGORITHMS = { RS256: "RS256", DS160: "DS160" }; @@ -125,5 +125,5 @@ jwcryptoClass.prototype = { }; -var jwcrypto = new jwcryptoClass(); +this.jwcrypto = new jwcryptoClass(); jwcrypto.ALGORITHMS = ALGORITHMS; diff --git a/toolkit/mozapps/downloads/DownloadLastDir.jsm b/toolkit/mozapps/downloads/DownloadLastDir.jsm index c26cbde6e145..eae69ece2ee0 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; -var EXPORTED_SYMBOLS = [ "DownloadLastDir" ]; +this.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(); -function DownloadLastDir(aWindow) { +this.DownloadLastDir = function DownloadLastDir(aWindow) { this.window = aWindow; } diff --git a/toolkit/mozapps/downloads/DownloadPaths.jsm b/toolkit/mozapps/downloads/DownloadPaths.jsm index 3b94c1300c0f..a1057582ec9e 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/. */ -var EXPORTED_SYMBOLS = [ +this.EXPORTED_SYMBOLS = [ "DownloadPaths", ]; @@ -26,7 +26,7 @@ const Ci = Components.interfaces; const Cu = Components.utils; const Cr = Components.results; -const DownloadPaths = { +this.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 c4e6b1cc15ae..c3e6d9118169 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/. */ -let EXPORTED_SYMBOLS = [ +this.EXPORTED_SYMBOLS = [ "DownloadTaskbarProgress", ]; @@ -19,7 +19,7 @@ const kTaskbarID = "@mozilla.org/windows-taskbar;1"; //////////////////////////////////////////////////////////////////////////////// //// DownloadTaskbarProgress Object -const DownloadTaskbarProgress = +this.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 531f27d4b16b..f0636cf124db 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/. */ -var EXPORTED_SYMBOLS = [ "DownloadUtils" ]; +this.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 = []; -let DownloadUtils = { +this.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 b5739ab00027..abb6c4825ac8 100644 --- a/toolkit/mozapps/downloads/nsHelperAppDlg.js +++ b/toolkit/mozapps/downloads/nsHelperAppDlg.js @@ -1081,4 +1081,4 @@ nsUnknownContentTypeDialog.prototype = { } } -var NSGetFactory = XPCOMUtils.generateNSGetFactory([nsUnknownContentTypeDialog]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsUnknownContentTypeDialog]); diff --git a/toolkit/mozapps/extensions/AddonLogging.jsm b/toolkit/mozapps/extensions/AddonLogging.jsm index 96cbe5de6518..6077e43b2833 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"); -var EXPORTED_SYMBOLS = [ "LogManager" ]; +this.EXPORTED_SYMBOLS = [ "LogManager" ]; var gDebugLogEnabled = false; @@ -130,7 +130,7 @@ AddonLogger.prototype = { } }; -var LogManager = { +this.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 e6f542f7e615..129ba8c81831 100644 --- a/toolkit/mozapps/extensions/AddonManager.jsm +++ b/toolkit/mozapps/extensions/AddonManager.jsm @@ -51,7 +51,7 @@ XPCOMUtils.defineLazyGetter(this, "CertUtils", function certUtilsLazyGetter() { }); -var EXPORTED_SYMBOLS = [ "AddonManager", "AddonManagerPrivate" ]; +this.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. */ -var AddonManagerPrivate = { +this.AddonManagerPrivate = { startup: function AMP_startup() { AddonManagerInternal.startup(); }, @@ -2086,7 +2086,7 @@ var AddonManagerPrivate = { * This is the public API that UI and developers should be calling. All methods * just forward to AddonManagerInternal. */ -var AddonManager = { +this.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 19872a12e94f..559760bc1af2 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"); -var EXPORTED_SYMBOLS = [ "AddonRepository" ]; +this.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. */ -var AddonRepository = { +this.AddonRepository = { /** * Whether caching is currently enabled */ diff --git a/toolkit/mozapps/extensions/AddonUpdateChecker.jsm b/toolkit/mozapps/extensions/AddonUpdateChecker.jsm index bda63ae22d75..3b5dc7de71a5 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; -var EXPORTED_SYMBOLS = [ "AddonUpdateChecker" ]; +this.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; } -var AddonUpdateChecker = { +this.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 76cb14d2b701..9a77c54295a2 100644 --- a/toolkit/mozapps/extensions/ChromeManifestParser.jsm +++ b/toolkit/mozapps/extensions/ChromeManifestParser.jsm @@ -4,7 +4,7 @@ "use strict"; -var EXPORTED_SYMBOLS = ["ChromeManifestParser"]; +this.EXPORTED_SYMBOLS = ["ChromeManifestParser"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -33,7 +33,7 @@ function flushJarCache(aJarFile) { /** * Parses chrome manifest files. */ -var ChromeManifestParser = { +this.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 f7037eed8eac..f76aa9d06fbf 100644 --- a/toolkit/mozapps/extensions/LightweightThemeImageOptimizer.jsm +++ b/toolkit/mozapps/extensions/LightweightThemeImageOptimizer.jsm @@ -4,7 +4,7 @@ "use strict"; -let EXPORTED_SYMBOLS = ["LightweightThemeImageOptimizer"]; +this.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; -let LightweightThemeImageOptimizer = { +this.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 7ee8740d84c8..1e579e4ce444 100644 --- a/toolkit/mozapps/extensions/LightweightThemeManager.jsm +++ b/toolkit/mozapps/extensions/LightweightThemeManager.jsm @@ -4,7 +4,7 @@ "use strict"; -var EXPORTED_SYMBOLS = ["LightweightThemeManager"]; +this.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; -var LightweightThemeManager = { +this.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 dc2342c135d5..bb495d27134f 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; -var EXPORTED_SYMBOLS = []; +this.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 bbb6d32c9fe4..82fa9d8cd07b 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; -var EXPORTED_SYMBOLS = []; +this.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 ffe0833eb2b5..d33098b2fde6 100644 --- a/toolkit/mozapps/extensions/addonManager.js +++ b/toolkit/mozapps/extensions/addonManager.js @@ -206,4 +206,4 @@ amManager.prototype = { Ci.nsIObserver]) }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([amManager]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([amManager]); diff --git a/toolkit/mozapps/extensions/amContentHandler.js b/toolkit/mozapps/extensions/amContentHandler.js index 34d17bf36ad1..e5c65d9590ae 100644 --- a/toolkit/mozapps/extensions/amContentHandler.js +++ b/toolkit/mozapps/extensions/amContentHandler.js @@ -84,4 +84,4 @@ amContentHandler.prototype = { } }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([amContentHandler]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([amContentHandler]); diff --git a/toolkit/mozapps/extensions/amWebInstallListener.js b/toolkit/mozapps/extensions/amWebInstallListener.js index 3d82aada033e..06ac7c248dab 100644 --- a/toolkit/mozapps/extensions/amWebInstallListener.js +++ b/toolkit/mozapps/extensions/amWebInstallListener.js @@ -312,4 +312,4 @@ extWebInstallListener.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.amIWebInstallListener]) }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([extWebInstallListener]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([extWebInstallListener]); diff --git a/toolkit/mozapps/extensions/nsBlocklistService.js b/toolkit/mozapps/extensions/nsBlocklistService.js index ce9356c83f93..da8d4a389aeb 100644 --- a/toolkit/mozapps/extensions/nsBlocklistService.js +++ b/toolkit/mozapps/extensions/nsBlocklistService.js @@ -1177,4 +1177,4 @@ BlocklistItemData.prototype = { } }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([Blocklist]); +this.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 7b6d8960c575..7fe60e632dd8 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 @@ -var EXPORTED_SYMBOLS = ["VERSION"]; +this.EXPORTED_SYMBOLS = ["VERSION"]; -var VERSION = 1; +this.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 4afb723f695b..532741e121b9 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 @@ -var EXPORTED_SYMBOLS = ["VERSION"]; +this.EXPORTED_SYMBOLS = ["VERSION"]; -var VERSION = 2; +this.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 2454336c6914..1b813faaf47e 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 @@ -var EXPORTED_SYMBOLS = ["VERSION"]; +this.EXPORTED_SYMBOLS = ["VERSION"]; -var VERSION = 3; +this.VERSION = 3; diff --git a/toolkit/mozapps/handling/nsContentDispatchChooser.js b/toolkit/mozapps/handling/nsContentDispatchChooser.js index fa4dd4bf1cba..01a417ff156b 100644 --- a/toolkit/mozapps/handling/nsContentDispatchChooser.js +++ b/toolkit/mozapps/handling/nsContentDispatchChooser.js @@ -87,4 +87,4 @@ nsContentDispatchChooser.prototype = let components = [nsContentDispatchChooser]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/toolkit/mozapps/shared/CertUtils.jsm b/toolkit/mozapps/shared/CertUtils.jsm index 2af846425ef8..c6f55ee29408 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 -EXPORTED_SYMBOLS = [ "BadCertHandler", "checkCert", "readCertPrefs", "validateCert" ]; +this.EXPORTED_SYMBOLS = [ "BadCertHandler", "checkCert", "readCertPrefs", "validateCert" ]; const Ce = Components.Exception; const Ci = Components.interfaces; @@ -31,7 +31,8 @@ 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. */ -function readCertPrefs(aPrefBranch) { +this.readCertPrefs = + function readCertPrefs(aPrefBranch) { if (Services.prefs.getBranch(aPrefBranch).getChildList("").length == 0) return null; @@ -70,7 +71,8 @@ function readCertPrefs(aPrefBranch) { * aCertificate wasn't specified and aCerts is not null or an empty * array. */ -function validateCert(aCertificate, aCerts) { +this.validateCert = + function validateCert(aCertificate, aCerts) { // If there are no certificate requirements then just exit if (!aCerts || aCerts.length == 0) return; @@ -137,7 +139,8 @@ function validateCert(aCertificate, aCerts) { * from the aCerts param is different than the expected value. * NS_ERROR_ABORT if the certificate issuer is not built-in. */ -function checkCert(aChannel, aAllowNonBuiltInCerts, aCerts) { +this.checkCert = + function checkCert(aChannel, aAllowNonBuiltInCerts, aCerts) { if (!aChannel.originalURI.schemeIs("https")) { // Require https if there are certificate values to verify if (aCerts) { @@ -184,7 +187,8 @@ function isBuiltinToken(tokenName) { * When true certificates that aren't builtin are allowed. When false * or not specified the certificate must be a builtin certificate. */ -function BadCertHandler(aAllowNonBuiltInCerts) { +this.BadCertHandler = + function BadCertHandler(aAllowNonBuiltInCerts) { this.allowNonBuiltInCerts = aAllowNonBuiltInCerts; } BadCertHandler.prototype = { diff --git a/toolkit/mozapps/shared/FileUtils.jsm b/toolkit/mozapps/shared/FileUtils.jsm index 72c0b9bdc7ab..d11540ec55c9 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/. */ -EXPORTED_SYMBOLS = [ "FileUtils" ]; +this.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"); -var FileUtils = { +this.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 000891410040..a32f715a39b5 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]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); #if 0 /** diff --git a/toolkit/mozapps/update/nsUpdateServiceStub.js b/toolkit/mozapps/update/nsUpdateServiceStub.js index ce3a4d5ef18d..78babe57d303 100644 --- a/toolkit/mozapps/update/nsUpdateServiceStub.js +++ b/toolkit/mozapps/update/nsUpdateServiceStub.js @@ -60,4 +60,4 @@ UpdateServiceStub.prototype = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]) }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([UpdateServiceStub]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([UpdateServiceStub]); diff --git a/toolkit/mozapps/update/nsUpdateTimerManager.js b/toolkit/mozapps/update/nsUpdateTimerManager.js index 8bfe54ffef4d..0e5d8715981d 100644 --- a/toolkit/mozapps/update/nsUpdateTimerManager.js +++ b/toolkit/mozapps/update/nsUpdateTimerManager.js @@ -302,4 +302,4 @@ TimerManager.prototype = { Ci.nsIObserver]) }; -var NSGetFactory = XPCOMUtils.generateNSGetFactory([TimerManager]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([TimerManager]); diff --git a/toolkit/webapps/WebappOSUtils.jsm b/toolkit/webapps/WebappOSUtils.jsm index 1fb802f790df..24ca60fab405 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"); -let EXPORTED_SYMBOLS = ["WebappOSUtils"]; +this.EXPORTED_SYMBOLS = ["WebappOSUtils"]; -let WebappOSUtils = { +this.WebappOSUtils = { launch: function(aData) { #ifdef XP_WIN let appRegKey; diff --git a/toolkit/webapps/WebappsInstaller.jsm b/toolkit/webapps/WebappsInstaller.jsm index 73453bfe9f5e..2666c26b132b 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/. */ -let EXPORTED_SYMBOLS = ["WebappsInstaller"]; +this.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"); -let WebappsInstaller = { +this.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 e85d55e42d2e..c61218875bd0 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; -var EXPORTED_SYMBOLS = ["Profiler"]; +this.EXPORTED_SYMBOLS = ["Profiler"]; -let Profiler = { +this.Profiler = { }; diff --git a/uriloader/exthandler/nsHandlerService.js b/uriloader/exthandler/nsHandlerService.js index d437b2807cdb..4e1672ed3a5e 100644 --- a/uriloader/exthandler/nsHandlerService.js +++ b/uriloader/exthandler/nsHandlerService.js @@ -1404,4 +1404,4 @@ HandlerService.prototype = { //****************************************************************************// // More XPCOM Plumbing -NSGetFactory = XPCOMUtils.generateNSGetFactory([HandlerService]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([HandlerService]); diff --git a/uriloader/exthandler/nsWebHandlerApp.js b/uriloader/exthandler/nsWebHandlerApp.js index 4789b8307242..54f8a95e313d 100644 --- a/uriloader/exthandler/nsWebHandlerApp.js +++ b/uriloader/exthandler/nsWebHandlerApp.js @@ -149,5 +149,5 @@ nsWebHandlerApp.prototype = { //////////////////////////////////////////////////////////////////////////////// //// Module -NSGetFactory = XPCOMUtils.generateNSGetFactory([nsWebHandlerApp]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([nsWebHandlerApp]); diff --git a/webapprt/CommandLineHandler.js b/webapprt/CommandLineHandler.js index a90e46e6de7f..e61183541700 100644 --- a/webapprt/CommandLineHandler.js +++ b/webapprt/CommandLineHandler.js @@ -68,4 +68,4 @@ CommandLineHandler.prototype = { }; let components = [CommandLineHandler]; -let NSGetFactory = XPCOMUtils.generateNSGetFactory(components); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(components); diff --git a/webapprt/ContentPermission.js b/webapprt/ContentPermission.js index 0f7d2d063993..3a726393f61d 100644 --- a/webapprt/ContentPermission.js +++ b/webapprt/ContentPermission.js @@ -86,4 +86,4 @@ ContentPermission.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermission]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPermission]); diff --git a/webapprt/ContentPolicy.js b/webapprt/ContentPolicy.js index c9af5b7e311f..8f1c0eb4a084 100644 --- a/webapprt/ContentPolicy.js +++ b/webapprt/ContentPolicy.js @@ -37,4 +37,4 @@ ContentPolicy.prototype = { }, }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPolicy]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([ContentPolicy]); diff --git a/webapprt/DirectoryProvider.js b/webapprt/DirectoryProvider.js index a78939903c2c..9b199863b7d3 100644 --- a/webapprt/DirectoryProvider.js +++ b/webapprt/DirectoryProvider.js @@ -53,4 +53,4 @@ DirectoryProvider.prototype = { }, }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DirectoryProvider]); diff --git a/webapprt/Startup.jsm b/webapprt/Startup.jsm index ba07d72469b7..0402debe1ed6 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. */ -const EXPORTED_SYMBOLS = []; +this.EXPORTED_SYMBOLS = []; const Ci = Components.interfaces; const Cu = Components.utils; diff --git a/webapprt/WebappRT.jsm b/webapprt/WebappRT.jsm index c6a30eca6ccc..3a920908eeee 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/. */ -const EXPORTED_SYMBOLS = ["WebappRT"]; +this.EXPORTED_SYMBOLS = ["WebappRT"]; const Cc = Components.classes; const Ci = Components.interfaces; @@ -21,7 +21,7 @@ XPCOMUtils.defineLazyGetter(this, "DOMApplicationRegistry", function() { return DOMApplicationRegistry; }); -let WebappRT = { +this.WebappRT = { _config: null, get config() { diff --git a/webapprt/WebappsHandler.jsm b/webapprt/WebappsHandler.jsm index 03374a939e5a..a6fe4440de47 100644 --- a/webapprt/WebappsHandler.jsm +++ b/webapprt/WebappsHandler.jsm @@ -4,7 +4,7 @@ "use strict"; -let EXPORTED_SYMBOLS = ["WebappsHandler"]; +this.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"); -let WebappsHandler = { +this.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 2c391eb5bad9..ebea6224673a 100644 --- a/xpcom/ds/nsINIProcessor.js +++ b/xpcom/ds/nsINIProcessor.js @@ -189,4 +189,4 @@ stringEnumerator.prototype = { }; let component = [INIProcessorFactory]; -var NSGetFactory = XPCOMUtils.generateNSGetFactory(component); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component); diff --git a/xpcom/sample/nsSample.js b/xpcom/sample/nsSample.js index 4f624e0099c1..6334182b23a0 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) - var NSGetFactory = XPCOMUtils.generateNSGetFactory([mySample]); + this.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 7850749983cd..375c40e2719f 100644 --- a/xpcom/tests/regorder/core/component.js +++ b/xpcom/tests/regorder/core/component.js @@ -30,7 +30,8 @@ var gRegTestCoreComponent = const kClassID = Components.ID("{56ab1cd4-ac44-4f86-8104-171f8b8f2fc7}"); -function NSGetFactory(aClassID) { +this.NSGetFactory = + 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 a12404d9beab..40759a01ba0e 100644 --- a/xpcom/tests/regorder/core/component2.js +++ b/xpcom/tests/regorder/core/component2.js @@ -30,7 +30,8 @@ var gRegTestCoreComponent = const kClassID = Components.ID("{d04d1298-6dac-459b-a13b-bcab235730a0}"); -function NSGetFactory(aClassID) { +this.NSGetFactory = + 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 1d045bf89c22..763fb44ef8e5 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}"); -function NSGetFactory(cid) +this.NSGetFactory = 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 06310d2d0344..e6cf90660c6c 100644 --- a/xulrunner/examples/simple/components/src/SimpleTest.js +++ b/xulrunner/examples/simple/components/src/SimpleTest.js @@ -24,4 +24,4 @@ SimpleTest.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([SimpleTest]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([SimpleTest]); diff --git a/xulrunner/setup/nsXULAppInstall.js b/xulrunner/setup/nsXULAppInstall.js index e5fcc933861a..7bd11064bb94 100644 --- a/xulrunner/setup/nsXULAppInstall.js +++ b/xulrunner/setup/nsXULAppInstall.js @@ -315,4 +315,4 @@ AppInstall.prototype = { } }; -const NSGetFactory = XPCOMUtils.generateNSGetFactory([AppInstall]); +this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AppInstall]);