tonylukasavage / triple

REPL for Titanium
MIT License
96 stars 21 forks source link

message event listener registration error #99

Open emarteca opened 4 years ago

emarteca commented 4 years ago

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!