chore: Using "listenerCount" instead of "listeners" (#1184)

master
Grand 2018-04-27 23:48:51 +08:00 committed by Yiyu He
parent 45464b5174
commit 45903f228a
1 changed files with 1 additions and 1 deletions

View File

@ -125,7 +125,7 @@ module.exports = class Application extends Emitter {
callback() {
const fn = compose(this.middleware);
if (!this.listeners('error').length) this.on('error', this.onerror);
if (!this.listenerCount('error')) this.on('error', this.onerror);
const handleRequest = (req, res) => {
const ctx = this.createContext(req, res);