Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
events: use null assignment instead of deleting property
Browse files Browse the repository at this point in the history
  • Loading branch information
tricknotes authored and bnoordhuis committed Dec 10, 2012
1 parent 3c293ba commit 0397223
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,15 +226,15 @@ 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);
}
} 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);
Expand Down

0 comments on commit 0397223

Please sign in to comment.