Bug 1509029 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

browser-*.js scripts are often seen as self-contained when they're really not, 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, leading to weird dependencies, or they don't see it and add another global import on top of it.

Filing this meta bug for this reoccurring code hygiene issue so that I won't have to repeatedly explain it.
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.

Back to Bug 1509029 Comment 0