forked from mirrors/gecko-dev
Bug 1561435 - Fix linting errors for browser/, r=standard8
# ignore-this-changeset Differential Revision: https://phabricator.services.mozilla.com/D35950 --HG-- extra : source : ff6aa88097df9836d93d6aa5554ffcd160f07167 extra : intermediate-source : 2130a9484ece03d835939359c4a07966aa8d790c
This commit is contained in:
parent
6456074375
commit
ad522e3aae
31 changed files with 46 additions and 43 deletions
|
|
@ -611,6 +611,7 @@ var gIdentityHandler = {
|
|||
_hasCustomRoot() {
|
||||
let issuerCert = null;
|
||||
// Walk the whole chain to get the last cert.
|
||||
// eslint-disable-next-line no-empty
|
||||
for (issuerCert of this._secInfo.succeededCertChain.getEnumerator()) {
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3119,7 +3119,7 @@ async function BrowserViewSourceOfDocument(aArgsOrDocument) {
|
|||
// Deprecated API - callers should pass args object instead.
|
||||
if (Cu.isCrossProcessWrapper(doc)) {
|
||||
throw new Error(
|
||||
"BrowserViewSourceOfDocument cannot accept a CPOW " + "as a document."
|
||||
"BrowserViewSourceOfDocument cannot accept a CPOW as a document."
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -3366,8 +3366,8 @@ function losslessDecodeURI(aURI) {
|
|||
// Encode invisible characters (C0/C1 control characters, U+007F [DEL],
|
||||
// U+00A0 [no-break space], line and paragraph separator,
|
||||
// object replacement character) (bug 452979, bug 909264)
|
||||
// eslint-disable-next-line no-control-regex
|
||||
value = value.replace(
|
||||
// eslint-disable-next-line no-control-regex
|
||||
/[\u0000-\u001f\u007f-\u00a0\u2028\u2029\ufffc]/g,
|
||||
encodeURIComponent
|
||||
);
|
||||
|
|
|
|||
|
|
@ -60,9 +60,11 @@ add_task(async function test_content_and_chrome_selection() {
|
|||
|
||||
add_task(async function test_active_selection_switches_properly() {
|
||||
let testPage1 =
|
||||
// eslint-disable-next-line no-useless-concat
|
||||
"data:text/html," +
|
||||
'<textarea id="textarea">Write something here</textarea>';
|
||||
let testPage2 =
|
||||
// eslint-disable-next-line no-useless-concat
|
||||
"data:text/html," + '<textarea id="textarea">Nothing available</textarea>';
|
||||
let DOMWindowUtils = EventUtils._getDOMWindowUtils(window);
|
||||
let selectedText;
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ function recordEvent(aName) {
|
|||
"got events and progress notifications in expected order"
|
||||
);
|
||||
|
||||
// eslint-disable-next-line no-shadow
|
||||
executeSoon(
|
||||
// eslint-disable-next-line no-shadow
|
||||
function(tab) {
|
||||
gBrowser.removeTab(tab);
|
||||
gBrowser.removeTabsProgressListener(progressListener);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ add_task(async function findbar_test() {
|
|||
|
||||
ok(
|
||||
!gFindBar.hidden,
|
||||
"the Find bar isn't hidden after the location of a " + "subdocument changes"
|
||||
"the Find bar isn't hidden after the location of a subdocument changes"
|
||||
);
|
||||
|
||||
let findBarClosePromise = BrowserTestUtils.waitForEvent(
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ function test() {
|
|||
is(
|
||||
gHistorySwipeAnimation.active,
|
||||
false,
|
||||
"History swipe animation support " + "was successfully uninitialized"
|
||||
"History swipe animation support was successfully uninitialized"
|
||||
);
|
||||
finish();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ add_task(async function shareURLAddressBar() {
|
|||
// Click "Add to Address Bar"
|
||||
contextMenuPromise = promisePanelHidden("pageActionContextMenu");
|
||||
let ctxMenuButton = document.querySelector(
|
||||
"#pageActionContextMenu " + ".pageActionContextMenuItem"
|
||||
"#pageActionContextMenu .pageActionContextMenuItem"
|
||||
);
|
||||
EventUtils.synthesizeMouseAtCenter(ctxMenuButton, {});
|
||||
await contextMenuPromise;
|
||||
|
|
@ -134,7 +134,7 @@ add_task(async function shareURLAddressBar() {
|
|||
|
||||
contextMenuPromise = promisePanelHidden("pageActionContextMenu");
|
||||
ctxMenuButton = document.querySelector(
|
||||
"#pageActionContextMenu " + ".pageActionContextMenuItem"
|
||||
"#pageActionContextMenu .pageActionContextMenuItem"
|
||||
);
|
||||
EventUtils.synthesizeMouseAtCenter(ctxMenuButton, {});
|
||||
await contextMenuPromise;
|
||||
|
|
|
|||
|
|
@ -389,7 +389,7 @@ add_task(async function test_cannot_clear_history() {
|
|||
);
|
||||
ok(
|
||||
cb.length == 1 && !cb[0].disabled,
|
||||
"There is formdata, checkbox to " + "clear formdata should be enabled."
|
||||
"There is formdata, checkbox to clear formdata should be enabled."
|
||||
);
|
||||
|
||||
cb = this.win.document.querySelectorAll(
|
||||
|
|
@ -397,7 +397,7 @@ add_task(async function test_cannot_clear_history() {
|
|||
);
|
||||
ok(
|
||||
cb.length == 1 && !cb[0].disabled,
|
||||
"There is history, checkbox to " + "clear history should be enabled."
|
||||
"There is history, checkbox to clear history should be enabled."
|
||||
);
|
||||
|
||||
this.checkAllCheckboxes();
|
||||
|
|
|
|||
|
|
@ -891,6 +891,7 @@ nsDefaultCommandLineHandler.prototype = {
|
|||
Services.dirsvc.get("ProfD", Ci.nsIFile);
|
||||
this._haveProfile = true;
|
||||
} catch (e) {
|
||||
// eslint-disable-next-line no-empty
|
||||
while ((ar = cmdLine.handleFlagWithParam("url", false))) {}
|
||||
cmdLine.preventDefault = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -125,10 +125,10 @@ async function test_cookie_settings({
|
|||
"about:preferences"
|
||||
);
|
||||
await tab.linkedBrowser.contentWindow.gotoPref("panePrivacy");
|
||||
// eslint-disable-next-line no-shadow
|
||||
await ContentTask.spawn(
|
||||
tab.linkedBrowser,
|
||||
{ cookiesEnabled, cookieSettingsLocked },
|
||||
// eslint-disable-next-line no-shadow
|
||||
async function({ cookiesEnabled, cookieSettingsLocked }) {
|
||||
let deleteOnCloseCheckbox = content.document.getElementById(
|
||||
"deleteOnClose"
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@ async function test_popup_blocker_disabled({ disabled, locked }) {
|
|||
gBrowser,
|
||||
"about:preferences#privacy"
|
||||
);
|
||||
// eslint-disable-next-line no-shadow
|
||||
await ContentTask.spawn(
|
||||
tab.linkedBrowser,
|
||||
{ disabled, locked },
|
||||
// eslint-disable-next-line no-shadow
|
||||
async function({ disabled, locked }) {
|
||||
let checkbox = content.document.getElementById("popupPolicy");
|
||||
is(
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ async function test_reset_disabled({ disabled }) {
|
|||
gBrowser,
|
||||
"about:support"
|
||||
);
|
||||
// eslint-disable-next-line no-shadow
|
||||
await ContentTask.spawn(tab.linkedBrowser, { disabled }, async function({
|
||||
// eslint-disable-next-line no-shadow
|
||||
disabled,
|
||||
}) {
|
||||
let resetBox = content.document.getElementById("reset-box");
|
||||
|
|
|
|||
|
|
@ -1186,8 +1186,8 @@ class WindowManager extends WindowManagerBase {
|
|||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line mozilla/balanced-listeners
|
||||
extensions.on("startup", (type, extension) => {
|
||||
// eslint-disable-line mozilla/balanced-listeners
|
||||
defineLazyGetter(extension, "tabManager", () => new TabManager(extension));
|
||||
defineLazyGetter(
|
||||
extension,
|
||||
|
|
|
|||
|
|
@ -256,12 +256,10 @@ this.browserAction = class extends ExtensionAPI {
|
|||
},
|
||||
});
|
||||
|
||||
this.tabContext.on(
|
||||
"tab-select", // eslint-disable-line mozilla/balanced-listeners
|
||||
(evt, tab) => {
|
||||
this.updateWindow(tab.ownerGlobal);
|
||||
}
|
||||
);
|
||||
// eslint-disable-next-line mozilla/balanced-listeners
|
||||
this.tabContext.on("tab-select", (evt, tab) => {
|
||||
this.updateWindow(tab.ownerGlobal);
|
||||
});
|
||||
|
||||
this.widget = widget;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -478,8 +478,8 @@ var gMenuBuilder = {
|
|||
{ once: true }
|
||||
);
|
||||
|
||||
// eslint-disable-next-line mozilla/balanced-listeners
|
||||
element.addEventListener("click", event => {
|
||||
// eslint-disable-line mozilla/balanced-listeners
|
||||
if (
|
||||
event.target !== event.currentTarget ||
|
||||
// Ignore menu items that are usually not clickeable,
|
||||
|
|
|
|||
|
|
@ -129,12 +129,10 @@ this.sidebarAction = class extends ExtensionAPI {
|
|||
}
|
||||
|
||||
build() {
|
||||
this.tabContext.on(
|
||||
"tab-select", // eslint-disable-line mozilla/balanced-listeners
|
||||
(evt, tab) => {
|
||||
this.updateWindow(tab.ownerGlobal);
|
||||
}
|
||||
);
|
||||
// eslint-disable-next-line mozilla/balanced-listeners
|
||||
this.tabContext.on("tab-select", (evt, tab) => {
|
||||
this.updateWindow(tab.ownerGlobal);
|
||||
});
|
||||
|
||||
let install = this.extension.startupReason === "ADDON_INSTALL";
|
||||
for (let window of windowTracker.browserWindows()) {
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ add_task(async function testIndexedDB() {
|
|||
}
|
||||
|
||||
function contentScript() {
|
||||
// eslint-disable-next-line mozilla/balanced-listeners
|
||||
window.addEventListener(
|
||||
"message",
|
||||
msg => {
|
||||
// eslint-disable-line mozilla/balanced-listeners
|
||||
browser.test.sendMessage("indexedDBCreated");
|
||||
},
|
||||
true
|
||||
|
|
|
|||
|
|
@ -33,10 +33,10 @@ add_task(async function testServiceWorkers() {
|
|||
}
|
||||
|
||||
function contentScript() {
|
||||
// eslint-disable-next-line mozilla/balanced-listeners
|
||||
window.addEventListener(
|
||||
"message",
|
||||
msg => {
|
||||
// eslint-disable-line mozilla/balanced-listeners
|
||||
if (msg.data == "serviceWorkerRegistered") {
|
||||
browser.runtime.sendMessage("serviceWorkerRegistered");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ add_task(async function testWindowCreate() {
|
|||
browser.test.log(
|
||||
`Got mismatched size (${JSON.stringify(
|
||||
expected
|
||||
)} != ${JSON.stringify(geom)}). ` + `Retrying after a short delay.`
|
||||
)} != ${JSON.stringify(geom)}). Retrying after a short delay.`
|
||||
);
|
||||
|
||||
await new Promise(resolve => setTimeout(resolve, 200));
|
||||
|
|
|
|||
|
|
@ -243,8 +243,8 @@ export default class PaymentDialog extends HandleEventMixin(
|
|||
*
|
||||
* @param {object} state - See `PaymentsStore.setState`
|
||||
*/
|
||||
// eslint-disable-next-line complexity
|
||||
async setStateFromParent(state) {
|
||||
// eslint-disable-line complexity
|
||||
let oldAddresses = paymentRequest.getAddresses(
|
||||
this.requestStore.getState()
|
||||
);
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ var testForgetThisSiteVisibility = async function(selectionCount) {
|
|||
hideForgetThisSite,
|
||||
`The Forget this site menu item should ${
|
||||
hideForgetThisSite ? "" : "not "
|
||||
}` + ` be hidden with ${selectionCount} items selected`
|
||||
} be hidden with ${selectionCount} items selected`
|
||||
);
|
||||
|
||||
// Close the context menu.
|
||||
|
|
|
|||
|
|
@ -393,11 +393,13 @@ var treeView = {
|
|||
if (item.open) {
|
||||
// remove this window's tab rows from the view
|
||||
var thisLevel = this.getLevel(idx);
|
||||
/* eslint-disable no-empty */
|
||||
for (
|
||||
var t = idx + 1;
|
||||
t < gTreeData.length && this.getLevel(t) > thisLevel;
|
||||
t++
|
||||
) {}
|
||||
/* eslint-disable no-empty */
|
||||
var deletecount = t - idx - 1;
|
||||
gTreeData.splice(idx + 1, deletecount);
|
||||
this.treeBox.rowCountChanged(idx + 1, -deletecount);
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ const TAB_SHENTRY = { url: TAB_URL, triggeringPrincipal_base64 };
|
|||
const TAB_STATE = { entries: [TAB_SHENTRY], formdata: TAB_FORMDATA };
|
||||
|
||||
const FRAME_SCRIPT =
|
||||
// eslint-disable-next-line no-useless-concat
|
||||
"data:," + "content.document.getElementById('errorTryAgain').click()";
|
||||
|
||||
add_task(async function() {
|
||||
|
|
|
|||
|
|
@ -77,8 +77,7 @@ const BCH_TESTS = [
|
|||
actions: "silent",
|
||||
},
|
||||
{
|
||||
description:
|
||||
"update with 'silent showURL extra' " + "for actions and openURL",
|
||||
description: "update with 'silent showURL extra' for actions and openURL",
|
||||
actions: "silent showURL extra",
|
||||
},
|
||||
];
|
||||
|
|
|
|||
|
|
@ -246,8 +246,8 @@ add_task(async function test_show_original() {
|
|||
|
||||
add_task(async function test_language_change() {
|
||||
// This is run 4 times, the total additions are checked afterwards.
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
for (let i of Array(4)) {
|
||||
// eslint-disable-line no-unused-vars
|
||||
let tab = await offerTranslationFor("<h1>Hallo Welt!</h1>", "fr");
|
||||
let browser = tab.linkedBrowser;
|
||||
// In the offer state, translation is executed by the Translate button,
|
||||
|
|
|
|||
|
|
@ -140,9 +140,9 @@ var UrlbarUtils = {
|
|||
!PrivateBrowsingUtils.isWindowPrivate(window) &&
|
||||
url &&
|
||||
!url.includes(" ") &&
|
||||
// eslint-disable-next-line no-control-regex
|
||||
!/[\x00-\x1F]/.test(url)
|
||||
) {
|
||||
// eslint-disable-line no-control-regex
|
||||
PlacesUIUtils.markPageAsTyped(url);
|
||||
}
|
||||
},
|
||||
|
|
@ -274,6 +274,7 @@ var UrlbarUtils = {
|
|||
let ranges = [];
|
||||
for (let index = hits.indexOf(1); index >= 0 && index < hits.length; ) {
|
||||
let len = 0;
|
||||
// eslint-disable-next-line no-empty
|
||||
for (let j = index; j < hits.length && hits[j]; ++j, ++len) {}
|
||||
ranges.push([index, len]);
|
||||
// Move to the next 1.
|
||||
|
|
|
|||
|
|
@ -210,7 +210,7 @@ add_task(async function searchWith() {
|
|||
Assert.notEqual(
|
||||
engineName,
|
||||
(await Services.search.getDefault()).name,
|
||||
"Sanity check: First one-off engine should not be " + "the current engine"
|
||||
"Sanity check: First one-off engine should not be the current engine"
|
||||
);
|
||||
result = await UrlbarTestUtils.getDetailsOfResultAt(window, 0);
|
||||
Assert.equal(
|
||||
|
|
|
|||
|
|
@ -595,7 +595,7 @@ this.FormAutofillHeuristics = {
|
|||
fieldScanner.parsingIndex > 0
|
||||
) {
|
||||
const regExpTelExtension = new RegExp(
|
||||
"\\bext|ext\\b|extension" + "|ramal", // pt-BR, pt-PT
|
||||
"\\bext|ext\\b|extension|ramal", // pt-BR, pt-PT
|
||||
"iu"
|
||||
);
|
||||
const previousField = fieldScanner.getFieldDetailByIndex(
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ function getIntPref(aPref, aDefaultValue) {
|
|||
function isDefaultHandler() {
|
||||
if (Services.appinfo.processType !== Services.appinfo.PROCESS_TYPE_DEFAULT) {
|
||||
throw new Error(
|
||||
"isDefaultHandler should only get called in the parent " + "process."
|
||||
"isDefaultHandler should only get called in the parent process."
|
||||
);
|
||||
}
|
||||
return PdfjsChromeUtils.isDefaultHandlerApp();
|
||||
|
|
@ -115,7 +115,7 @@ var PdfJs = {
|
|||
Services.appinfo.processType !== Services.appinfo.PROCESS_TYPE_DEFAULT
|
||||
) {
|
||||
throw new Error(
|
||||
"PdfJs.init should only get called " + "in the parent process."
|
||||
"PdfJs.init should only get called in the parent process."
|
||||
);
|
||||
}
|
||||
PdfjsChromeUtils.init();
|
||||
|
|
@ -280,7 +280,7 @@ var PdfJs = {
|
|||
Services.appinfo.processType !== Services.appinfo.PROCESS_TYPE_DEFAULT
|
||||
) {
|
||||
throw new Error(
|
||||
"Only the parent process should be observing PDF " + "handler changes."
|
||||
"Only the parent process should be observing PDF handler changes."
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,8 +19,8 @@ const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
|||
|
||||
var EXPORTED_SYMBOLS = ["NetworkManager"];
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
function log(aMsg) {
|
||||
// eslint-disable-line no-unused-vars
|
||||
var msg = "PdfJsNetwork.jsm: " + (aMsg.join ? aMsg.join("") : aMsg);
|
||||
Services.console.logStringMessage(msg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ var PdfjsChromeUtils = {
|
|||
let browser = aEvent.currentTarget.browser;
|
||||
if (!this._browsers.has(browser)) {
|
||||
throw new Error(
|
||||
"FindEventManager was not bound " + "for the current browser."
|
||||
"FindEventManager was not bound for the current browser."
|
||||
);
|
||||
}
|
||||
// Only forward the events if the current browser is a registered browser.
|
||||
|
|
@ -251,7 +251,7 @@ var PdfjsChromeUtils = {
|
|||
let browser = aMsg.target;
|
||||
if (this._browsers.has(browser)) {
|
||||
throw new Error(
|
||||
"FindEventManager was bound 2nd time " + "without unbinding it first."
|
||||
"FindEventManager was bound 2nd time without unbinding it first."
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue