Closed Bug 1607331 Opened 5 years ago Closed 2 years ago

Reject global this usage in JSM except for special cases

Categories

(Developer Infrastructure :: Lint and Formatting, task, P3)

Tracking

(firefox103 fixed)

RESOLVED FIXED
103 Branch
Tracking Status
firefox103 --- fixed

People

(Reporter: mossop, Assigned: arai)

References

(Blocks 1 open bug)

Details

Attachments

(4 files, 2 obsolete files)

We want to gather an understanding of the uses of global this in JSM files which would be unavailable when using the same code as an ES6 module. Going to add a patch here that lints for that case though for now we won't want to land it.

Priority: -- → P3
Attachment #9118957 - Attachment is obsolete: true
Assignee: dtownsend → nobody
Assignee: nobody → arai.unmht
Status: NEW → ASSIGNED
Depends on: 1764688
Depends on: 1764689
Depends on: 1764773
Severity: normal → --
Depends on: 1610653
No longer depends on: 1764773
Attached file updated lint rules (obsolete) —

Modified some rules and also added rule to block globalThis property assign.

Attached file updated lint rules

Fixed the rule to ignore this inside class properties/methods/static block

Attachment #9273978 - Attachment is obsolete: true
Summary: Investigate the uses of the global this in JSMs → Reject global this usage in JSM except for special cases
Depends on: 1608279
Blocks: 1609269
Keywords: leave-open
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/7fdd8b0bb660 Part 1: Do not use global this in remote/shared/messagehandler/transports/FrameTransport.jsm. r=jdescottes,webdriver-reviewers
Attachment #9280113 - Attachment description: Bug 1607331 - Part 2: Reject global this usage in JSM. r?Standard8 → Bug 1607331 - Part 2: Reject global this usage in JSM. r?Standard8!
Attachment #9280113 - Attachment description: Bug 1607331 - Part 2: Reject global this usage in JSM. r?Standard8! → Bug 1607331 - Part 3: Reject global this usage in JSM. r?Standard8!
Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/17f053b1840d Part 2: Do not use global this in browser/components/newtab/lib/DiscoveryStreamFeed.jsm. r=Standard8 https://hg.mozilla.org/integration/autoland/rev/0d1185dbe3e2 Part 3: Reject global this usage in JSM. r=Standard8
Keywords: leave-open
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 103 Branch
See Also: → 1774362
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: