Hi all, I've been working on a tool to identify instances of events registered to the wrong object in uses of some JavaScript event-driven APIs, as part of a research project.
The tool flagged line 90 in lib/server.js, on the registration of the listener for message.
The reason I believe this is an error is as follows (from looking at the nodejs net API documentation):
the listener for message is registered on the server variable.
This was created by the call to net.createServer; and this returns an object of type net.Server.
message is not an event on net.Server.
My guess is that this might be supposed to be a listener to the listening event on net.Server, but I'm not sure.
Thanks!
Hi all, I've been working on a tool to identify instances of events registered to the wrong object in uses of some JavaScript event-driven APIs, as part of a research project.
The tool flagged line 90 in lib/server.js, on the registration of the listener for
message.The reason I believe this is an error is as follows (from looking at the nodejs net API documentation):
the listener for
messageis registered on theservervariable.This was created by the call to
net.createServer; and this returns an object of type net.Server.messageis not an event on net.Server.My guess is that this might be supposed to be a listener to the
listeningevent on net.Server, but I'm not sure.Thanks!