Closed
Bug 786509
Opened 13 years ago
Closed 13 years ago
Remove broken, unused wildcard support from dbg-client.jsm's eventSource mixin
Categories
(DevTools :: Debugger, defect)
DevTools
Debugger
Tracking
(Not tracked)
RESOLVED
FIXED
Firefox 18
People
(Reporter: jimb, Assigned: jimb)
Details
Attachments
(1 file, 1 obsolete file)
1.86 KB,
patch
|
past
:
review+
|
Details | Diff | Splinter Review |
The support for wildcard event listeners is unused, and has never worked. The code to fire wildcard event listeners reads:
if (this._listeners['*']) {
listeners.concat(this._listeners['*']);
}
However, Array.prototype.concat does not mutate 'this'; it returns a fresh array. So the wildcard listeners have never been called. The code has always read this way.
Since it's unused, I suggest we just take it out. It's easy enough to add back if we need it.
Attachment #656276 -
Flags: review?(past)
Assignee | ||
Comment 1•13 years ago
|
||
The patch also removes code to make addListener return without doing anything if the handler given is not a function. Since it's simply not correct to pass a non-function as the second argument, it seems to me this should either throw immediately, or at least let an error occur when we try to dispatch the event.
Assignee | ||
Comment 2•13 years ago
|
||
Throw immediately given a non-function listener. Fix the other comment suggesting that a null event name is meaningful.
Assignee: nobody → jimb
Attachment #656276 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #656276 -
Flags: review?(past)
Attachment #656279 -
Flags: review?(past)
Assignee | ||
Comment 3•13 years ago
|
||
Comment 4•13 years ago
|
||
Comment on attachment 656279 [details] [diff] [review]
Remove support for wildcard event listeners from dbg-client.jsm's eventSource.
Review of attachment 656279 [details] [diff] [review]:
-----------------------------------------------------------------
Yes, agreed on all counts.
Attachment #656279 -
Flags: review?(past) → review+
Assignee | ||
Comment 5•13 years ago
|
||
Flags: in-testsuite-
Target Milestone: --- → Firefox 18
Comment 6•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Updated•7 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•