Skip to content

Commit

Permalink
Rename to eventNames()
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell committed Mar 12, 2016
1 parent e9b1ea9 commit 1d173c6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions doc/api/events.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ they were registered, passing the supplied arguments to each.

Returns `true` if event had listeners, `false` otherwise.

### emitter.eventsList()
### emitter.eventNames()

Returns an array listing the events for which the emitter has registered
listeners.
Expand All @@ -305,7 +305,7 @@ const EventEmitter = require('events');
const myEE = new EventEmitter();
myEE.on('foo', () => {});
myEE.on('bar', () => {});
console.log(myErr.listEvents());
console.log(myErr.eventNames());
// Prints ['foo', 'bar']
```

Expand Down
2 changes: 1 addition & 1 deletion lib/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ function listenerCount(type) {
return 0;
}

EventEmitter.prototype.listEvents = function() {
EventEmitter.prototype.eventNames = function() {
const events = this._events;
if (events) {
return Object.getOwnPropertyNames(events).concat(
Expand Down

0 comments on commit 1d173c6

Please sign in to comment.