Mass-replace global-scope let with var in Pale Moon and TychoAM

tag #155
This commit is contained in:
wolfbeast 2018-04-16 14:47:03 +02:00 • committed by Roy Tam
commit d5b0bc88af
62 changed files with 120 additions and 119 deletions

View file

@ -234,8 +234,8 @@ const SEARCH_ENGINES = {
}; };
// This global tracks if the page has been set up before, to prevent double inits // This global tracks if the page has been set up before, to prevent double inits
let gInitialized = false; var gInitialized = false;
let gObserver = new MutationObserver(function (mutations) { var gObserver = new MutationObserver(function (mutations) {
for (let mutation of mutations) { for (let mutation of mutations) {
if (mutation.attributeName == "searchEngineURL") { if (mutation.attributeName == "searchEngineURL") {
setupSearchEngine(); setupSearchEngine();

View file

@ -226,7 +226,7 @@ const gXPInstallObserver = {
* - If an add-on was installed, incrementing the count, show the bar. * - If an add-on was installed, incrementing the count, show the bar.
* - If an add-on was uninstalled, and no more items are left, hide the bar. * - If an add-on was uninstalled, and no more items are left, hide the bar.
*/ */
let AddonsMgrListener = { var AddonsMgrListener = {
get addonBar() document.getElementById("addon-bar"), get addonBar() document.getElementById("addon-bar"),
get statusBar() document.getElementById("status-bar"), get statusBar() document.getElementById("status-bar"),
getAddonBarItemCount: function() { getAddonBarItemCount: function() {
@ -461,7 +461,7 @@ var LightWeightThemeWebInstaller = {
/* /*
* Listen for Lightweight Theme styling changes and update the browser's theme accordingly. * Listen for Lightweight Theme styling changes and update the browser's theme accordingly.
*/ */
let LightweightThemeListener = { var LightweightThemeListener = {
_modifiedStyles: [], _modifiedStyles: [],
init: function () { init: function () {

View file

@ -13,7 +13,7 @@
// chrome-only, we must listen for the simple gesture events during // chrome-only, we must listen for the simple gesture events during
// the capturing phase and call stopPropagation on every event. // the capturing phase and call stopPropagation on every event.
let gGestureSupport = { var gGestureSupport = {
_currentRotation: 0, _currentRotation: 0,
_lastRotateDelta: 0, _lastRotateDelta: 0,
_rotateMomentumThreshold: .75, _rotateMomentumThreshold: .75,
@ -532,7 +532,7 @@ let gGestureSupport = {
}; };
// History Swipe Animation Support (bug 678392) // History Swipe Animation Support (bug 678392)
let gHistorySwipeAnimation = { var gHistorySwipeAnimation = {
active: false, active: false,
isLTR: false, isLTR: false,

View file

@ -959,7 +959,7 @@ var PlacesMenuDNDHandler = {
* This object handles the initialization and uninitialization of the bookmarks * This object handles the initialization and uninitialization of the bookmarks
* toolbar. * toolbar.
*/ */
let PlacesToolbarHelper = { var PlacesToolbarHelper = {
_place: "place:folder=TOOLBAR", _place: "place:folder=TOOLBAR",
get _viewElt() { get _viewElt() {
@ -1006,7 +1006,7 @@ let PlacesToolbarHelper = {
* menu button. * menu button.
*/ */
let BookmarkingUI = { var BookmarkingUI = {
get button() { get button() {
if (!this._button) { if (!this._button) {
this._button = document.getElementById("bookmarks-menu-button"); this._button = document.getElementById("bookmarks-menu-button");

View file

@ -3,7 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
// gSyncUI handles updating the tools menu // gSyncUI handles updating the tools menu
let gSyncUI = { var gSyncUI = {
_obs: ["weave:service:sync:start", _obs: ["weave:service:sync:start",
"weave:service:sync:delayed", "weave:service:sync:delayed",
"weave:service:quota:remaining", "weave:service:quota:remaining",

View file

@ -7,7 +7,7 @@
/** /**
* Keeps thumbnails of open web pages up-to-date. * Keeps thumbnails of open web pages up-to-date.
*/ */
let gBrowserThumbnails = { var gBrowserThumbnails = {
/** /**
* Pref that controls whether we can store SSL content on disk * Pref that controls whether we can store SSL content on disk
*/ */

View file

@ -3,7 +3,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this # 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/. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
let WebrtcIndicator = { var WebrtcIndicator = {
init: function () { init: function () {
let temp = {}; let temp = {};
Cu.import("resource:///modules/webrtcUI.jsm", temp); Cu.import("resource:///modules/webrtcUI.jsm", temp);

View file

@ -2329,7 +2329,7 @@ function BrowserOnAboutPageLoad(doc) {
/** /**
* Handle command events bubbling up from error page content * Handle command events bubbling up from error page content
*/ */
let BrowserOnClick = { var BrowserOnClick = {
handleEvent: function BrowserOnClick_handleEvent(aEvent) { handleEvent: function BrowserOnClick_handleEvent(aEvent) {
if (!aEvent.isTrusted || // Don't trust synthetic events if (!aEvent.isTrusted || // Don't trust synthetic events
aEvent.button == 2 || aEvent.target.localName != "button") { aEvent.button == 2 || aEvent.target.localName != "button") {
@ -6998,7 +6998,8 @@ function focusNextFrame(event) {
if (element.ownerDocument == document) if (element.ownerDocument == document)
focusAndSelectUrlBar(); focusAndSelectUrlBar();
} }
let BrowserChromeTest = {
var BrowserChromeTest = {
_cb: null, _cb: null,
_ready: false, _ready: false,
markAsReady: function () { markAsReady: function () {
@ -7016,7 +7017,7 @@ let BrowserChromeTest = {
} }
}; };
let ToolbarIconColor = { var ToolbarIconColor = {
init: function () { init: function () {
this._initialized = true; this._initialized = true;

View file

@ -7,7 +7,7 @@
/** /**
* This singleton implements site dragging functionality. * This singleton implements site dragging functionality.
*/ */
let gDrag = { var gDrag = {
/** /**
* The site offset to the drag start point. * The site offset to the drag start point.
*/ */

View file

@ -4,7 +4,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */ * You can obtain one at http://mozilla.org/MPL/2.0/. */
#endif #endif
let gDragDataHelper = { var gDragDataHelper = {
get mimeType() { get mimeType() {
return "text/x-moz-url"; return "text/x-moz-url";
}, },

View file

@ -11,7 +11,7 @@ const DELAY_REARRANGE_MS = 100;
/** /**
* This singleton implements site dropping functionality. * This singleton implements site dropping functionality.
*/ */
let gDrop = { var gDrop = {
/** /**
* The last drop target. * The last drop target.
*/ */

View file

@ -9,7 +9,7 @@
* indicate the transformation that results from dropping a cell at a certain * indicate the transformation that results from dropping a cell at a certain
* position. * position.
*/ */
let gDropPreview = { var gDropPreview = {
/** /**
* Rearranges the sites currently contained in the grid when a site would be * Rearranges the sites currently contained in the grid when a site would be
* dropped onto the given cell. * dropped onto the given cell.

View file

@ -9,7 +9,7 @@
* the default DnD target detection relies on the cursor's position. We want * the default DnD target detection relies on the cursor's position. We want
* to pick a drop target based on the dragged site's position. * to pick a drop target based on the dragged site's position.
*/ */
let gDropTargetShim = { var gDropTargetShim = {
/** /**
* Cache for the position of all cells, cleaned after drag finished. * Cache for the position of all cells, cleaned after drag finished.
*/ */

View file

@ -7,7 +7,7 @@
/** /**
* This singleton represents the grid that contains all sites. * This singleton represents the grid that contains all sites.
*/ */
let gGrid = { var gGrid = {
/** /**
* The DOM node of the grid. * The DOM node of the grid.
*/ */

View file

@ -18,7 +18,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "Rect",
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm"); "resource://gre/modules/PrivateBrowsingUtils.jsm");
let { var {
links: gLinks, links: gLinks,
allPages: gAllPages, allPages: gAllPages,
linkChecker: gLinkChecker, linkChecker: gLinkChecker,

View file

@ -8,7 +8,7 @@
* This singleton represents the whole 'New Tab Page' and takes care of * This singleton represents the whole 'New Tab Page' and takes care of
* initializing all its components. * initializing all its components.
*/ */
let gPage = { var gPage = {
/** /**
* Initializes the page. * Initializes the page.
*/ */

View file

@ -9,7 +9,7 @@
* in the DOM and by showing or hiding the node. It additionally provides * in the DOM and by showing or hiding the node. It additionally provides
* convenience methods to work with a site's DOM node. * convenience methods to work with a site's DOM node.
*/ */
let gTransformation = { var gTransformation = {
/** /**
* Returns the width of the left and top border of a cell. We need to take it * Returns the width of the left and top border of a cell. We need to take it
* into account when measuring and comparing site and cell positions. * into account when measuring and comparing site and cell positions.

View file

@ -8,7 +8,7 @@
* Dialog allowing to undo the removal of single site or to completely restore * Dialog allowing to undo the removal of single site or to completely restore
* the grid's original state. * the grid's original state.
*/ */
let gUndoDialog = { var gUndoDialog = {
/** /**
* The undo dialog's timeout in miliseconds. * The undo dialog's timeout in miliseconds.
*/ */

View file

@ -8,7 +8,7 @@
* This singleton provides functionality to update the current grid to a new * This singleton provides functionality to update the current grid to a new
* set of pinned and blocked sites. It adds, moves and removes sites. * set of pinned and blocked sites. It adds, moves and removes sites.
*/ */
let gUpdater = { var gUpdater = {
/** /**
* Updates the current grid according to its pinned and blocked sites. * Updates the current grid according to its pinned and blocked sites.
* This removes old, moves existing and creates new sites to fill gaps. * This removes old, moves existing and creates new sites to fill gaps.

View file

@ -7,7 +7,7 @@
var browser; var browser;
var dialog = {}; var dialog = {};
var pref = null; var pref = null;
let openLocationModule = {}; var openLocationModule = {};
try { try {
pref = Components.classes["@mozilla.org/preferences-service;1"] pref = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch); .getService(Components.interfaces.nsIPrefBranch);
@ -16,7 +16,7 @@ try {
} }
Components.utils.import("resource:///modules/openLocationLastURL.jsm", openLocationModule); Components.utils.import("resource:///modules/openLocationLastURL.jsm", openLocationModule);
let gOpenLocationLastURL = new openLocationModule.OpenLocationLastURL(window.opener); var gOpenLocationLastURL = new openLocationModule.OpenLocationLastURL(window.opener);
function onLoad() function onLoad()
{ {

View file

@ -11,7 +11,7 @@ Cu.import("resource://gre/modules/PlacesUtils.jsm", this);
Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm");
let RemoteTabViewer = { var RemoteTabViewer = {
_tabsList: null, _tabsList: null,
init: function () { init: function () {

View file

@ -15,7 +15,7 @@ const ADD_DEVICE_PAGE = 0;
const SYNC_KEY_PAGE = 1; const SYNC_KEY_PAGE = 1;
const DEVICE_CONNECTED_PAGE = 2; const DEVICE_CONNECTED_PAGE = 2;
let gSyncAddDevice = { var gSyncAddDevice = {
init: function init() { init: function init() {
this.pin1.setAttribute("maxlength", PIN_PART_LENGTH); this.pin1.setAttribute("maxlength", PIN_PART_LENGTH);

View file

@ -8,7 +8,7 @@ const Cc = Components.classes;
Components.utils.import("resource://services-sync/main.js"); Components.utils.import("resource://services-sync/main.js");
Components.utils.import("resource://gre/modules/Services.jsm"); Components.utils.import("resource://gre/modules/Services.jsm");
let Change = { var Change = {
_dialog: null, _dialog: null,
_dialogType: null, _dialogType: null,
_status: null, _status: null,

View file

@ -6,8 +6,8 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://services-sync/main.js"); Cu.import("resource://services-sync/main.js");
let gProgressBar; var gProgressBar;
let gCounter = 0; var gCounter = 0;
function onLoad(event) { function onLoad(event) {
Services.obs.addObserver(onEngineSync, "weave:engine:sync:finish", false); Services.obs.addObserver(onEngineSync, "weave:engine:sync:finish", false);

View file

@ -10,7 +10,7 @@ const Cu = Components.utils;
Cu.import("resource://services-sync/main.js"); Cu.import("resource://services-sync/main.js");
Cu.import("resource://gre/modules/DownloadUtils.jsm"); Cu.import("resource://gre/modules/DownloadUtils.jsm");
let gSyncQuota = { var gSyncQuota = {
init: function init() { init: function init() {
this.bundle = document.getElementById("quotaStrings"); this.bundle = document.getElementById("quotaStrings");
@ -86,7 +86,7 @@ let gSyncQuota = {
}; };
let gUsageTreeView = { var gUsageTreeView = {
_ignored: {keys: true, _ignored: {keys: true,
meta: true, meta: true,

View file

@ -8,7 +8,7 @@
const PERMISSIONS_RWUSR = 0x180; const PERMISSIONS_RWUSR = 0x180;
// Weave should always exist before before this file gets included. // Weave should always exist before before this file gets included.
let gSyncUtils = { var gSyncUtils = {
get bundle() { get bundle() {
delete this.bundle; delete this.bundle;
return this.bundle = Services.strings.createBundle("chrome://browser/locale/syncSetup.properties"); return this.bundle = Services.strings.createBundle("chrome://browser/locale/syncSetup.properties");

View file

@ -104,7 +104,7 @@ const kPartialDownloadSuffix = ".part";
const kPrefBranch = Services.prefs.getBranch("browser.download."); const kPrefBranch = Services.prefs.getBranch("browser.download.");
let PrefObserver = { var PrefObserver = {
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference]), Ci.nsISupportsWeakReference]),
getPref: function PO_getPref(name) { getPref: function PO_getPref(name) {

View file

@ -4,7 +4,7 @@
Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
let ContentAreaDownloadsView = { var ContentAreaDownloadsView = {
init: function CADV_init() { init: function CADV_init() {
let view = new DownloadsPlacesView(document.getElementById("downloadsRichListBox")); let view = new DownloadsPlacesView(document.getElementById("downloadsRichListBox"));
// Do not display the Places downloads in private windows // Do not display the Places downloads in private windows

View file

@ -1603,7 +1603,7 @@ PlacesController.prototype = {
* the view that the item(s) have been dropped on was not necessarily active. * the view that the item(s) have been dropped on was not necessarily active.
* Drop functions are passed the view that is being dropped on. * Drop functions are passed the view that is being dropped on.
*/ */
let PlacesControllerDragHelper = { var PlacesControllerDragHelper = {
/** /**
* DOM Element currently being dragged over * DOM Element currently being dragged over
*/ */

View file

@ -1377,7 +1377,7 @@ var ViewMenu = {
} }
} }
let ContentArea = { var ContentArea = {
_specialViews: new Map(), _specialViews: new Map(),
init: function CA_init() { init: function CA_init() {
@ -1511,7 +1511,7 @@ let ContentArea = {
} }
}; };
let ContentTree = { var ContentTree = {
init: function CT_init() { init: function CT_init() {
this._view = document.getElementById("placeContent"); this._view = document.getElementById("placeContent");
}, },

View file

@ -13,15 +13,15 @@ Cu.import("resource://gre/modules/AddonManager.jsm");
Cu.import("resource://gre/modules/NetUtil.jsm"); Cu.import("resource://gre/modules/NetUtil.jsm");
Cu.import("resource://gre/modules/ForgetAboutSite.jsm"); Cu.import("resource://gre/modules/ForgetAboutSite.jsm");
let gFaviconService = Cc["@mozilla.org/browser/favicon-service;1"]. var gFaviconService = Cc["@mozilla.org/browser/favicon-service;1"].
getService(Ci.nsIFaviconService); getService(Ci.nsIFaviconService);
let gPlacesDatabase = Cc["@mozilla.org/browser/nav-history-service;1"]. var gPlacesDatabase = Cc["@mozilla.org/browser/nav-history-service;1"].
getService(Ci.nsPIPlacesDatabase). getService(Ci.nsPIPlacesDatabase).
DBConnection. DBConnection.
clone(true); clone(true);
let gSitesStmt = gPlacesDatabase.createAsyncStatement( var gSitesStmt = gPlacesDatabase.createAsyncStatement(
"SELECT get_unreversed_host(rev_host) AS host " + "SELECT get_unreversed_host(rev_host) AS host " +
"FROM moz_places " + "FROM moz_places " +
"WHERE rev_host > '.' " + "WHERE rev_host > '.' " +
@ -30,12 +30,12 @@ let gSitesStmt = gPlacesDatabase.createAsyncStatement(
"ORDER BY MAX(frecency) DESC " + "ORDER BY MAX(frecency) DESC " +
"LIMIT :limit"); "LIMIT :limit");
let gVisitStmt = gPlacesDatabase.createAsyncStatement( var gVisitStmt = gPlacesDatabase.createAsyncStatement(
"SELECT SUM(visit_count) AS count " + "SELECT SUM(visit_count) AS count " +
"FROM moz_places " + "FROM moz_places " +
"WHERE rev_host = :rev_host"); "WHERE rev_host = :rev_host");
let gFlash = { var gFlash = {
name: "Shockwave Flash", name: "Shockwave Flash",
betterName: "Adobe Flash", betterName: "Adobe Flash",
type: "application/x-shockwave-flash", type: "application/x-shockwave-flash",
@ -290,7 +290,7 @@ Site.prototype = {
* *
* Inspired by pageinfo/permissions.js * Inspired by pageinfo/permissions.js
*/ */
let PermissionDefaults = { var PermissionDefaults = {
UNKNOWN: Ci.nsIPermissionManager.UNKNOWN_ACTION, // 0 UNKNOWN: Ci.nsIPermissionManager.UNKNOWN_ACTION, // 0
ALLOW: Ci.nsIPermissionManager.ALLOW_ACTION, // 1 ALLOW: Ci.nsIPermissionManager.ALLOW_ACTION, // 1
DENY: Ci.nsIPermissionManager.DENY_ACTION, // 2 DENY: Ci.nsIPermissionManager.DENY_ACTION, // 2
@ -449,7 +449,7 @@ let PermissionDefaults = {
/** /**
* AboutPermissions manages the about:permissions page. * AboutPermissions manages the about:permissions page.
*/ */
let AboutPermissions = { var AboutPermissions = {
/** /**
* Maximum number of sites to return from the places database. * Maximum number of sites to return from the places database.
*/ */

View file

@ -3,7 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * 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/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
let gSanitizeDialog = Object.freeze({ var gSanitizeDialog = Object.freeze({
onClearHistoryChanged: function () { onClearHistoryChanged: function () {
let downloadsPref = document.getElementById("privacy.clearOnShutdown.downloads"); let downloadsPref = document.getElementById("privacy.clearOnShutdown.downloads");
let historyPref = document.getElementById("privacy.clearOnShutdown.history"); let historyPref = document.getElementById("privacy.clearOnShutdown.history");

View file

@ -9,7 +9,7 @@ const PAGE_NO_ACCOUNT = 0;
const PAGE_HAS_ACCOUNT = 1; const PAGE_HAS_ACCOUNT = 1;
const PAGE_NEEDS_UPDATE = 2; const PAGE_NEEDS_UPDATE = 2;
let gSyncPane = { var gSyncPane = {
_stringBundle: null, _stringBundle: null,
prefArray: ["engine.bookmarks", "engine.passwords", "engine.prefs", prefArray: ["engine.bookmarks", "engine.passwords", "engine.prefs",
"engine.tabs", "engine.history"], "engine.tabs", "engine.history"],

View file

@ -38,7 +38,7 @@ this.SessionStorage = {
Object.freeze(SessionStorage); Object.freeze(SessionStorage);
let DomStorage = { var DomStorage = {
/** /**
* Reads all session storage data from the given docShell. * Reads all session storage data from the given docShell.
* @param aDocShell * @param aDocShell
@ -142,7 +142,7 @@ let DomStorage = {
} }
}; };
let History = { var History = {
/** /**
* Returns a given history entry's URI. * Returns a given history entry's URI.
* @param aHistory * @param aHistory

View file

@ -88,7 +88,7 @@ XPCOMUtils.defineLazyServiceGetter(this, "gScreenManager",
// retrieved from a given docShell if not already collected before. // retrieved from a given docShell if not already collected before.
// This is made so they're automatically in sync with all nsIDocShell.allow* // This is made so they're automatically in sync with all nsIDocShell.allow*
// properties. // properties.
let gDocShellCapabilities = (function () { var gDocShellCapabilities = (function () {
let caps; let caps;
return docShell => { return docShell => {
@ -247,7 +247,7 @@ this.SessionStore = {
// Freeze the SessionStore object. We don't want anyone to modify it. // Freeze the SessionStore object. We don't want anyone to modify it.
Object.freeze(SessionStore); Object.freeze(SessionStore);
let SessionStoreInternal = { var SessionStoreInternal = {
QueryInterface: XPCOMUtils.generateQI([ QueryInterface: XPCOMUtils.generateQI([
Ci.nsIDOMEventListener, Ci.nsIDOMEventListener,
Ci.nsIObserver, Ci.nsIObserver,
@ -4471,7 +4471,7 @@ let SessionStoreInternal = {
* pinned, visible and hidden tabs in that and FIFO order. Hidden tabs are only * pinned, visible and hidden tabs in that and FIFO order. Hidden tabs are only
* restored with restore_hidden_tabs=true. * restored with restore_hidden_tabs=true.
*/ */
let TabRestoreQueue = { var TabRestoreQueue = {
// The separate buckets used to store tabs. // The separate buckets used to store tabs.
tabs: {priority: [], visible: [], hidden: []}, tabs: {priority: [], visible: [], hidden: []},
@ -4608,7 +4608,7 @@ let TabRestoreQueue = {
// A map storing a closed window's state data until it goes aways (is GC'ed). // A map storing a closed window's state data until it goes aways (is GC'ed).
// This ensures that API clients can still read (but not write) states of // This ensures that API clients can still read (but not write) states of
// windows they still hold a reference to but we don't. // windows they still hold a reference to but we don't.
let DyingWindowCache = { var DyingWindowCache = {
_data: new WeakMap(), _data: new WeakMap(),
has: function (window) { has: function (window) {
@ -4631,7 +4631,7 @@ let DyingWindowCache = {
// A set of tab attributes to persist. We will read a given list of tab // A set of tab attributes to persist. We will read a given list of tab
// attributes when collecting tab data and will re-set those attributes when // attributes when collecting tab data and will re-set those attributes when
// the given tab data is restored to a new tab. // the given tab data is restored to a new tab.
let TabAttributes = { var TabAttributes = {
_attrs: new Set(), _attrs: new Set(),
// We never want to directly read or write those attributes. // We never want to directly read or write those attributes.
@ -4677,7 +4677,7 @@ let TabAttributes = {
// This is used to help meter the number of restoring tabs. This is the control // This is used to help meter the number of restoring tabs. This is the control
// point for telling the next tab to restore. It gets attached to each gBrowser // point for telling the next tab to restore. It gets attached to each gBrowser
// via gBrowser.addTabsProgressListener // via gBrowser.addTabsProgressListener
let gRestoreTabsProgressListener = { var gRestoreTabsProgressListener = {
onStateChange: function(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) { onStateChange: function(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
// Ignore state changes on browsers that we've already restored and state // Ignore state changes on browsers that we've already restored and state
// changes that aren't applicable. // changes that aren't applicable.

View file

@ -130,7 +130,7 @@ const TaskUtils = {
} }
}; };
let SessionFileInternal = { var SessionFileInternal = {
/** /**
* A promise fulfilled once initialization is complete * A promise fulfilled once initialization is complete
*/ */

View file

@ -50,7 +50,7 @@ function debug(aMsg) {
Services.console.logStringMessage(aMsg); Services.console.logStringMessage(aMsg);
} }
let gOnceInitializedDeferred = Promise.defer(); var gOnceInitializedDeferred = Promise.defer();
/* :::::::: The Service ::::::::::::::: */ /* :::::::: The Service ::::::::::::::: */

View file

@ -17,7 +17,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "WindowsRegistry",
/** /**
* Internal functionality to save and restore the docShell.allow* properties. * Internal functionality to save and restore the docShell.allow* properties.
*/ */
let ShellServiceInternal = { var ShellServiceInternal = {
/** /**
* Used to determine whether or not to offer "Set as desktop background" * Used to determine whether or not to offer "Set as desktop background"
* functionality. Even if shell service is available it is not * functionality. Even if shell service is available it is not

View file

@ -79,7 +79,7 @@ this.BrowserNewTabPreloader = {
Object.freeze(BrowserNewTabPreloader); Object.freeze(BrowserNewTabPreloader);
let Initializer = { var Initializer = {
_timer: null, _timer: null,
_observing: false, _observing: false,
@ -120,7 +120,7 @@ let Initializer = {
} }
}; };
let Preferences = { var Preferences = {
_enabled: null, _enabled: null,
_branch: null, _branch: null,
@ -157,7 +157,7 @@ let Preferences = {
}, },
}; };
let HiddenBrowsers = { var HiddenBrowsers = {
_browsers: null, _browsers: null,
_updateTimer: null, _updateTimer: null,
@ -379,7 +379,7 @@ HiddenBrowser.prototype = {
} }
}; };
let HostFrame = { var HostFrame = {
_frame: null, _frame: null,
_deferred: null, _deferred: null,

View file

@ -9,14 +9,14 @@
"use strict"; "use strict";
let Cc = Components.classes; var Cc = Components.classes;
let Ci = Components.interfaces; var Ci = Components.interfaces;
let Cu = Components.utils; var Cu = Components.utils;
let HTMLInputElement = Ci.nsIDOMHTMLInputElement; var HTMLInputElement = Ci.nsIDOMHTMLInputElement;
let HTMLTextAreaElement = Ci.nsIDOMHTMLTextAreaElement; var HTMLTextAreaElement = Ci.nsIDOMHTMLTextAreaElement;
let HTMLSelectElement = Ci.nsIDOMHTMLSelectElement; var HTMLSelectElement = Ci.nsIDOMHTMLSelectElement;
let HTMLButtonElement = Ci.nsIDOMHTMLButtonElement; var HTMLButtonElement = Ci.nsIDOMHTMLButtonElement;
this.EXPORTED_SYMBOLS = [ "FormSubmitObserver" ]; this.EXPORTED_SYMBOLS = [ "FormSubmitObserver" ];

View file

@ -8,15 +8,15 @@
"use strict"; "use strict";
let Cc = Components.classes; var Cc = Components.classes;
let Ci = Components.interfaces; var Ci = Components.interfaces;
let Cu = Components.utils; var Cu = Components.utils;
this.EXPORTED_SYMBOLS = [ "FormValidationHandler" ]; this.EXPORTED_SYMBOLS = [ "FormValidationHandler" ];
Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Services.jsm");
let FormValidationHandler = var FormValidationHandler =
{ {
_panel: null, _panel: null,
_anchor: null, _anchor: null,

View file

@ -34,8 +34,8 @@ const PRIORITY_DELTA = -10;
// Variables // Variables
let _lastFocusedWindow = null; var _lastFocusedWindow = null;
let _windows = []; var _windows = [];
// Exported symbol // Exported symbol
@ -64,7 +64,7 @@ function _handleEvent(aEvent) {
// Methods that impact a browser. Put into single object for organization. // Methods that impact a browser. Put into single object for organization.
let BrowserHelper = { var BrowserHelper = {
onOpen: function NP_BH_onOpen(aBrowser) { onOpen: function NP_BH_onOpen(aBrowser) {
// If the tab is in the focused window, leave priority as it is // If the tab is in the focused window, leave priority as it is
if (aBrowser.ownerDocument.defaultView != _lastFocusedWindow) if (aBrowser.ownerDocument.defaultView != _lastFocusedWindow)
@ -91,7 +91,7 @@ let BrowserHelper = {
// Methods that impact a window. Put into single object for organization. // Methods that impact a window. Put into single object for organization.
let WindowHelper = { var WindowHelper = {
addWindow: function NP_WH_addWindow(aWindow) { addWindow: function NP_WH_addWindow(aWindow) {
// Build internal data object // Build internal data object
_windows.push({ window: aWindow, lastSelectedBrowser: null }); _windows.push({ window: aWindow, lastSelectedBrowser: null });

View file

@ -18,8 +18,8 @@ const ICON_ATTRIBUTE_SHOWING = "showing";
const PREF_SECURITY_DELAY = "security.notification_enable_delay"; const PREF_SECURITY_DELAY = "security.notification_enable_delay";
let popupNotificationsMap = new WeakMap(); var popupNotificationsMap = new WeakMap();
let gNotificationParents = new WeakMap; var gNotificationParents = new WeakMap;
function getAnchorFromBrowser(aBrowser) { function getAnchorFromBrowser(aBrowser) {
let anchor = aBrowser.getAttribute("popupnotificationanchor") || let anchor = aBrowser.getAttribute("popupnotificationanchor") ||

View file

@ -18,7 +18,7 @@ const Cu = Components.utils;
* when another one of the placeholder is meant to be displayed. * when another one of the placeholder is meant to be displayed.
* */ * */
let Frames = new Map(); var Frames = new Map();
/** /**
* The Frames map is the main data structure that holds information * The Frames map is the main data structure that holds information

View file

@ -10,11 +10,11 @@ Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
this.EXPORTED_SYMBOLS = [ "OpenLocationLastURL" ]; this.EXPORTED_SYMBOLS = [ "OpenLocationLastURL" ];
let prefSvc = Components.classes["@mozilla.org/preferences-service;1"] var prefSvc = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefBranch); .getService(Components.interfaces.nsIPrefBranch);
let gOpenLocationLastURLData = ""; var gOpenLocationLastURLData = "";
let observer = { var observer = {
QueryInterface: function (aIID) { QueryInterface: function (aIID) {
if (aIID.equals(Components.interfaces.nsIObserver) || if (aIID.equals(Components.interfaces.nsIObserver) ||
aIID.equals(Components.interfaces.nsISupports) || aIID.equals(Components.interfaces.nsISupports) ||
@ -35,7 +35,7 @@ let observer = {
} }
}; };
let os = Components.classes["@mozilla.org/observer-service;1"] var os = Components.classes["@mozilla.org/observer-service;1"]
.getService(Components.interfaces.nsIObserverService); .getService(Components.interfaces.nsIObserverService);
os.addObserver(observer, "last-pb-context-exited", true); os.addObserver(observer, "last-pb-context-exited", true);
os.addObserver(observer, "browser:purge-session-history", true); os.addObserver(observer, "browser:purge-session-history", true);

View file

@ -24,7 +24,7 @@ module.metadata = {
'stability': 'unstable' 'stability': 'unstable'
}; };
let promised = (function() { var promised = (function() {
// Note: Define shortcuts and utility functions here in order to avoid // Note: Define shortcuts and utility functions here in order to avoid
// slower property accesses and unnecessary closure creations on each // slower property accesses and unnecessary closure creations on each
// call of this popular function. // call of this popular function.

View file

@ -88,9 +88,9 @@ Cu.import("resource://gre/modules/Log.jsm");
// Configure a logger at the parent 'addons' level to format // Configure a logger at the parent 'addons' level to format
// messages for all the modules under addons.* // messages for all the modules under addons.*
const PARENT_LOGGER_ID = "addons"; const PARENT_LOGGER_ID = "addons";
let parentLogger = Log.repository.getLogger(PARENT_LOGGER_ID); var parentLogger = Log.repository.getLogger(PARENT_LOGGER_ID);
parentLogger.level = Log.Level.Warn; parentLogger.level = Log.Level.Warn;
let formatter = new Log.BasicFormatter(); var formatter = new Log.BasicFormatter();
// Set parent logger (and its children) to append to // Set parent logger (and its children) to append to
// the Javascript section of the Browser Console // the Javascript section of the Browser Console
parentLogger.addAppender(new Log.ConsoleAppender(formatter)); parentLogger.addAppender(new Log.ConsoleAppender(formatter));
@ -101,7 +101,7 @@ parentLogger.addAppender(new Log.DumpAppender(formatter));
// Create a new logger (child of 'addons' logger) // Create a new logger (child of 'addons' logger)
// for use by the Addons Manager // for use by the Addons Manager
const LOGGER_ID = "addons.manager"; const LOGGER_ID = "addons.manager";
let logger = Log.repository.getLogger(LOGGER_ID); var logger = Log.repository.getLogger(LOGGER_ID);
// Provide the ability to enable/disable logging // Provide the ability to enable/disable logging
// messages at runtime. // messages at runtime.

View file

@ -12,7 +12,7 @@ Cu.import("resource://gre/modules/osfile.jsm");
Cu.import("resource://gre/modules/Promise.jsm"); Cu.import("resource://gre/modules/Promise.jsm");
// Make it possible to mock out timers for testing // Make it possible to mock out timers for testing
let MakeTimer = () => Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); var MakeTimer = () => Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
this.EXPORTED_SYMBOLS = ["DeferredSave"]; this.EXPORTED_SYMBOLS = ["DeferredSave"];
@ -23,9 +23,9 @@ Cu.import("resource://gre/modules/Log.jsm");
//Configure a logger at the parent 'DeferredSave' level to format //Configure a logger at the parent 'DeferredSave' level to format
//messages for all the modules under DeferredSave.* //messages for all the modules under DeferredSave.*
const DEFERREDSAVE_PARENT_LOGGER_ID = "DeferredSave"; const DEFERREDSAVE_PARENT_LOGGER_ID = "DeferredSave";
let parentLogger = Log.repository.getLogger(DEFERREDSAVE_PARENT_LOGGER_ID); var parentLogger = Log.repository.getLogger(DEFERREDSAVE_PARENT_LOGGER_ID);
parentLogger.level = Log.Level.Warn; parentLogger.level = Log.Level.Warn;
let formatter = new Log.BasicFormatter(); var formatter = new Log.BasicFormatter();
//Set parent logger (and its children) to append to //Set parent logger (and its children) to append to
//the Javascript section of the Browser Console //the Javascript section of the Browser Console
parentLogger.addAppender(new Log.ConsoleAppender(formatter)); parentLogger.addAppender(new Log.ConsoleAppender(formatter));

View file

@ -31,9 +31,9 @@ const CHILD_SCRIPT = "resource://gre/modules/addons/Content.js";
Cu.import("resource://gre/modules/XPCOMUtils.jsm"); Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/Services.jsm");
let gSingleton = null; var gSingleton = null;
let gParentMM = null; var gParentMM = null;
function amManager() { function amManager() {

View file

@ -18,7 +18,7 @@ const MSG_INSTALL_ADDONS = "WebInstallerInstallAddonsFromWebpage";
const MSG_INSTALL_CALLBACK = "WebInstallerInstallCallback"; const MSG_INSTALL_CALLBACK = "WebInstallerInstallCallback";
let log = Log.repository.getLogger("AddonManager.InstallTrigger"); var log = Log.repository.getLogger("AddonManager.InstallTrigger");
log.level = Log.Level[Preferences.get("extensions.logging.enabled", false) ? "Warn" : "Trace"]; log.level = Log.Level[Preferences.get("extensions.logging.enabled", false) ? "Warn" : "Trace"];
function CallbackObject(id, callback, urls, mediator) { function CallbackObject(id, callback, urls, mediator) {

View file

@ -37,7 +37,7 @@ const LOGGER_ID = "addons.weblistener";
// Create a new logger for use by the Addons Web Listener // Create a new logger for use by the Addons Web Listener
// (Requires AddonManager.jsm) // (Requires AddonManager.jsm)
let logger = Log.repository.getLogger(LOGGER_ID); var logger = Log.repository.getLogger(LOGGER_ID);
function notifyObservers(aTopic, aBrowser, aUri, aInstalls) { function notifyObservers(aTopic, aBrowser, aUri, aInstalls) {
let info = { let info = {

View file

@ -2456,7 +2456,7 @@ var gSearchView = {
this._allResultsLink.setAttribute("href", this._allResultsLink.setAttribute("href",
AddonRepository.getSearchURL(this._lastQuery)); AddonRepository.getSearchURL(this._lastQuery));
this._allResultsLink.hidden = false; this._allResultsLink.hidden = false;
}, },
updateListAttributes: function gSearchView_updateListAttributes() { updateListAttributes: function gSearchView_updateListAttributes() {
var item = this._listBox.querySelector("richlistitem[remote='true'][first]"); var item = this._listBox.querySelector("richlistitem[remote='true'][first]");

View file

@ -22,7 +22,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "AddonRepository", "resource://gre/modul
XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Task", "resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Promise", "resource://gre/modules/Promise.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Promise", "resource://gre/modules/Promise.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Log", "resource://gre/modules/Log.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Log", "resource://gre/modules/Log.jsm");
let logger = null; var logger = null;
var gUpdateWizard = { var gUpdateWizard = {
// When synchronizing app compatibility info this contains all installed // When synchronizing app compatibility info this contains all installed
@ -169,7 +169,7 @@ var gOfflinePage = {
} }
// Addon listener to count addons enabled/disabled by metadata checks // Addon listener to count addons enabled/disabled by metadata checks
let listener = { var listener = {
onDisabled: function listener_onDisabled(aAddon) { onDisabled: function listener_onDisabled(aAddon) {
gUpdateWizard.affectedAddonIDs.add(aAddon.id); gUpdateWizard.affectedAddonIDs.add(aAddon.id);
gUpdateWizard.metadataDisabled++; gUpdateWizard.metadataDisabled++;

View file

@ -72,7 +72,7 @@ const LOGGER_ID = "addons.repository";
// Create a new logger for use by the Addons Repository // Create a new logger for use by the Addons Repository
// (Requires AddonManager.jsm) // (Requires AddonManager.jsm)
let logger = Log.repository.getLogger(LOGGER_ID); var logger = Log.repository.getLogger(LOGGER_ID);
// A map between XML keys to AddonSearchResult keys for string values // A map between XML keys to AddonSearchResult keys for string values
// that require no extra parsing from XML // that require no extra parsing from XML
@ -101,7 +101,7 @@ const INTEGER_KEY_MAP = {
}; };
// Wrap the XHR factory so that tests can override with a mock // Wrap the XHR factory so that tests can override with a mock
let XHRequest = Components.Constructor("@mozilla.org/xmlextras/xmlhttprequest;1", var XHRequest = Components.Constructor("@mozilla.org/xmlextras/xmlhttprequest;1",
"nsIXMLHttpRequest"); "nsIXMLHttpRequest");
function convertHTMLToPlainText(html) { function convertHTMLToPlainText(html) {

View file

@ -30,7 +30,7 @@ const LOGGER_ID = "addons.repository.sqlmigrator";
// Create a new logger for use by the Addons Repository SQL Migrator // Create a new logger for use by the Addons Repository SQL Migrator
// (Requires AddonManager.jsm) // (Requires AddonManager.jsm)
let logger = Log.repository.getLogger(LOGGER_ID); var logger = Log.repository.getLogger(LOGGER_ID);
this.EXPORTED_SYMBOLS = ["AddonRepository_SQLiteMigrator"]; this.EXPORTED_SYMBOLS = ["AddonRepository_SQLiteMigrator"];

View file

@ -52,7 +52,7 @@ const LOGGER_ID = "addons.update-checker";
// Create a new logger for use by the Addons Update Checker // Create a new logger for use by the Addons Update Checker
// (Requires AddonManager.jsm) // (Requires AddonManager.jsm)
let logger = Log.repository.getLogger(LOGGER_ID); var logger = Log.repository.getLogger(LOGGER_ID);
/** /**
* A serialisation method for RDF data that produces an identical string * A serialisation method for RDF data that produces an identical string

View file

@ -8,9 +8,9 @@
const {classes: Cc, interfaces: Ci, utils: Cu} = Components; const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
let {Services} = Cu.import("resource://gre/modules/Services.jsm", {}); var {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
let nsIFile = Components.Constructor("@mozilla.org/file/local;1", "nsIFile", var nsIFile = Components.Constructor("@mozilla.org/file/local;1", "nsIFile",
"initWithPath"); "initWithPath");
const MSG_JAR_FLUSH = "AddonJarFlush"; const MSG_JAR_FLUSH = "AddonJarFlush";

View file

@ -64,11 +64,11 @@ XPCOMUtils.defineLazyGetter(this, "pluginsBundle",
XPCOMUtils.defineLazyGetter(this, "gmpService", XPCOMUtils.defineLazyGetter(this, "gmpService",
() => Cc["@mozilla.org/gecko-media-plugin-service;1"].getService(Ci.mozIGeckoMediaPluginChromeService)); () => Cc["@mozilla.org/gecko-media-plugin-service;1"].getService(Ci.mozIGeckoMediaPluginChromeService));
let messageManager = Cc["@mozilla.org/globalmessagemanager;1"] var messageManager = Cc["@mozilla.org/globalmessagemanager;1"]
.getService(Ci.nsIMessageListenerManager); .getService(Ci.nsIMessageListenerManager);
let gLogger; var gLogger;
let gLogAppenderDump = null; var gLogAppenderDump = null;
function configureLogging() { function configureLogging() {
if (!gLogger) { if (!gLogger) {
@ -443,7 +443,7 @@ GMPWrapper.prototype = {
}, },
}; };
let GMPProvider = { var GMPProvider = {
get name() { return "GMPProvider"; }, get name() { return "GMPProvider"; },
_plugins: null, _plugins: null,

View file

@ -49,7 +49,7 @@ this.LightweightThemeImageOptimizer = {
Object.freeze(LightweightThemeImageOptimizer); Object.freeze(LightweightThemeImageOptimizer);
let ImageCropper = { var ImageCropper = {
_inProgress: {}, _inProgress: {},
getCroppedImageURL: getCroppedImageURL:
@ -119,7 +119,7 @@ let ImageCropper = {
} }
}; };
let ImageFile = { var ImageFile = {
read: function ImageFile_read(aURI, aCallback) { read: function ImageFile_read(aURI, aCallback) {
this._netUtil.asyncFetch2( this._netUtil.asyncFetch2(
aURI, aURI,
@ -158,7 +158,7 @@ let ImageFile = {
XPCOMUtils.defineLazyModuleGetter(ImageFile, "_netUtil", XPCOMUtils.defineLazyModuleGetter(ImageFile, "_netUtil",
"resource://gre/modules/NetUtil.jsm", "NetUtil"); "resource://gre/modules/NetUtil.jsm", "NetUtil");
let ImageTools = { var ImageTools = {
decode: function ImageTools_decode(aInputStream, aContentType) { decode: function ImageTools_decode(aInputStream, aContentType) {
let outParam = {value: null}; let outParam = {value: null};
@ -187,7 +187,7 @@ let ImageTools = {
XPCOMUtils.defineLazyServiceGetter(ImageTools, "_imgTools", XPCOMUtils.defineLazyServiceGetter(ImageTools, "_imgTools",
"@mozilla.org/image/tools;1", "imgITools"); "@mozilla.org/image/tools;1", "imgITools");
let Utils = { var Utils = {
createCopy: function Utils_createCopy(aData) { createCopy: function Utils_createCopy(aData) {
let copy = {}; let copy = {};
for (let [k, v] in Iterator(aData)) { for (let [k, v] in Iterator(aData)) {

View file

@ -23,7 +23,7 @@ const LOGGER_ID = "addons.plugins";
// Create a new logger for use by the Addons Plugin Provider // Create a new logger for use by the Addons Plugin Provider
// (Requires AddonManager.jsm) // (Requires AddonManager.jsm)
let logger = Log.repository.getLogger(LOGGER_ID); var logger = Log.repository.getLogger(LOGGER_ID);
function getIDHashForString(aStr) { function getIDHashForString(aStr) {
// return the two-digit hexadecimal code for a byte // return the two-digit hexadecimal code for a byte

View file

@ -222,7 +222,7 @@ const LOGGER_ID = "addons.xpi";
// Create a new logger for use by all objects in this Addons XPI Provider module // Create a new logger for use by all objects in this Addons XPI Provider module
// (Requires AddonManager.jsm) // (Requires AddonManager.jsm)
let logger = Log.repository.getLogger(LOGGER_ID); var logger = Log.repository.getLogger(LOGGER_ID);
const LAZY_OBJECTS = ["XPIDatabase"]; const LAZY_OBJECTS = ["XPIDatabase"];
@ -7822,7 +7822,7 @@ WinRegInstallLocation.prototype = {
}; };
#endif #endif
let addonTypes = [ var addonTypes = [
new AddonManagerPrivate.AddonType("extension", URI_EXTENSION_STRINGS, new AddonManagerPrivate.AddonType("extension", URI_EXTENSION_STRINGS,
STRING_TYPE_NAME, STRING_TYPE_NAME,
AddonManager.VIEW_TYPE_LIST, 4000, AddonManager.VIEW_TYPE_LIST, 4000,

View file

@ -29,7 +29,7 @@ const LOGGER_ID = "addons.xpi-utils";
// Create a new logger for use by the Addons XPI Provider Utils // Create a new logger for use by the Addons XPI Provider Utils
// (Requires AddonManager.jsm) // (Requires AddonManager.jsm)
let logger = Log.repository.getLogger(LOGGER_ID); var logger = Log.repository.getLogger(LOGGER_ID);
const KEY_PROFILEDIR = "ProfD"; const KEY_PROFILEDIR = "ProfD";
const FILE_DATABASE = "extensions.sqlite"; const FILE_DATABASE = "extensions.sqlite";