dojo / core

:rocket: Dojo 2 - language helpers and utilities.
http://dojo.io
Other
213 stars 62 forks source link

Evented listener destroying its own handle won't run all listeners #407

Closed bryanforbes closed 6 years ago

bryanforbes commented 6 years ago

Bug

Package Version: 2.0.0

Code

const e = new Evented();
e.on('foo', () => console.log(1));
const h = e.on('foo', () => { console.log(2); h.destroy(); });
e.on('foo', () => console.log(3));
e.emit({ type: 'foo' });

Expected behavior:

Logs 1, 2, and 3

Actual behavior:

Logs 1 and 2, but not 3