Opened 11 years ago

Last modified 11 years ago

#9831 confirmed Bug

Avoid silent failure when adding one function twice as a listener for the same event

Reported by: Piotrek Koszuliński Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:


Currently events implementation accepts one listener function attached only once to one event on one object. When it's attached twice or more times (even with different context) it's ignored (or overwrite previous one).

To avoid issues like events system should notify when listener is added second time. Perhaps we'll also find more issues like #9800, which will need to be fixed.

Harder way - we can remove this limitation from events system, by adding context as a next key. However:

  • we would also need to change signature of event#removeListener (it'd need to accept context)
  • there still will be a limitation about which developer should be notified by logged errors.

Change History (2)

comment:1 Changed 11 years ago by Piotrek Koszuliński

Status: newconfirmed

Duplicate: #9656.

comment:2 Changed 11 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 4.1
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy