Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

fix(event): fix #836, handle event callback call removeEventListener case #839

Merged
merged 1 commit into from
Jul 14, 2017

Conversation

JiaLiPassion
Copy link
Collaborator

fix #836.

  1. The case can be described as,
const listener1 = function() {
    button.removeEventListener('click', listener1);
};
const listener2 = function() {
};

button.addEventListener('click', listener1);
button.addEventListener('click', listener2);

button.dispatchEvent(clickEvent);

in listener1, the listener will remove itself. so in the current implementation, listener2 will not be invoked because tasks.length was reduced.

  1. add test cases for similar cases, for example, in listener1, it will not remove itself, but remove other listener such as listener2.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zone.js v0.8.13 completely brakes down Angular v4.2.6 with NO errors!!!
3 participants