Skip to content

Commit 95ccf71

Browse files
committed
Bug 1864896: Autofix unused function arguments (browser/base/content). r=Gijs,application-update-reviewers,tabbrowser-reviewers,places-reviewers,bytesized,dao
Differential Revision: https://phabricator.services.mozilla.com/D202949
1 parent 6a13707 commit 95ccf71

File tree

149 files changed

+437
-498
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+437
-498
lines changed

browser/base/content/aboutDialog-appUpdater.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var UPDATING_MIN_DISPLAY_TIME_MS = 1500;
2828

2929
var gAppUpdater;
3030

31-
function onUnload(aEvent) {
31+
function onUnload(_aEvent) {
3232
if (gAppUpdater) {
3333
gAppUpdater.destroy();
3434
gAppUpdater = null;

browser/base/content/browser-a11yUtils.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,16 @@ var A11yUtils = {
2121
* can thus hinder rather than help users if used incorrectly.
2222
* Please only use this after consultation with the Mozilla accessibility
2323
* team.
24+
* @param {object} [options]
2425
* @param {string} [options.id] The Fluent id of the message to announce. The
2526
* ftl file must already be included in browser.xhtml. This must be
2627
* specified unless a raw message is specified instead.
2728
* @param {object} [options.args] Arguments for the Fluent message.
2829
* @param {string} [options.raw] The raw, already localized message to
2930
* announce. You should generally prefer a Fluent id instead, but in
3031
* rare cases, this might not be feasible.
31-
* @param {Element} [options.source] The element with which the announcement
32-
* is associated. This should generally be something the user can
33-
* interact with to respond to the announcement. For example, for an
34-
* announcement indicating that Reader View is available, this should
35-
* be the Reader View button on the toolbar.
3632
*/
37-
async announce({ id = null, args = {}, raw = null, source = document } = {}) {
33+
async announce({ id = null, args = {}, raw = null } = {}) {
3834
if ((!id && !raw) || (id && raw)) {
3935
throw new Error("One of raw or id must be specified.");
4036
}

browser/base/content/browser-addons.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ var gXPInstallObserver = {
525525
Services.console.logMessage(consoleMsg);
526526
},
527527

528-
async observe(aSubject, aTopic, aData) {
528+
async observe(aSubject, aTopic) {
529529
var installInfo = aSubject.wrappedJSObject;
530530
var browser = installInfo.browser;
531531

@@ -1009,7 +1009,7 @@ var gExtensionsNotifications = {
10091009

10101010
let items = 0;
10111011
if (lazy.AMBrowserExtensionsImport.canCompleteOrCancelInstalls) {
1012-
this._createAddonButton("webext-imported-addons", null, evt => {
1012+
this._createAddonButton("webext-imported-addons", null, () => {
10131013
lazy.AMBrowserExtensionsImport.completeInstalls();
10141014
});
10151015
items++;
@@ -1022,7 +1022,7 @@ var gExtensionsNotifications = {
10221022
this._createAddonButton(
10231023
"webext-perms-update-menu-item",
10241024
update.addon,
1025-
evt => {
1025+
() => {
10261026
ExtensionsUI.showUpdate(gBrowser, update);
10271027
}
10281028
);
@@ -1032,7 +1032,7 @@ var gExtensionsNotifications = {
10321032
if (++items > 4) {
10331033
break;
10341034
}
1035-
this._createAddonButton("webext-perms-sideload-menu-item", addon, evt => {
1035+
this._createAddonButton("webext-perms-sideload-menu-item", addon, () => {
10361036
// We need to hide the main menu manually because the toolbarbutton is
10371037
// removed immediately while processing this event, and PanelUI is
10381038
// unable to identify which panel should be closed automatically.
@@ -1117,7 +1117,7 @@ var BrowserAddonUI = {
11171117
win.openAbuseReport({ addonId, reportEntryPoint });
11181118
},
11191119

1120-
async removeAddon(addonId, eventObject) {
1120+
async removeAddon(addonId) {
11211121
let addon = addonId && (await AddonManager.getAddonByID(addonId));
11221122
if (!addon || !(addon.permissions & AddonManager.PERM_CAN_UNINSTALL)) {
11231123
return;
@@ -1136,7 +1136,7 @@ var BrowserAddonUI = {
11361136
}
11371137
},
11381138

1139-
async manageAddon(addonId, eventObject) {
1139+
async manageAddon(addonId) {
11401140
let addon = addonId && (await AddonManager.getAddonByID(addonId));
11411141
if (!addon) {
11421142
return;
@@ -1798,7 +1798,7 @@ var gUnifiedExtensions = {
17981798
}
17991799
},
18001800

1801-
onWidgetAdded(aWidgetId, aArea, aPosition) {
1801+
onWidgetAdded(aWidgetId, aArea) {
18021802
// When we pin a widget to the toolbar from a narrow window, the widget
18031803
// will be overflowed directly. In this case, we do not want to change the
18041804
// class name since it is going to be changed by `onWidgetOverflow()`
@@ -1813,7 +1813,7 @@ var gUnifiedExtensions = {
18131813
this._updateWidgetClassName(aWidgetId, inPanel);
18141814
},
18151815

1816-
onWidgetOverflow(aNode, aContainer) {
1816+
onWidgetOverflow(aNode) {
18171817
// We register a CUI listener for each window so we make sure that we
18181818
// handle the event for the right window here.
18191819
if (window !== aNode.ownerGlobal) {
@@ -1823,7 +1823,7 @@ var gUnifiedExtensions = {
18231823
this._updateWidgetClassName(aNode.getAttribute("widget-id"), true);
18241824
},
18251825

1826-
onWidgetUnderflow(aNode, aContainer) {
1826+
onWidgetUnderflow(aNode) {
18271827
// We register a CUI listener for each window so we make sure that we
18281828
// handle the event for the right window here.
18291829
if (window !== aNode.ownerGlobal) {

browser/base/content/browser-allTabsMenu.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ var gTabsPanel = {
5858
dropIndicator: this.dropIndicator,
5959
});
6060

61-
this.allTabsView.addEventListener("ViewShowing", e => {
61+
this.allTabsView.addEventListener("ViewShowing", () => {
6262
PanelUI._ensureShortcutsShown(this.allTabsView);
6363

6464
let containersEnabled =
@@ -74,7 +74,7 @@ var gTabsPanel = {
7474
!hasHiddenTabs;
7575
});
7676

77-
this.allTabsView.addEventListener("ViewShown", e =>
77+
this.allTabsView.addEventListener("ViewShown", () =>
7878
this.allTabsView
7979
.querySelector(".all-tabs-item[selected]")
8080
?.scrollIntoView({ block: "center" })
@@ -170,7 +170,7 @@ var gTabsPanel = {
170170
}
171171
this.allTabsView.addEventListener(
172172
"ViewShown",
173-
e => {
173+
() => {
174174
PanelUI.showSubView(
175175
this.kElements.hiddenTabsView,
176176
this.hiddenTabsButton

browser/base/content/browser-captivePortal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ var CaptivePortalWatcher = {
9595
}
9696
},
9797

98-
observe(aSubject, aTopic, aData) {
98+
observe(aSubject, aTopic) {
9999
switch (aTopic) {
100100
case "captive-portal-login":
101101
this._captivePortalDetected();

browser/base/content/browser-ctrlTab.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ var ctrlTab = {
284284
this.uninit();
285285
}
286286
},
287-
observe(aSubject, aTopic, aPrefName) {
287+
observe() {
288288
this.readPref();
289289
},
290290

@@ -654,7 +654,7 @@ var ctrlTab = {
654654
// tab attribute modified (i.e. label, busy, image)
655655
// update preview only if tab attribute modified in the list
656656
if (
657-
event.detail.changed.some((elem, ind, arr) =>
657+
event.detail.changed.some(elem =>
658658
["label", "busy", "image"].includes(elem)
659659
)
660660
) {

browser/base/content/browser-data-submission-info-bar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ var gDataNotificationInfoBar = {
9292
}
9393
},
9494

95-
observe(subject, topic, data) {
95+
observe(subject, topic) {
9696
switch (topic) {
9797
case "datareporting:notify-data-policy:request":
9898
let request = subject.wrappedJSObject.object;

browser/base/content/browser-gestureSupport.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ var gGestureSupport = {
269269
gHistorySwipeAnimation.updateAnimation(aEvent.delta);
270270
};
271271

272-
this._doEnd = function GS__doEnd(aEvent) {
272+
this._doEnd = function GS__doEnd() {
273273
gHistorySwipeAnimation.swipeEndEventReceived();
274274

275275
this._doUpdate = function () {};
@@ -393,15 +393,15 @@ var gGestureSupport = {
393393
* @param aEvent
394394
* The continual motion update event to handle
395395
*/
396-
_doUpdate(aEvent) {},
396+
_doUpdate() {},
397397

398398
/**
399399
* Handle gesture end events. This function will be set by _setupSwipe.
400400
*
401401
* @param aEvent
402402
* The gesture end event to handle
403403
*/
404-
_doEnd(aEvent) {},
404+
_doEnd() {},
405405

406406
/**
407407
* Convert the swipe gesture into a browser action based on the direction.
@@ -874,7 +874,7 @@ var gHistorySwipeAnimation = {
874874
}
875875
},
876876

877-
_completeFadeOut: function HSA__completeFadeOut(aEvent) {
877+
_completeFadeOut: function HSA__completeFadeOut() {
878878
if (!this._isStoppingAnimation) {
879879
// The animation was restarted in the middle of our stopping fade out
880880
// tranistion, so don't do anything.
@@ -943,7 +943,7 @@ var gHistorySwipeAnimation = {
943943
return element;
944944
},
945945

946-
observe(subj, topic, data) {
946+
observe(subj, topic) {
947947
switch (topic) {
948948
case "nsPref:changed":
949949
this._initPrefValues();

browser/base/content/browser-pageActions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1008,7 +1008,7 @@ BrowserPageActions.bookmark = {
10081008
}
10091009
},
10101010

1011-
onCommand(event, buttonNode) {
1011+
onCommand(event) {
10121012
PanelMultiView.hidePopup(BrowserPageActions.panelNode);
10131013
BookmarkingUI.onStarCommand(event);
10141014
},

browser/base/content/browser-places.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ XPCOMUtils.defineLazyPreferenceGetter(
1717
"SHOW_OTHER_BOOKMARKS",
1818
"browser.toolbars.bookmarks.showOtherBookmarks",
1919
true,
20-
(aPref, aPrevVal, aNewVal) => {
20+
() => {
2121
BookmarkingUI.maybeShowOtherBookmarksFolder().then(() => {
2222
document
2323
.getElementById("PlacesToolbar")
@@ -253,7 +253,7 @@ var StarUI = {
253253
}
254254
target.addEventListener(
255255
"popupshown",
256-
function (event) {
256+
function () {
257257
fn();
258258
},
259259
{ capture: true, once: true }
@@ -1174,7 +1174,7 @@ var PlacesToolbarHelper = {
11741174
return null;
11751175
},
11761176

1177-
onWidgetUnderflow(aNode, aContainer) {
1177+
onWidgetUnderflow(aNode) {
11781178
// The view gets broken by being removed and reinserted by the overflowable
11791179
// toolbar, so we have to force an uninit and reinit.
11801180
let win = aNode.ownerGlobal;
@@ -1183,7 +1183,7 @@ var PlacesToolbarHelper = {
11831183
}
11841184
},
11851185

1186-
onWidgetAdded(aWidgetId, aArea, aPosition) {
1186+
onWidgetAdded(aWidgetId) {
11871187
if (aWidgetId == "personal-bookmarks" && !this._isCustomizing) {
11881188
// It's possible (with the "Add to Menu", "Add to Toolbar" context
11891189
// options) that the Places Toolbar Items have been moved without
@@ -1659,13 +1659,13 @@ var BookmarkingUI = {
16591659
}
16601660
},
16611661

1662-
onWidgetReset: function BUI_widgetReset(aNode, aContainer) {
1662+
onWidgetReset: function BUI_widgetReset(aNode) {
16631663
if (aNode == this.button) {
16641664
this._onWidgetWasMoved();
16651665
}
16661666
},
16671667

1668-
onWidgetUndoMove: function BUI_undoWidgetUndoMove(aNode, aContainer) {
1668+
onWidgetUndoMove: function BUI_undoWidgetUndoMove(aNode) {
16691669
if (aNode == this.button) {
16701670
this._onWidgetWasMoved();
16711671
}
@@ -2155,7 +2155,7 @@ var BookmarkingUI = {
21552155
});
21562156
},
21572157

2158-
onWidgetUnderflow(aNode, aContainer) {
2158+
onWidgetUnderflow(aNode) {
21592159
let win = aNode.ownerGlobal;
21602160
if (aNode.id != this.BOOKMARK_BUTTON_ID || win != window) {
21612161
return;

0 commit comments

Comments
 (0)