Closed Bug 1420448 Opened 7 years ago Closed 7 years ago

Remove gLastBrowserCharset and gAppInfo from browser.js

Categories

(Firefox :: General, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 59
Tracking Status
firefox59 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

Attachments

(1 file)

I noticed gAppInfo whilst swapping code to use Services rather than getService, and from a search realised that it was not used:

https://searchfox.org/mozilla-central/search?q=gAppInfo&path=

The only uses there are test files, and they get their own value via the head files.

I also took a look around a bit more and discovered that gLastBrowserCharset is no longer used anywhere:

https://searchfox.org/mozilla-central/search?q=gLastBrowserCharset&path=

Since we no longer support legacy extensions, I think we can drop both of these.
Forgot to say, I also took a look at the appinfo class, and we don't appear to be initialising anything special there. Hence we don't need to initiate it in loading browser.js.
Blocks: 1421379
Comment on attachment 8931716 [details]
Bug 1420448 - Remove unused gLastBrowserCharset and gAppInfo from browser.js.

https://reviewboard.mozilla.org/r/202852/#review209834

Thanks for cleaning this up, and sorry for the delay.

Can eslint detect unused variables like these?
Attachment #8931716 - Flags: review?(florian) → review+
(In reply to Florian Quèze [:florian] [:flo] from comment #3)
> Can eslint detect unused variables like these?

no-unused-vars can detect unused globals (we generally have it off though), but one of the problems with a lot of our code, is that we have undocumented silent "exports", well, more like "let's go grab anything from anywhere and use it". Obviously that would make reliable detection near impossible.
I should clarify that's more a problem with our content code, rather than the jsm based code.
Pushed by mbanner@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/580b1d63e1e8
Remove unused gLastBrowserCharset and gAppInfo from browser.js. r=florian
https://hg.mozilla.org/mozilla-central/rev/580b1d63e1e8
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 59
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: