Closed
Bug 382621
Opened 17 years ago
Closed 17 years ago
don't include /toolkit/components/url-classifier/content/moz/debug.js by default
Categories
(Toolkit :: Safe Browsing, defect)
Toolkit
Safe Browsing
Tracking
()
RESOLVED
FIXED
People
(Reporter: zeniko, Assigned: zeniko)
References
Details
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
Details | Diff | Splinter Review |
... or replace it with minimal stubs for non-debug builds.
Updated•17 years ago
|
Summary: don't include /toolkit/components/url-classifier/content/moz/debug.js per default → don't include /toolkit/components/url-classifier/content/moz/debug.js by default
Assignee | ||
Comment 1•17 years ago
|
||
For reference: The following method stubs would have to be provided:
function G_Debug() { }
function G_Assert() { }
function G_Error() { }
var G_debugService = { __noSuchMethod__: function() { } };
Additionally String.prototype.subs (from moz/lang.js) seems not to be used outside of debug.js and should thus also be moved there and G_AssertEqual can be dropped completely.
Assignee | ||
Comment 2•17 years ago
|
||
Is this debug component still used at all? If so, we might want to remove all references to G_GDEBUG and instead introduce a new preprocessor symbol for enabling the full debug.js version. Otherwise we might want to go through the code and remove all occurrences of the now stubbed methods. Both to happen in a follow up bug, of course.
Assignee | ||
Comment 3•17 years ago
|
||
Attachment #267070 -
Attachment is obsolete: true
Attachment #267106 -
Flags: review?(tony)
Attachment #267070 -
Flags: review?(tony)
Updated•17 years ago
|
Attachment #267106 -
Flags: review?(tony) → review+
Comment 4•17 years ago
|
||
I often set G_GDEBUG to true in nsUrlClassifierLib.js and use the debug service. It would be nice if there were something like pr_log for javascript where you can turn specific classes of debug messages on and off.
Comment 5•17 years ago
|
||
I removed the console service listener because it causes crashes.
Attachment #267106 -
Attachment is obsolete: true
Comment 6•17 years ago
|
||
on trunk
Checking in toolkit/components/url-classifier/content/moz/debug.js;
/cvsroot/mozilla/toolkit/components/url-classifier/content/moz/debug.js,v <-- debug.js
new revision: 1.6; previous revision: 1.5
done
Checking in toolkit/components/url-classifier/content/moz/lang.js;
/cvsroot/mozilla/toolkit/components/url-classifier/content/moz/lang.js,v <-- lang.js
new revision: 1.4; previous revision: 1.3
done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 7•17 years ago
|
||
Further alternatives coming to mind: (1) use a JavaScript module (the new .jsm thingy) to load debugging stubs - and for real debugging you just have to override the .jsm with the full fledged version; (2) use a pref (e.g. toolkit.url-classifier.debugging) and define the full fledged version or stubs conditional on that (only if DEBUG is defined though). Both would allow to get rid of G_GDEBUG without making life any harder for you.
OTOH with the current patch here, most G_GDEBUG instances are ifdef'd out anyway, so we could just as well leave it as is.
Comment 8•17 years ago
|
||
The current version can be controlled by prefs, but is also controlled by code (the enabled/disable zone stuff). Some things are enabled by default by the code. So if we wanted to do (2), we could disable all the zones by default and only let prefs turn on the output.
Updated•10 years ago
|
Product: Firefox → Toolkit
You need to log in
before you can comment on or make changes to this bug.
Description
•