Closed
Bug 1231963
Opened 7 years ago
Closed 7 years ago
ESLint should treat global `this` as the global scope
Categories
(Testing :: General, defect)
Testing
General
Tracking
(firefox46 fixed)
RESOLVED
FIXED
mozilla46
Tracking | Status | |
---|---|---|
firefox46 | --- | fixed |
People
(Reporter: kmag, Assigned: tromey)
References
Details
Attachments
(1 file)
3.22 KB,
patch
|
miker
:
review+
|
Details | Diff | Splinter Review |
ESLint doesn't treat `this` at the top level as a reference to the global scope. This causes problems for many JSMs, which have to define globals as properties of `this` for the sake of the b2g loader. I'm not sure if this should be fixed in ESLint or implemented as a plugin, but either way, it affects a lot of our code.
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → ttromey
Status: NEW → ASSIGNED
Assignee | ||
Comment 2•7 years ago
|
||
Assignee | ||
Updated•7 years ago
|
Attachment #8709534 -
Flags: review?(mratcliffe)
Comment on attachment 8709534 [details] [diff] [review] handle top-level "this.mumble" assignments in eslint Review of attachment 8709534 [details] [diff] [review]: ----------------------------------------------------------------- Couldn't be simpler, r+.
Attachment #8709534 -
Flags: review?(mratcliffe) → review+
Assignee | ||
Comment 4•7 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=c445645ef9f7
Comment 6•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/cf165d1764d6
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox46:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
Comment 7•7 years ago
|
||
Nice one Tom! I think this (and other rules like import-globals-from, etc.) should be mentioned to a wider audience in an email to dev-platform. Many teams are in the process of getting rid of eslint errors, and these rules come in very handy. Would you like to do that?
Flags: needinfo?(ttromey)
Assignee | ||
Comment 8•7 years ago
|
||
Actually this rule got unified with some others in bug 1245916, and enabled by default. Also from grepping a bit it seems the other groups are already using some of the other mozilla rules. So, I think maybe an email isn't needed.
Flags: needinfo?(ttromey)
You need to log in
before you can comment on or make changes to this bug.
Description
•