joyent/node — pull request #3753 by paulmillr (2012-07-22 16:17:49+00:00)
Title: Prohibit same listeners in EventEmitter. Closes #964.

`EventEmitter` currently allows to register same listeners on same type more than once.

1. The behavior isn't useful.
2. It contradicts with browsers implementation of `EventTarget` / `EventDispatcher`.
3. It makes easy to introduce stupid bugs that are hard to catch.

The code spawned three messages on <0.9.x and will spawn only one with my patch.

```javascript
const emitter = new (require('events').EventEmitter);
const log = function() {console.log('Hello')};
emitter.on('message', log);
emitter.on('message', log);
emitter.on('message', log);
emitter.emit('message');
```