Last Comment Bug 365367 - "@mozilla.org/consolemessage;1" not usable
: "@mozilla.org/consolemessage;1" not usable
Status: RESOLVED FIXED
[mentor=bsmedberg][lang=c++][trivial ...
: helpwanted
Product: Core
Classification: Components
Component: XPCOM (show other bugs)
: Trunk
: x86 Linux
: P3 trivial (vote)
: mozilla22
Assigned To: Carl X. Su
:
: Nathan Froyd [:froydnj]
Mentors:
http://lxr.mozilla.org/seamonkey/sour...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-12-29 13:54 PST by Ben Bucksch (:BenB)
Modified: 2013-03-01 15:50 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
proposed patch (531 bytes, patch)
2013-02-25 11:11 PST, Carl X. Su
benjamin: review+
ben.bucksch: feedback+
Details | Diff | Splinter Review
proposed patch (mq) (743 bytes, patch)
2013-02-28 13:28 PST, Carl X. Su
no flags Details | Diff | Splinter Review

Description Ben Bucksch (:BenB) 2006-12-29 13:54:53 PST
http://lxr.mozilla.org/seamonkey/source/xpcom/base/nsIConsoleMessage.idl#55
#define NS_CONSOLEMESSAGE_CONTRACTID "@mozilla.org/consolemessage;1"

This define is never used, not even to register the class, i.e. misleading.

XPCOM callers wouldn't be able to make use of the object, because the attribute message is readonly and init() does not exist (the C++ code is there, but commented out).
http://lxr.mozilla.org/seamonkey/source/xpcom/base/nsConsoleMessage.cpp#63

So, please either remove the define above, or actually make nsIConsoleMessage instantiatable and settable, so that JavaScript can generate console messages. I'd prefer the latter, given that the more complex nsIScriptError is creatable from JavaScript as well. I ran into the problem when I catched errors from C++ in JS and wanted to log them using Mozilla's logging API, in some JS utility function of my own.
Comment 1 Ben Bucksch (:BenB) 2006-12-29 14:42:21 PST
(In reply to comment #0)
> I'd prefer the latter, given that the more complex nsIScriptError is creatable
> from JavaScript as well. I ran into the problem when I catched errors from C++
> in JS and wanted to log them using Mozilla's logging API, in some JS utility
> function of my own.

Nevermind about that part, I realized I can use Components.utils.reportError().
Comment 2 Carl X. Su 2013-02-25 11:11:35 PST
Created attachment 717983 [details] [diff] [review]
proposed patch

This is my first time to submit a bug.
I need someone to review my patch.
Comment 3 Ben Bucksch (:BenB) 2013-02-25 11:17:53 PST
Comment on attachment 717983 [details] [diff] [review]
proposed patch

Looks good to me

Not used: http://mxr.mozilla.org/comm-central/search?string=NS_CONSOLEMESSAGE_CONTRACTID
Comment 4 Ben Bucksch (:BenB) 2013-02-25 11:20:19 PST
Comment on attachment 717983 [details] [diff] [review]
proposed patch

bsmedberg is listed in whiteboard as mentor, and he's an XPCOM superreviewer, so I'll ask him for review.
Comment 5 Josh Matthews [:jdm] (on vacation until Dec 5) 2013-02-28 12:07:54 PST
Carl, for future reference the steps at https://developer.mozilla.org/en/Creating_a_patch_that_can_be_checked_in should help you create a patch that contains your author information and a commit message. That will allow somebody to commit your patch much easier.
Comment 6 Carl X. Su 2013-02-28 13:28:27 PST
Created attachment 719663 [details] [diff] [review]
proposed patch (mq)

Thank you. I applied this patch with mq again.
Comment 7 Josh Matthews [:jdm] (on vacation until Dec 5) 2013-02-28 14:33:33 PST
I was about to push it with the amended message: Bug 365367 - NS_CONSOLEMESSAGE_CONTRACTID removed because it is never used. r=bsmedberg

But the tree was closed, so it will have to wait. Thanks for the fast turnaround!
Comment 8 Josh Matthews [:jdm] (on vacation until Dec 5) 2013-03-01 06:11:00 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/54d8c9723204
Comment 9 Carl X. Su 2013-03-01 07:06:35 PST
I pushed this patch to try server 1 hr ago.
Should I cancel it?
Comment 10 Josh Matthews [:jdm] (on vacation until Dec 5) 2013-03-01 07:37:34 PST
Yes. I'll do it while your LDAP password problems are sorted out.
Comment 11 Ryan VanderMeulen [:RyanVM] 2013-03-01 15:50:10 PST
https://hg.mozilla.org/mozilla-central/rev/54d8c9723204

Note You need to log in before you can comment on or make changes to this bug.