Bug 1864896: Autofix unused function arguments (editor). r=masayuki

Differential Revision: https://phabricator.services.mozilla.com/D202964
This commit is contained in:
Dave Townsend 2024-03-01 10:10:09 +00:00
Родитель 716a972585
Коммит 92b98769fe
22 изменённых файлов: 58 добавлений и 66 удалений

Просмотреть файл

@ -50,7 +50,7 @@ export function maybeOnSpellCheck(editableElement, callback) {
let waitingForEnded = isc && isc.spellCheckPending;
let count = 0;
function observe(subj, topic, data) {
function observe(subj, topic) {
if (subj != editor) {
return;
}

Просмотреть файл

@ -41,7 +41,7 @@ var helperAppDlgPromise = new Promise(function(resolve) {
}
HelperAppLauncherDialog.prototype = {
show(aLauncher, aWindowContext, aReason) {
show() {
ok(true, "Whether showing Dialog");
resolve();
registrar.unregisterFactory(MOCK_HELPERAPP_DIALOG_CID,

Просмотреть файл

@ -44,7 +44,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=434998
QueryInterface: ChromeUtils.generateQI(["nsIWebProgressListener",
"nsISupportsWeakReference"]),
onStateChange(aWebProgress, aRequest, aStateFlags, aStatus)
onStateChange(aWebProgress, aRequest, aStateFlags)
{
if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP)
{
@ -65,25 +65,23 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=434998
},
onProgressChange(aWebProgress, aRequest,
aCurSelfProgress, aMaxSelfProgress,
aCurTotalProgress, aMaxTotalProgress)
onProgressChange()
{
},
onLocationChange(aWebProgress, aRequest, aLocation, aFlags)
onLocationChange()
{
},
onStatusChange(aWebProgress, aRequest, aStatus, aMessage)
onStatusChange()
{
},
onSecurityChange(aWebProgress, aRequest, aState)
onSecurityChange()
{
},
onContentBlockingEvent(aWebProgress, aRequest, aEvent)
onContentBlockingEvent()
{
},

Просмотреть файл

@ -23,7 +23,7 @@ SimpleTest.waitForExplicitFinish();
// Running all of the tests can take a long time, try to account for it
SimpleTest.requestLongerTimeout(5);
function sendScore(results, continueParams) {
function sendScore(results) {
ok(results.length > 1, "At least one test should have been run");
for (var i = 1; i < results.length; ++i) {
var result = results[i];

Просмотреть файл

@ -37,7 +37,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1053048
// synthesizing the key press. So, we don't need to check whether a
// notification actually comes here.
let selectionListener = {
notifySelectionChanged(aDocument, aSelection, aReason, aAmount) {
notifySelectionChanged() {
ok(true, "selectionStart: " + textarea.selectionStart);
ok(true, "selectionEnd: " + textarea.selectionEnd);
},

Просмотреть файл

@ -11,7 +11,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1649005
<script src="/tests/SimpleTest/EventUtils.js"></script>
<script>
/** Test for bug 1649005, bug 1779343 **/
window.addEventListener("DOMContentLoaded", (event) => {
window.addEventListener("DOMContentLoaded", () => {
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(function() {
document.body.textContent = ""; // It would be \n\n otherwise...

Просмотреть файл

@ -63,7 +63,7 @@ SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(async () => {
function waitForTickOfRefeshDriver() {
function awaitOneRefresh() {
return new Promise(function(aResolve, aReject) {
return new Promise(function(aResolve) {
requestAnimationFrame(aResolve);
});
}

Просмотреть файл

@ -37,7 +37,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=502673
editor.removeDocumentStateListener(this);
},
NotifyDocumentStateChanged(aNowDirty) {
NotifyDocumentStateChanged() {
var editor = SpecialPowers.wrap(this.input).editor;
editor.removeDocumentStateListener(this);
},

Просмотреть файл

@ -17,7 +17,7 @@ function getLoadContext() {
async function runTest() {
var pasteCount = 0;
var pasteFunc = function(event) { pasteCount++; };
var pasteFunc = function() { pasteCount++; };
function verifyContent(s) {
var e = document.getElementById("i1");

Просмотреть файл

@ -33,7 +33,7 @@ function runTest() {
os.addObserver(onPromptLoad, "common-dialog-loaded");
os.addObserver(onPromptLoad, "tabmodal-dialog-loaded");
function onPromptLoad(subject, topic, data) {
function onPromptLoad(subject) {
let ui = subject.Dialog ? subject.Dialog.ui : undefined;
if (!ui) {
// subject is an tab prompt, find the elements ourselves

Просмотреть файл

@ -44,7 +44,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=607584
QueryInterface: ChromeUtils.generateQI(["nsIWebProgressListener",
"nsISupportsWeakReference"]),
onStateChange(aWebProgress, aRequest, aStateFlags, aStatus)
onStateChange(aWebProgress, aRequest, aStateFlags)
{
if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP)
{
@ -71,25 +71,23 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=607584
},
onProgressChange(aWebProgress, aRequest,
aCurSelfProgress, aMaxSelfProgress,
aCurTotalProgress, aMaxTotalProgress)
onProgressChange()
{
},
onLocationChange(aWebProgress, aRequest, aLocation, aFlags)
onLocationChange()
{
},
onStatusChange(aWebProgress, aRequest, aStatus, aMessage)
onStatusChange()
{
},
onSecurityChange(aWebProgress, aRequest, aState)
onSecurityChange()
{
},
onContentBlockingEvent(aWebProgress, aRequest, aEvent)
onContentBlockingEvent()
{
},

Просмотреть файл

@ -92,7 +92,7 @@ SimpleTest.waitForFocus(function() {
// start running all tests.
var myXHR = new XMLHttpRequest();
myXHR.open("GET", "file_bug611182.sjs?queryTotalTests");
myXHR.onload = function(e) {
myXHR.onload = function() {
totalTests = myXHR.responseText;
runAllTests();
};

Просмотреть файл

@ -43,7 +43,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=616590
QueryInterface: ChromeUtils.generateQI(["nsIWebProgressListener",
"nsISupportsWeakReference"]),
onStateChange(aWebProgress, aRequest, aStateFlags, aStatus)
onStateChange(aWebProgress, aRequest, aStateFlags)
{
if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP)
{
@ -60,25 +60,23 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=616590
},
onProgressChange(aWebProgress, aRequest,
aCurSelfProgress, aMaxSelfProgress,
aCurTotalProgress, aMaxTotalProgress)
onProgressChange()
{
},
onLocationChange(aWebProgress, aRequest, aLocation, aFlags)
onLocationChange()
{
},
onStatusChange(aWebProgress, aRequest, aStatus, aMessage)
onStatusChange()
{
},
onSecurityChange(aWebProgress, aRequest, aState)
onSecurityChange()
{
},
onContentBlockingEvent(aWebProgress, aRequest, aEvent)
onContentBlockingEvent()
{
},

Просмотреть файл

@ -320,7 +320,7 @@ function initForBodyEditableDocumentTests() {
frameDocument.getElementById("editor2").removeEventListener("click", clickEventHandler);
iframe.onload =
function(aEvent) { SimpleTest.executeSoon(runBodyEditableDocumentTests1); };
function() { SimpleTest.executeSoon(runBodyEditableDocumentTests1); };
iframe.srcdoc = "<body contenteditable>body:</body>";
}

Просмотреть файл

@ -46,7 +46,7 @@ adapted from test_bug607584.xhtml by Kent James <kent@caspia.com>
QueryInterface: ChromeUtils.generateQI(["nsIWebProgressListener",
"nsISupportsWeakReference"]),
onStateChange(aWebProgress, aRequest, aStateFlags, aStatus)
onStateChange(aWebProgress, aRequest, aStateFlags)
{
if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP)
{
@ -69,25 +69,23 @@ adapted from test_bug607584.xhtml by Kent James <kent@caspia.com>
},
onProgressChange(aWebProgress, aRequest,
aCurSelfProgress, aMaxSelfProgress,
aCurTotalProgress, aMaxTotalProgress)
onProgressChange()
{
},
onLocationChange(aWebProgress, aRequest, aLocation, aFlags)
onLocationChange()
{
},
onStatusChange(aWebProgress, aRequest, aStatus, aMessage)
onStatusChange()
{
},
onSecurityChange(aWebProgress, aRequest, aState)
onSecurityChange()
{
},
onContentBlockingEvent(aWebProgress, aRequest, aEvent)
onContentBlockingEvent()
{
},

Просмотреть файл

@ -23,9 +23,9 @@ SimpleTest.waitForFocus(() => {
);
const editActionListener = {
QueryInterface: SpecialPowers.ChromeUtils.generateQI(["nsIEditActionListener"]),
WillDeleteText: (textNode, offset, length) => {},
DidInsertText: (textNode, offset, aString) => {},
WillDeleteRanges: (rangesToDelete) => {},
WillDeleteText: () => {},
DidInsertText: () => {},
WillDeleteRanges: () => {},
};
// Highlight "a"
findSelection.setBaseAndExtent(

Просмотреть файл

@ -3101,7 +3101,7 @@ async function doTest() {
beforeinputEvents = [];
inputEvents = [];
dragEvents = [];
const onDragStart = aEvent => {
const onDragStart = () => {
input.style.display = "none";
document.documentElement.scrollTop;
input.style.display = "";
@ -3147,7 +3147,7 @@ async function doTest() {
beforeinputEvents = [];
inputEvents = [];
dragEvents = [];
const onDragStart = aEvent => {
const onDragStart = () => {
textarea.style.display = "none";
document.documentElement.scrollTop;
textarea.style.display = "";
@ -3193,13 +3193,13 @@ async function doTest() {
beforeinputEvents = [];
inputEvents = [];
dragEvents = [];
const onMouseMove = aEvent => {
const onMouseMove = () => {
input.style.display = "none";
document.documentElement.scrollTop;
input.style.display = "";
document.documentElement.scrollTop;
};
const onMouseDown = aEvent => {
const onMouseDown = () => {
document.addEventListener("mousemove", onMouseMove, {once: true});
}
const onDrop = aEvent => {
@ -3243,13 +3243,13 @@ async function doTest() {
beforeinputEvents = [];
inputEvents = [];
dragEvents = [];
const onMouseMove = aEvent => {
const onMouseMove = () => {
textarea.style.display = "none";
document.documentElement.scrollTop;
textarea.style.display = "";
document.documentElement.scrollTop;
};
const onMouseDown = aEvent => {
const onMouseDown = () => {
document.addEventListener("mousemove", onMouseMove, {once: true});
}
const onDrop = aEvent => {

Просмотреть файл

@ -32,7 +32,7 @@
// Check that reading text from the clipboard in non-privileged contexts
// still doesn't work.
function onpstfail(e) {
function onpstfail() {
ok(false, "Should not see paste event triggered by non-privileged call");
}
document.addEventListener("paste", onpstfail);

Просмотреть файл

@ -224,7 +224,7 @@ async function doTextareaTests(aTextarea) {
aTextarea.value = "";
let pasteEventCount = 0;
function pasteEventLogger(event) {
function pasteEventLogger() {
pasteEventCount++;
}
aTextarea.addEventListener("paste", pasteEventLogger);
@ -381,7 +381,7 @@ async function doContenteditableTests(aEditableDiv) {
aEditableDiv.innerHTML = "";
let pasteEventCount = 0;
function pasteEventLogger(event) {
function pasteEventLogger() {
pasteEventCount++;
}
aEditableDiv.addEventListener("paste", pasteEventLogger);

Просмотреть файл

@ -57,7 +57,7 @@ SimpleTest.waitForFocus(async () => {
const editableElementDesc = `<${
editableElement.tagName.toLocaleLowerCase()
}${editableElement.hasAttribute("contenteditable") ? " contenteditable" : ""}>`;
(test_from_editableElement_to_input => {
(() => {
const input = document.querySelector("#dest > input");
editableElement.focus();
editableElement.addEventListener(
@ -84,7 +84,7 @@ SimpleTest.waitForFocus(async () => {
input.value = "";
})();
(test_from_editableElement_to_contenteditable => {
(() => {
const contentEditable = document.querySelector("#dest > div[contenteditable]");
editableElement.focus();
editableElement.addEventListener(
@ -111,7 +111,7 @@ SimpleTest.waitForFocus(async () => {
contentEditable.innerHTML = "<br>";
})();
(test_from_editableElement_to_non_editable => {
(() => {
const button = document.querySelector("#dest > button");
editableElement.focus();
editableElement.addEventListener(

Просмотреть файл

@ -11,7 +11,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1733878
<script src="/tests/SimpleTest/EventUtils.js"></script>
<script>
/** Test for bug 1733878 **/
window.addEventListener("DOMContentLoaded", (event) => {
window.addEventListener("DOMContentLoaded", () => {
SimpleTest.waitForExplicitFinish();
SimpleTest.waitForFocus(function() {
document.body.textContent = ""; // It would be \n\n otherwise...

Просмотреть файл

@ -67,11 +67,11 @@ SimpleTest.waitForFocus(async () => {
normalSel.collapse(editingHost.querySelector("p + p").firstChild, 0);
return 0;
},
run: (editingHost) => {
run: () => {
document.execCommand("delete");
return 0;
},
check: (spellCheckSel, editingHost) => {
check: (spellCheckSel) => {
is(
spellCheckSel.rangeCount,
0,
@ -86,11 +86,11 @@ SimpleTest.waitForFocus(async () => {
normalSel.collapse(editingHost.querySelector("p + p").firstChild, 0);
return 2;
},
run: (editingHost) => {
run: () => {
document.execCommand("delete");
return 0;
},
check: (spellCheckSel, editingHost) => {
check: (spellCheckSel) => {
is(
spellCheckSel.rangeCount,
0,
@ -105,11 +105,11 @@ SimpleTest.waitForFocus(async () => {
normalSel.collapse(editingHost.querySelector("p").firstChild, "It is".length);
return 1;
},
run: (editingHost) => {
run: () => {
document.execCommand("insertParagraph");
return 0;
},
check: (spellCheckSel, editingHost) => {
check: (spellCheckSel) => {
is(
spellCheckSel.rangeCount,
0,
@ -124,7 +124,7 @@ SimpleTest.waitForFocus(async () => {
normalSel.collapse(editingHost.querySelector("p").firstChild, "It's beco".length);
return 0;
},
run: (editingHost) => {
run: () => {
document.execCommand("insertParagraph");
return 1;
},