lint lib/events.js
This commit is contained in:
parent
6e1d7e6126
commit
4304ce8bb8
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue