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) {
|
EventEmitter.prototype.listeners = function(type) {
|
||||||
return typeof this._events[type] === 'function'
|
return typeof this._events[type] === 'function' ? [this._events[type]] : this._events[type] || [];
|
||||||
? [this._events[type]]
|
|
||||||
: this._events[type] || [];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
EventEmitter.prototype._emit = function(type, args) {
|
EventEmitter.prototype._emit = function(type, args) {
|
||||||
var handler = this._events[type]
|
var handler = this._events[type], ret;
|
||||||
, ret;
|
|
||||||
|
|
||||||
// if (type !== 'event') {
|
// if (type !== 'event') {
|
||||||
// this._emit('event', [type.replace(/^element /, '')].concat(args));
|
// this._emit('event', [type.replace(/^element /, '')].concat(args));
|
||||||
|
@ -104,9 +101,7 @@ EventEmitter.prototype._emit = function(type, args) {
|
||||||
};
|
};
|
||||||
|
|
||||||
EventEmitter.prototype.emit = function(type) {
|
EventEmitter.prototype.emit = function(type) {
|
||||||
var args = slice.call(arguments, 1)
|
var args = slice.call(arguments, 1), params = slice.call(arguments), el = this;
|
||||||
, params = slice.call(arguments)
|
|
||||||
, el = this;
|
|
||||||
|
|
||||||
this._emit('event', params);
|
this._emit('event', params);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue