Previously, each listener function had a private _on property which recorded whether the listener was enabled; this was set to false when the listener was removed. (This is necessary because of the copy-on-write semantics when the array of listeners is modified while events are being dispatched.) If the listener was registered for multiple event types ("foo" and "bar") then removing the listener for any type would disable it for all types. The fix is to wrap the listener in an object. This also has better encapsulation since the state is kept private.