Closed Bug 616743 Opened 14 years ago Closed 14 years ago

widget's "message" event listeners are passed widget and message, while other APIs' "message" listeners are passed only message

Categories

(Add-on SDK Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: adw, Unassigned)

Details

widget's "message" event listeners are passed both the widget and message, while other APIs' "message" listeners are passed only the message.  (These other APIs rely on Worker for message events, but widget doesn't.)  Seems like all message listeners should be consistent.

Being passed the object that emitted the event is probably convenient, so I'd say all message listeners should work like widget's, although it may be difficult to make Worker work that way, I don't know.  Being passed the object that emitted the event is also consistent with many (all?) of the other types of events, like widget's "click", panel's "show", etc.
Indeed.  Note also bug 593921.  I'm reviewing all the addon-kit APIs that emit events right now and working on a proposal to make them behave consistently.
Cool.  I can stop doing that then! :D

Actually a couple of other things I noticed: 1) page-mod's "attach" listeners get the page mod as their second arg, but other APIs seems to pass the emitters as the first arg. 2) page-worker documents the "error" event, which is part of the Worker API, but no other Worker-using APIs do.
The inconsistency described in comment 0 (and comment 2 point 1) doesn't exist anymore since bug 593921 was resolved.  Resolving invalid.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.