Skip to content

Commit d4ff9ef

Browse files
committed
Bug 1864896: Autofix unused function arguments (browser/components/pocket). r=thecount
Differential Revision: https://phabricator.services.mozilla.com/D202951
1 parent 27cc52d commit d4ff9ef

File tree

13 files changed

+28
-38
lines changed

13 files changed

+28
-38
lines changed

browser/components/pocket/content/SaveToPocket.sys.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export var SaveToPocket = {
101101
);
102102
},
103103

104-
observe(subject, topic, data) {
104+
observe(subject, topic) {
105105
if (topic == "browser-delayed-startup-finished") {
106106
// We only get here if pocket is disabled; the observer is removed when
107107
// we're enabled.

browser/components/pocket/content/panels/js/components/Home/Home.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function Home(props) {
3232
: ``
3333
}`;
3434

35-
const loadingRecentSaves = useCallback(resp => {
35+
const loadingRecentSaves = useCallback(() => {
3636
setArticlesState(prevState => ({
3737
...prevState,
3838
status: "loading",

browser/components/pocket/content/panels/js/components/Saved/Saved.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function Saved(props) {
8585

8686
panelMessaging.addMessageListener(
8787
"PKT_getArticleInfoAttempted",
88-
function (resp) {
88+
function () {
8989
setArticleInfoAttempted(true);
9090
}
9191
);

browser/components/pocket/content/panels/js/home/overlay.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import React from "react";
77
import ReactDOM from "react-dom";
88
import Home from "../components/Home/Home.jsx";
99

10-
var HomeOverlay = function (options) {
10+
var HomeOverlay = function () {
1111
this.inited = false;
1212
this.active = false;
1313
};

browser/components/pocket/content/panels/js/main.bundle.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ function Home(props) {
275275
status: ""
276276
});
277277
const utmParams = `utm_source=${utmSource}${utmCampaign && utmContent ? `&utm_campaign=${utmCampaign}&utm_content=${utmContent}` : ``}`;
278-
const loadingRecentSaves = (0,react.useCallback)(resp => {
278+
const loadingRecentSaves = (0,react.useCallback)(() => {
279279
setArticlesState(prevState => ({
280280
...prevState,
281281
status: "loading"
@@ -381,7 +381,7 @@ It does not contain any logic for saving or communication with the extension or
381381

382382

383383

384-
var HomeOverlay = function (options) {
384+
var HomeOverlay = function () {
385385
this.inited = false;
386386
this.active = false;
387387
};
@@ -487,7 +487,7 @@ It does not contain any logic for saving or communication with the extension or
487487

488488

489489

490-
var SignupOverlay = function (options) {
490+
var SignupOverlay = function () {
491491
this.inited = false;
492492
this.active = false;
493493
this.create = function ({
@@ -772,7 +772,7 @@ function Saved(props) {
772772
messages.addMessageListener("PKT_articleInfoFetched", function (resp) {
773773
setSavedStoryState(resp?.data?.item_preview);
774774
});
775-
messages.addMessageListener("PKT_getArticleInfoAttempted", function (resp) {
775+
messages.addMessageListener("PKT_getArticleInfoAttempted", function () {
776776
setArticleInfoAttempted(true);
777777
});
778778

@@ -843,7 +843,7 @@ It does not contain any logic for saving or communication with the extension or
843843

844844

845845

846-
var SavedOverlay = function (options) {
846+
var SavedOverlay = function () {
847847
this.inited = false;
848848
this.active = false;
849849
};
@@ -883,7 +883,7 @@ SavedOverlay.prototype = {
883883

884884

885885

886-
var StyleGuideOverlay = function (options) {};
886+
var StyleGuideOverlay = function () {};
887887
StyleGuideOverlay.prototype = {
888888
create() {
889889
// TODO: Wrap popular topics component in JSX to work without needing an explicit container hierarchy for styling
@@ -1072,7 +1072,7 @@ PKT_PANEL.prototype = {
10721072
const config = { attributes: false, childList: true, subtree: true };
10731073

10741074
// Callback function to execute when mutations are observed
1075-
const callback = (mutationList, observer) => {
1075+
const callback = mutationList => {
10761076
mutationList.forEach(mutation => {
10771077
switch (mutation.type) {
10781078
case "childList": {

browser/components/pocket/content/panels/js/main.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ PKT_PANEL.prototype = {
8686
const config = { attributes: false, childList: true, subtree: true };
8787

8888
// Callback function to execute when mutations are observed
89-
const callback = (mutationList, observer) => {
89+
const callback = mutationList => {
9090
mutationList.forEach(mutation => {
9191
switch (mutation.type) {
9292
case "childList": {

browser/components/pocket/content/panels/js/saved/overlay.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import React from "react";
77
import ReactDOM from "react-dom";
88
import Saved from "../components/Saved/Saved.jsx";
99

10-
var SavedOverlay = function (options) {
10+
var SavedOverlay = function () {
1111
this.inited = false;
1212
this.active = false;
1313
};

browser/components/pocket/content/panels/js/signup/overlay.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import ReactDOM from "react-dom";
88
import pktPanelMessaging from "../messages.mjs";
99
import Signup from "../components/Signup/Signup.jsx";
1010

11-
var SignupOverlay = function (options) {
11+
var SignupOverlay = function () {
1212
this.inited = false;
1313
this.active = false;
1414

browser/components/pocket/content/panels/js/style-guide/overlay.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Button from "../components/Button/Button.jsx";
66
import PopularTopics from "../components/PopularTopics/PopularTopics.jsx";
77
import TagPicker from "../components/TagPicker/TagPicker.jsx";
88

9-
var StyleGuideOverlay = function (options) {};
9+
var StyleGuideOverlay = function () {};
1010

1111
StyleGuideOverlay.prototype = {
1212
create() {

browser/components/pocket/content/pktApi.sys.mjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ export var pktApi = (function () {
317317
request.open("GET", url, true);
318318
}
319319

320-
request.onreadystatechange = function (e) {
320+
request.onreadystatechange = function () {
321321
if (request.readyState == 4) {
322322
// "done" is a completed XHR regardless of success/error:
323323
if (options.done) {
@@ -487,7 +487,7 @@ export var pktApi = (function () {
487487
access_token: getAccessToken(),
488488
url,
489489
},
490-
success(data) {
490+
success() {
491491
if (options.success) {
492492
options.success.apply(options, Array.apply(null, arguments));
493493
}
@@ -508,7 +508,7 @@ export var pktApi = (function () {
508508
data: {
509509
access_token: getAccessToken(),
510510
},
511-
success(data) {
511+
success() {
512512
if (options.success) {
513513
options.success.apply(options, Array.apply(null, arguments));
514514
}

browser/components/pocket/content/pktUI.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ var pktUI = (function () {
125125
* Show the sign-up panel
126126
*/
127127
function showSignUp() {
128-
getFirefoxAccountSignedInUser(function (userdata) {
128+
getFirefoxAccountSignedInUser(function () {
129129
showPanel(
130130
"about:pocket-signup?" +
131131
"emailButton=" +
@@ -284,7 +284,7 @@ var pktUI = (function () {
284284

285285
// Add url
286286
var options = {
287-
success(data, request) {
287+
success(data) {
288288
var item = data.item;
289289
var ho2 = data.ho2;
290290
var accountState = data.account_state;
@@ -493,7 +493,7 @@ var pktUI = (function () {
493493
.then(userData => {
494494
callback(userData);
495495
})
496-
.then(null, error => {
496+
.then(null, () => {
497497
callback();
498498
});
499499
}

browser/components/pocket/test/browser_pocket_button_icon_state.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function checkPanelClosed() {
7979
);
8080
}
8181

82-
test_runner(async function test_pocketButtonState_changeTabs({ sandbox }) {
82+
test_runner(async function test_pocketButtonState_changeTabs() {
8383
let tab = await BrowserTestUtils.openNewForegroundTab(
8484
gBrowser,
8585
"https://example.com/browser/browser/components/pocket/test/test.html"
@@ -105,7 +105,7 @@ test_runner(async function test_pocketButtonState_changeTabs({ sandbox }) {
105105
BrowserTestUtils.removeTab(tab);
106106
});
107107

108-
test_runner(async function test_pocketButtonState_changeLocation({ sandbox }) {
108+
test_runner(async function test_pocketButtonState_changeLocation() {
109109
let tab = await BrowserTestUtils.openNewForegroundTab(
110110
gBrowser,
111111
"https://example.com/browser/browser/components/pocket/test/test.html"

browser/components/pocket/test/unit/browser_pocket_AboutPocketParent.js

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,7 @@ test_runner(async function test_AboutPocketParent_sendResponseMessageToPanel({
7878
});
7979

8080
test_runner(
81-
async function test_AboutPocketParent_receiveMessage_PKT_show_signup({
82-
sandbox,
83-
}) {
81+
async function test_AboutPocketParent_receiveMessage_PKT_show_signup() {
8482
await aboutPocketParent.receiveMessage({
8583
name: "PKT_show_signup",
8684
});
@@ -96,9 +94,7 @@ test_runner(
9694
);
9795

9896
test_runner(
99-
async function test_AboutPocketParent_receiveMessage_PKT_show_saved({
100-
sandbox,
101-
}) {
97+
async function test_AboutPocketParent_receiveMessage_PKT_show_saved() {
10298
await aboutPocketParent.receiveMessage({
10399
name: "PKT_show_saved",
104100
});
@@ -113,9 +109,7 @@ test_runner(
113109
}
114110
);
115111

116-
test_runner(async function test_AboutPocketParent_receiveMessage_PKT_close({
117-
sandbox,
118-
}) {
112+
test_runner(async function test_AboutPocketParent_receiveMessage_PKT_close() {
119113
await aboutPocketParent.receiveMessage({
120114
name: "PKT_close",
121115
});
@@ -130,9 +124,7 @@ test_runner(async function test_AboutPocketParent_receiveMessage_PKT_close({
130124
});
131125

132126
test_runner(
133-
async function test_AboutPocketParent_receiveMessage_PKT_openTabWithUrl({
134-
sandbox,
135-
}) {
127+
async function test_AboutPocketParent_receiveMessage_PKT_openTabWithUrl() {
136128
await aboutPocketParent.receiveMessage({
137129
name: "PKT_openTabWithUrl",
138130
data: { foo: 1 },
@@ -155,9 +147,7 @@ test_runner(
155147
);
156148

157149
test_runner(
158-
async function test_AboutPocketParent_receiveMessage_PKT_openTabWithPocketUrl({
159-
sandbox,
160-
}) {
150+
async function test_AboutPocketParent_receiveMessage_PKT_openTabWithPocketUrl() {
161151
await aboutPocketParent.receiveMessage({
162152
name: "PKT_openTabWithPocketUrl",
163153
data: { foo: 1 },

0 commit comments

Comments
 (0)