Firefox can't remove event, which added with addEventListener(... listener.bind(context))

RESOLVED INVALID

Status

()

Core
DOM: Events
RESOLVED INVALID
4 years ago
4 years ago

People

(Reporter: Yuri Trukhin, Unassigned)

Tracking

25 Branch
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

4 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9) AppleWebKit/537.51.3 (KHTML, like Gecko) Version/7.0 Safari/537.51.3

Steps to reproduce:

document.addEventListener("MyEvent", listener.bind(this));
function listener (e) {
    document.removeEventListener("MyEvent", listener);
    alert("fired");
}

var event = document.createEvent("CustomEvent");
event.initCustomEvent("MyEvent", true, true, {});
document.dispatchEvent(event);
document.dispatchEvent(event);


Actual results:

//Event fired 2 times, event with bonded this can't removed


Expected results:

//Event must be fired 1 time
(Reporter)

Updated

4 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → INVALID

Updated

4 years ago
Resolution: INVALID → FIXED
(Reporter)

Updated

4 years ago
Status: RESOLVED → UNCONFIRMED
Resolution: FIXED → ---
(Reporter)

Updated

4 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago4 years ago
Resolution: --- → INVALID
(Reporter)

Updated

4 years ago
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
(Reporter)

Updated

4 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago4 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.