lib: bind functions on EventEmitter
Further modifications from #27325
bind some functions on EventEmitter
so that we no need to change two functions at the same time.
for example:
before
Socket.prototype.on = function(){};
Socket.prototype.addListener = Socket.prototype.on;
now only need to code one line
Socket.prototype.on = function(){};
// or
Socket.prototype.addListener = function(){};
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
commit message follows commit guidelines