Bug 1632922 - use const instead of let - manual fixes. r=snorp

This commit was generated manually fixing all remaining eslint failures.

Differential Revision: https://phabricator.services.mozilla.com/D72413
This commit is contained in:
Agi Sferro 2020-04-24 21:53:19 +00:00
parent dff7aa5d42
commit 1c11cbd114
7 changed files with 33 additions and 20 deletions

11
mobile/.eslintrc.js Normal file
View File

@ -0,0 +1,11 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
module.exports = {
rules: {
"prefer-const": "error",
},
};

View File

@ -340,7 +340,7 @@ class GeckoViewContentChild extends GeckoViewChildModule {
const webNavigation = docShell.QueryInterface(Ci.nsIWebNavigation);
let {
const {
referrerInfo,
triggeringPrincipal,
uri,
@ -348,15 +348,12 @@ class GeckoViewContentChild extends GeckoViewChildModule {
csp,
headers,
} = loadOptions;
referrerInfo = E10SUtils.deserializeReferrerInfo(referrerInfo);
triggeringPrincipal = E10SUtils.deserializePrincipal(triggeringPrincipal);
csp = E10SUtils.deserializeCSP(csp);
webNavigation.loadURI(uri, {
triggeringPrincipal,
referrerInfo,
triggeringPrincipal: E10SUtils.deserializePrincipal(triggeringPrincipal),
referrerInfo: E10SUtils.deserializeReferrerInfo(referrerInfo),
loadFlags: flags,
csp,
csp: E10SUtils.deserializeCSP(csp),
headers,
});
}

View File

@ -45,7 +45,8 @@ const BrowserStatusFilter = Components.Constructor(
const WINDOW_TYPE = "navigator:geckoview";
let tabTracker;
// We need let to break cyclic dependency
/* eslint-disable-next-line prefer-const */
let windowTracker;
/**
@ -290,7 +291,7 @@ class TabTracker extends TabTrackerBase {
}
windowTracker = new WindowTracker();
tabTracker = new TabTracker();
const tabTracker = new TabTracker();
Object.assign(global, { tabTracker, windowTracker });

View File

@ -40,9 +40,12 @@ function* runTest(options) {
try {
const [tab] = await browser.tabs.query({currentWindow: true, active: true});
let [jpeg, png, ...pngs] = await Promise.all([
let [jpeg, png] = await Promise.all([
browser.tabs.captureVisibleTab(tab.windowId, {format: "jpeg", quality: 95}),
browser.tabs.captureVisibleTab(tab.windowId, {format: "png", quality: 95}),
]);
const pngs = await Promise.all([
browser.tabs.captureVisibleTab(tab.windowId, {quality: 95}),
browser.tabs.captureVisibleTab(tab.windowId),
]);

View File

@ -31,6 +31,7 @@ add_task(async function tabsSendMessageReply() {
useAddonManager: "permanent",
background: async function() {
// eslint-disable-next-line prefer-const
let firstTab;
const promiseResponse = new Promise(resolve => {
browser.runtime.onMessage.addListener((msg, sender, respond) => {

View File

@ -922,7 +922,9 @@ PromptDelegate.prototype = {
aAuthInfo.flags & Ci.nsIAuthInformation.CROSS_ORIGIN_SUB_RESOURCE;
const username = aAuthInfo.username;
let [displayHost, realm] = this._getAuthTarget(aChannel, aAuthInfo);
const authTarget = this._getAuthTarget(aChannel, aAuthInfo);
const { displayHost } = authTarget;
let { realm } = authTarget;
// Suppress "the site says: $realm" when we synthesized a missing realm.
if (!aAuthInfo.realm && !isProxy) {
@ -982,27 +984,28 @@ PromptDelegate.prototype = {
const idnService = Cc["@mozilla.org/network/idn-service;1"].getService(
Ci.nsIIDNService
);
const hostname =
const displayHost =
"moz-proxy://" +
idnService.convertUTF8toACE(info.host) +
":" +
info.port;
let realm = aAuthInfo.realm;
if (!realm) {
realm = hostname;
realm = displayHost;
}
return [hostname, realm];
return { displayHost, realm };
}
const hostname = aChannel.URI.scheme + "://" + aChannel.URI.displayHostPort;
const displayHost =
aChannel.URI.scheme + "://" + aChannel.URI.displayHostPort;
// If a HTTP WWW-Authenticate header specified a realm, that value
// will be available here. If it wasn't set or wasn't HTTP, we'll use
// the formatted hostname instead.
let realm = aAuthInfo.realm;
if (!realm) {
realm = hostname;
realm = displayHost;
}
return [hostname, realm];
return { displayHost, realm };
},
};

View File

@ -9,7 +9,4 @@ module.exports = {
debug: false,
warn: false,
},
rules: {
"prefer-const": "error",
},
};