From 71343b6caab29dc6b9f3cf02a6f9aa5e59fb11dd Mon Sep 17 00:00:00 2001 From: cjihrig Date: Thu, 18 Aug 2016 13:38:53 -0400 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/8164 Reviewed-By: James M Snell Reviewed-By: Claudio Rodriguez Reviewed-By: Santiago Gimeno --- lib/internal/child_process.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/child_process.js b/lib/internal/child_process.js index 3582383ad1..f2d961ee06 100644 --- a/lib/internal/child_process.js +++ b/lib/internal/child_process.js @@ -87,7 +87,7 @@ const handleConversion = { // remove handle from socket object, it will be closed when the socket // will be sent if (!options.keepOpen) { - handle.onread = function() {}; + handle.onread = nop; socket._handle = null; }