chore: Using "listenerCount" instead of "listeners" (#1184)
This commit is contained in:
parent
45464b5174
commit
45903f228a
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue