lint lib/events.js

This commit is contained in:
Iuri Matias 2018-12-21 21:30:21 -05:00
parent 6e1d7e6126
commit 4304ce8bb8
1 changed files with 3 additions and 8 deletions

View File

@ -70,14 +70,11 @@ EventEmitter.prototype.once = function(type, listener) {
};
EventEmitter.prototype.listeners = function(type) {
return typeof this._events[type] === 'function'
? [this._events[type]]
: this._events[type] || [];
return typeof this._events[type] === 'function' ? [this._events[type]] : this._events[type] || [];
};
EventEmitter.prototype._emit = function(type, args) {
var handler = this._events[type]
, ret;
var handler = this._events[type], ret;
// if (type !== 'event') {
// this._emit('event', [type.replace(/^element /, '')].concat(args));
@ -104,9 +101,7 @@ EventEmitter.prototype._emit = function(type, args) {
};
EventEmitter.prototype.emit = function(type) {
var args = slice.call(arguments, 1)
, params = slice.call(arguments)
, el = this;
var args = slice.call(arguments, 1), params = slice.call(arguments), el = this;
this._emit('event', params);