Enable no-unused-vars for toolkit/components

RESOLVED FIXED in Firefox 52

Status

()

defect
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: standard8, Assigned: standard8)

Tracking

unspecified
mozilla52
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox52 fixed)

Details

Attachments

(2 attachments)

(Assignee)

Description

3 years ago
I'm working on patches to enable no-unused-vars for toolkit/components. See bug 1315949 for more details.
Comment hidden (mozreview-request)

Comment 3

3 years ago
mozreview-review
Comment on attachment 8808969 [details]
Bug 1315951 - Fix no-unused-vars issues in toolkit/components (except places).

https://reviewboard.mozilla.org/r/91670/#review91616

::: toolkit/components/crashes/CrashService.js:65
(Diff revision 1)
>  
>    observe: function (subject, topic, data) {
>      switch (topic) {
>        case "profile-after-change":
>          // Side-effect is the singleton is instantiated.
> -        let m = Services.crashmanager;
> +        let m = Services.crashmanager; // eslint-disable-line no-unused-vars

You don't need the variable here for the side effect to happen

::: toolkit/components/jsdownloads/test/unit/head.js:826
(Diff revision 1)
>    }));
>  
>    // Get a reference to nsIComponentRegistrar, and ensure that is is freed
>    // before the XPCOM shutdown.
> -  let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
> +  let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); // eslint-disable-line no-unused-vars
>    do_register_cleanup(() => registrar = null);

This doesn't look like it does anything to me. Do you disagree?
Attachment #8808969 - Flags: review?(dtownsend)

Comment 4

3 years ago
mozreview-review
Comment on attachment 8808968 [details]
Bug 1315951 - Enable no-unused-vars for toolkit/components/places.

https://reviewboard.mozilla.org/r/91668/#review91626

Thank you, this looks great!

::: toolkit/components/places/tests/browser/browser_favicon_setAndFetchFaviconForPage_failures.js:44
(Diff revision 1)
>  
>    function checkFavIconsDBCount(aCallback) {
>      let stmt = DBConn().createAsyncStatement("SELECT url FROM moz_favicons");
>      stmt.executeAsync({
>        handleResult: function final_handleResult(aResultSet) {
> -        for (let row; (row = aResultSet.getNextRow()); ) {
> +        for (let row; (row = aResultSet.getNextRow()); ) { // eslint-disable-line no-unused-vars

can we use a "while (aResultSet.getNextRow())" instead?
Attachment #8808968 - Flags: review?(mak77) → review+
(Assignee)

Comment 5

3 years ago
mozreview-review-reply
Comment on attachment 8808968 [details]
Bug 1315951 - Enable no-unused-vars for toolkit/components/places.

https://reviewboard.mozilla.org/r/91668/#review91626

> can we use a "while (aResultSet.getNextRow())" instead?

Yes, that's much nicer.
(Assignee)

Comment 6

3 years ago
mozreview-review-reply
Comment on attachment 8808969 [details]
Bug 1315951 - Fix no-unused-vars issues in toolkit/components (except places).

https://reviewboard.mozilla.org/r/91670/#review91616

> You don't need the variable here for the side effect to happen

Thanks, I've tidied it up.

> This doesn't look like it does anything to me. Do you disagree?

Further checking shows it isn't required at all - we don't even need to get the registrar, hence I've got rid of those lines.
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)

Comment 9

3 years ago
mozreview-review
Comment on attachment 8808969 [details]
Bug 1315951 - Fix no-unused-vars issues in toolkit/components (except places).

https://reviewboard.mozilla.org/r/91670/#review92044
Attachment #8808969 - Flags: review?(dtownsend) → review+
Comment hidden (mozreview-request)
Comment hidden (mozreview-request)
(Assignee)

Comment 12

3 years ago
That was a minor update for bitrot.

Comment 13

3 years ago
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8e9417d75175
Enable no-unused-vars for toolkit/components/places. r=mak
https://hg.mozilla.org/integration/autoland/rev/6868b4b3f1ae
Fix no-unused-vars issues in toolkit/components (except places). r=mossop

Comment 14

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/8e9417d75175
https://hg.mozilla.org/mozilla-central/rev/6868b4b3f1ae
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla52

Updated

3 years ago
Depends on: 1319009
You need to log in before you can comment on or make changes to this bug.