Browse Source

events: use null assignment instead of deleting property

v0.9.4-release
Ryunosuke SATO 12 years ago
committed by Ben Noordhuis
parent
commit
0397223ab4
  1. 4
      lib/events.js

4
lib/events.js

@ -226,7 +226,7 @@ EventEmitter.prototype.removeListener = function(type, listener) {
if (position < 0) return this;
list.splice(position, 1);
if (list.length == 0)
delete this._events[type];
this._events[type] = null;
if (this._events.removeListener) {
this.emit('removeListener', type, listener);
@ -234,7 +234,7 @@ EventEmitter.prototype.removeListener = function(type, listener) {
} else if (list === listener ||
(list.listener && list.listener === listener))
{
delete this._events[type];
this._events[type] = null;
if (this._events.removeListener) {
this.emit('removeListener', type, listener);

Loading…
Cancel
Save