- Version: v10.15.1 but affects master branch, v12 and so on
- Platform: W7
- Subsystem: HTTP server
Here HTTP server adds a .on wrapper to a socket. But no other listener methods are wrapped so if we call socket.addListener() or socket.prependListener() we'll get other results than if we called socket.on().
'use strict';consthttp=require('http');constsrv=http.createServer();srv.on('connection',(socket)=>{console.log(socket.on===socket.addListener);});
Here HTTP server adds a
.onwrapper to a socket. But no other listener methods are wrapped so if we callsocket.addListener()orsocket.prependListener()we'll get other results than if we calledsocket.on().