martynsmith / node-irc

NodeJS IRC client library
GNU General Public License v3.0
1.33k stars 424 forks source link

Get EventEmitter correctly #521

Open HebaruSan opened 6 years ago

HebaruSan commented 6 years ago

atom-irc is erroring out currently at this line:

util.inherits(Client, EventEmitter);

TypeError: The super constructor to "inherits" must not be null or undefined

The documentation for inherits says that the "super constructor" is the second parameter, so this error implies that EventEmitter is null or undefined. I checked the documentation, and it says:

const EventEmitter = require('events');

But node-irc currently does this instead:

var EventEmitter = require('events').EventEmitter;

If I remove the trailing .EventEmitter as in this pull request, the error in atom-irc is resolved.

Jmots2 commented 6 years ago

Was fixed at one time earlier; apparent proper fix: #281

https://github.com/martynsmith/node-irc/commit/0fd26a791710ff343815e6dc8e362e532fa40588