源码: 复制代码 代码如下: EventEmitter.prototype.listeners = function(type) { var ret; if (!this._events || !this._events[type]) ret = []; else if (util.isFunction(this._events[type])) ret = [this._events[type]]; else ret = this._events[type].slice(); return ret; };