Open Bug 1509029 Opened 9 months ago Updated 2 months ago

[meta] browser-*.js global-scope pollution

Categories

(Firefox :: General, task, P5)

task

Tracking

()

People

(Reporter: dao, Assigned: dao)

References

Details

(Keywords: meta)

browser-*.js scripts are often seen as self-contained when they're really not (they share the browser window scope with loads of other scripts), leading people to think it would be reasonable to put their helper stuff in their "private" scope just like they would in a jsm. Then somebody else sees that the thing they want to use is already defined and reuse it in some other script running in the browser window, leading to weird dependencies that are annoying when refactoring or moving code, or they don't see it and redeclare it (possibly with some other value when things are named too generically).

Filing this meta bug for this reoccurring code hygiene issue as a way to provide context so that I won't have to repeatedly explain it.
Depends on: 1509323
User Story: (updated)
See Also: → 1509309
Depends on: 1509451
User Story: (updated)
Depends on: 836448
Assignee: nobody → dao+bmo
Component: General → JavaScript Engine
Product: Firefox → Core

Sylvestre, is the bot moving all "JavaScript" bugs into the JS Engine component? That seems wrong.

Flags: needinfo?(sledru)

Pretty sure the problem here was the mention of JavaScript and global and scope, which are often linked to JavaScript bugs.
Also, comment 0 is empty and the info is in the user story (which is pretty rare).

Flags: needinfo?(sledru)
Type: enhancement → task
Component: JavaScript Engine → General
Product: Core → Firefox
User Story: (updated)
You need to log in before you can comment on or make changes to this bug.