Closed
Bug 379797
Opened 18 years ago
Closed 7 years ago
dump() in JS Components should obey browser.dom.window.dump.enabled
Categories
(Core :: XPConnect, enhancement)
Core
XPConnect
Tracking
()
RESOLVED
FIXED
mozilla57
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: dveditz, Assigned: mccr8)
References
Details
Attachments
(1 file)
Inspired by problems such as regression bug 379722:
In DOM code dump() does not print anything in non-debug builds unless you set dom.window.dump.enabled to true. Developers feel free to sprinkle dump() and not worry too much.
In JS components, however, dump() always dumps which can result in debug code ending up in shipping builds. What the developers intended was no doubt debug(), but having different behavior for the same function is confusing.
Various options:
- make dump() synonymous with debug() and add a print()
- make dump() obey the pref. Currently xpconnect/loader does not
depend on prefs, but it REQUIRES caps and necko which do
- in DEBUG builds have dump(<foo>) spit out
"**Did you mean to use debug() instead?**\n<foo>"
(only sort of kidding)
- ?something else?
Comment 1•18 years ago
|
||
From a developer perspective, I believe following the pref (and thus making it behave the same as window.dump()) would be the most logical. (Of course, the pref then has a silly name for what it does, but you can't have everything.)
Assignee | ||
Comment 2•7 years ago
|
||
I tweeted about bug 1386036, and mconley mentioned the pref browser.dom.window.dump.enabled. I tracked down where the dump() was implemented, which eventually led me to this bug. I'll just change this dump method to obey the pref.
Assignee: nobody → continuation
Summary: dump() in JS Components is different than DOM dump(), causes confusion → dump() in JS Components should obey browser.dom.window.dump.enabled
Assignee | ||
Comment 3•7 years ago
|
||
Sandboxes have yet another implementation of dump(), so I'll fix that, too.
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Comment 6•7 years ago
|
||
mozreview-review |
Comment on attachment 8893055 [details]
Bug 379797 - Various dump() methods should check browser.dom.window.dump.enabled.
https://reviewboard.mozilla.org/r/164042/#review170242
\o/
Attachment #8893055 -
Flags: review?(gkrizsanits) → review+
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/693f52e6fb26
Various dump() methods should check browser.dom.window.dump.enabled. r=krizsa
Comment 8•7 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox57:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in
before you can comment on or make changes to this bug.
Description
•