Fix eslint errors in devtools/client/*.js

RESOLVED FIXED in Firefox 47

Status

RESOLVED FIXED
3 years ago
6 months ago

People

(Reporter: pbro, Assigned: pbro)

Tracking

unspecified
Firefox 47

Firefox Tracking Flags

(firefox47 fixed)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
devtools/client/definitions.js
devtools/client/devtools-clhandler.js
devtools/client/main.js
(Assignee)

Updated

3 years ago
Assignee: nobody → pbrosset
(Assignee)

Comment 1

3 years ago
Created attachment 8711842 [details]
MozReview Request: Bug 1242689 - Fix eslint errors in devtools/client/*.js and un-ignore the files; r=tromey

Review commit: https://reviewboard.mozilla.org/r/32351/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/32351/
Attachment #8711842 - Flags: review?(ttromey)
(Assignee)

Comment 2

3 years ago
Partial try push with every job but ESLint canceled:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=69523d27e5f9&selectedJob=15910657
So, yay, ESLint still passes!

Updated

3 years ago
Attachment #8711842 - Flags: review?(ttromey) → review+
Comment on attachment 8711842 [details]
MozReview Request: Bug 1242689 - Fix eslint errors in devtools/client/*.js and un-ignore the files; r=tromey

https://reviewboard.mozilla.org/r/32351/#review29013

Looks good.

::: devtools/client/devtools-clhandler.js:4
(Diff revision 1)
> +/* globals BrowserToolboxProcess */

I don't mind this use of globals but I wonder if the import-browserjs-globals rule could be used somehow instead (assuming it is in fact appropriate to use).
(Assignee)

Comment 4

3 years ago
(In reply to Tom Tromey :tromey from comment #3)
> Comment on attachment 8711842 [details]
> MozReview Request: Bug 1242689 - Fix eslint errors in devtools/client/*.js
> and un-ignore the files; r=tromey
> 
> https://reviewboard.mozilla.org/r/32351/#review29013
> 
> Looks good.
> 
> ::: devtools/client/devtools-clhandler.js:4
> (Diff revision 1)
> > +/* globals BrowserToolboxProcess */
> 
> I don't mind this use of globals but I wonder if the
> import-browserjs-globals rule could be used somehow instead (assuming it is
> in fact appropriate to use).
I thought about that too. I'll need to dive into how this module is loaded better though. I don't see where this global comes from.
Thanks for the review. I'll try to fix this and land the patch then.
(Assignee)

Comment 5

3 years ago
Somehow, I had completely miss this import line in devtools-clhandler.js:
Cu.import("resource://devtools/client/framework/ToolboxProcess.jsm");
So, that's where the BrowserToolboxProcess global comes from.
So, in theory, we could use /* import-globals-from */ instead of /* globals */ but the problem is that this jsm module defines BrowserToolboxProcess with `this.BrowserToolboxProcess`, so it's not defined as a global, but as a property of `this`.
This means that the import-globals-from plugin doesn't register it as a global.
After discussing with :ochameau, I learned that most jsm modules do this so they can run on b2g (where the scope jsms are loaded in is shared). So I can't really change ToolboxProcess.jsm and remove the `this` part.

So, we can either keep the /* globals */ comment or evolve the import-globals-from plugin so it registers properties stored on the top-level `this` in jsms as globals too.
Doing this belongs to a separate bug anyway, so I'm going to go ahead and land this change and file a separate bug for this: bug 1242893.

Comment 7

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/cdf3a74d6bc0
Status: NEW → RESOLVED
Last Resolved: 3 years ago
status-firefox47: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 47

Updated

6 months ago
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.