You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 122 and line 125 in lib/incoming.js, on the registration on the registration of the “disconnect” and “message” events.
The reason I believe these are indicative of errors is as follows (from looking at the nodejs child_process API documentation):
The cmd variable, initialized on line 98 by a call to child_process.exec, refers to an object of type ChildProcess; cmd.stdout refers to the stdout field of a ChildProcess, which is a readable stream. However, the “disconnect” and “message” events are emitted on type ChildProcess.
My guess is that the code should instead be
cmd.on(“disconnect”, …) and
cmd.on(“message”, …).
Thanks!
The text was updated successfully, but these errors were encountered:
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 122 and line 125 in lib/incoming.js, on the registration on the registration of the “disconnect” and “message” events.
The reason I believe these are indicative of errors is as follows (from looking at the nodejs child_process API documentation):
The cmd variable, initialized on line 98 by a call to child_process.exec, refers to an object of type ChildProcess; cmd.stdout refers to the stdout field of a ChildProcess, which is a readable stream. However, the “disconnect” and “message” events are emitted on type ChildProcess.
My guess is that the code should instead be
cmd.on(“disconnect”, …) and
cmd.on(“message”, …).
Thanks!
The text was updated successfully, but these errors were encountered: