Closed Bug 1246842 Opened 8 years ago Closed 8 years ago

once function removes incorrect event listener

Categories

(Core :: Audio/Video: Playback, defect)

46 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla47
Tracking Status
firefox47 --- fixed

People

(Reporter: bryce, Assigned: bryce)

Details

Attachments

(2 files)

While looking through the dom/media/test/manifest.js file I think I may have found an issue with the once function (https://hg.mozilla.org/mozilla-central/file/tip/dom/media/test/manifest.js#l1358).

It appears the function adds an event listener and then removes a different event listener. I believe the event listener removed should be the same one as added.
The once function should add and then remove an event listener after it is
invoked, but it appears to remove another event listener instead. This commit
adjusts that behaviour. Note that the dom/media/mediasource/test/mediasource.js
file has the same pattern and has been updated. This commit reflects using the
same changes to remedy the once function here.

Review commit: https://reviewboard.mozilla.org/r/34123/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/34123/
Attachment #8717308 - Flags: review?(cpearce)
Assignee: nobody → bvandyk
Been thinking about this, and I'm trying a version that uses named functions to avoid using arguments.callee as it seems to be a no no as of ES5.
Comment on attachment 8717308 [details]
MozReview Request: Bug 1246842 - Correct once function to remove correct event listener r?cpearce

https://reviewboard.mozilla.org/r/34123/#review30833
Attachment #8717308 - Flags: review?(cpearce) → review+
Attachment #8717366 - Attachment description: MozReview Request: Bug 1246842 - Rework previous commit to not used deprecated arguments.callee → MozReview Request: Bug 1246842 - Rework previous commit to not used deprecated arguments.callee r?cpearce
Attachment #8717366 - Flags: review?(cpearce)
Comment on attachment 8717366 [details]
MozReview Request: Bug 1246842 - Rework previous commit to not used deprecated arguments.callee r?cpearce

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/34161/diff/1-2/
Attachment #8717366 - Flags: review?(cpearce) → review+
Comment on attachment 8717366 [details]
MozReview Request: Bug 1246842 - Rework previous commit to not used deprecated arguments.callee r?cpearce

https://reviewboard.mozilla.org/r/34161/#review30897
Status: NEW → ASSIGNED
https://hg.mozilla.org/mozilla-central/rev/01d335a5c88d
https://hg.mozilla.org/mozilla-central/rev/4a38b481c111
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: