diff options
Diffstat (limited to 'js')
| -rw-r--r-- | js/cheesesteak.js | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/js/cheesesteak.js b/js/cheesesteak.js index 1957aad..709d446 100644 --- a/js/cheesesteak.js +++ b/js/cheesesteak.js @@ -8,19 +8,13 @@ this._events[evt].push(fn); }; EventEmitter.prototype.off = function(evt, fn) { - if (!this.hasOwnProperty('_events')) { - return; - } - if (evt in this._events === false) { + if (!this.hasOwnProperty('_events') || evt in this._events === false) { return; } this._events[evt].splice(this._events[evt].indexOf(fn), 1); }; EventEmitter.prototype.emit = function(evt) { - if (!this.hasOwnProperty('_events')) { - return; - } - if (evt in this._events === false) { + if (!this.hasOwnProperty('_events') || evt in this._events === false) { return; } |
