Closed Bug 365367 Opened 18 years ago Closed 11 years ago

"@mozilla.org/consolemessage;1" not usable

Categories

(Core :: XPCOM, defect, P3)

x86
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: BenB, Assigned: carl)

References

()

Details

(Keywords: helpwanted, Whiteboard: [mentor=bsmedberg][lang=c++][trivial code removal])

Attachments

(1 file, 1 obsolete file)

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.
(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().
Severity: normal → trivial
Keywords: helpwanted
Priority: -- → P3
Whiteboard: [mentor=bsmedberg][lang=c++][trivial code removal]
Assignee: nobody → bcbcarl
Attached patch proposed patch (obsolete) — Splinter Review
This is my first time to submit a bug.
I need someone to review my patch.
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.
Attachment #717983 - Flags: review?(benjamin)
Attachment #717983 - Flags: review?(benjamin) → review+
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.
Thank you. I applied this patch with mq again.
Attachment #717983 - Attachment is obsolete: true
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!
I pushed this patch to try server 1 hr ago.
Should I cancel it?
Yes. I'll do it while your LDAP password problems are sorted out.
https://hg.mozilla.org/mozilla-central/rev/54d8c9723204
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: