Skip to content

Commit 71343b6

Browse files
cjihrigevanlucas
authored andcommitted
child_process: reuse existing no-op function
The internal/child_process module has an existing no-op function. This commit utilizes that function, instead of creating extraneous closures. PR-URL: #8164 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Claudio Rodriguez <cjrodr@yahoo.com> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
1 parent 498238f commit 71343b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/internal/child_process.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ const handleConversion = {
8787
// remove handle from socket object, it will be closed when the socket
8888
// will be sent
8989
if (!options.keepOpen) {
90-
handle.onread = function() {};
90+
handle.onread = nop;
9191
socket._handle = null;
9292
}
9393

0 commit comments

Comments
 (0)