From a6b6114bd02bee7ea6a990703d5c7e513e1146c0 Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Tue, 30 Aug 2016 19:15:34 +0200 Subject: [PATCH] events: make memory leak warning name more verbose Switch from a generic `Warning` to the more specific `MaxListenersExceededWarning`. Ref: https://github.com/nodejs/node/pull/8298 --- doc/api/events.md | 1 + lib/events.js | 2 +- test/parallel/test-event-emitter-max-listeners-warning.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/api/events.md b/doc/api/events.md index 6b19287881c132..f600321b0d35b2 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -285,6 +285,7 @@ The emitted warning can be inspected with [`process.on('warning')`][] and will have the additional `emitter`, `type` and `count` properties, referring to the event emitter instance, the event’s name and the number of attached listeners, respectively. +Its `name` property is set to `'MaxListenersExceededWarning'`. ### emitter.addListener(eventName, listener)