Reid Burke
c9a1b5d162
Fix #3425 : removeAllListeners should delete array
...
When removeAllListeners is called, the listeners array
is deleted to maintain compatibility with v0.6.
Reverts "events: don't delete the listeners array"
This reverts commit 78dc13fbf9
.
Conflicts:
test/simple/test-event-emitter-remove-all-listeners.js
2012-06-14 17:26:50 -07:00
Ben Noordhuis
761a82bc9a
test: make .removeAllListeners() test more exhaustive
...
Also test removal of multiple listeners, it's a separate code path.
2012-03-16 00:25:42 +01:00
Ben Noordhuis
78dc13fbf9
events: don't delete the listeners array
...
The documentation implies that .removeAllListeners() leaves the listeners array
untouched. Make it so.
2012-03-16 00:20:10 +01:00
Ben Noordhuis
018e110cd1
test: replace .addListener() calls with .on()
2011-10-15 01:08:36 +02:00
Felix Geisendörfer
bc8489580c
Allow to remove all EventEmitter listeners at once
...
This patch adds support for calling EventEmitter#removeAllListeners
with no parameters in order to remove all listeners as once.
See discussion: https://groups.google.com/forum/#!topic/nodejs-dev/Mcyal1ThTHY
Closes GH-889.
2011-04-12 14:47:16 -07:00