From c73256460db750f8bedfa90f4e06a94e5bee9d51 Mon Sep 17 00:00:00 2001 From: dnlup Date: Fri, 20 Dec 2019 17:01:49 +0100 Subject: [PATCH] benchmark: use let instead of var in child_process PR-URL: https://github.com/nodejs/node/pull/31043 Reviewed-By: Rich Trott Reviewed-By: Ruben Bridgewater --- benchmark/child_process/child-process-exec-stdout.js | 2 +- benchmark/child_process/child-process-read-ipc.js | 2 +- benchmark/child_process/child-process-read.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmark/child_process/child-process-exec-stdout.js b/benchmark/child_process/child-process-exec-stdout.js index a1dc4aa04c72a9..f750e2cf3e68f2 100644 --- a/benchmark/child_process/child-process-exec-stdout.js +++ b/benchmark/child_process/child-process-exec-stdout.js @@ -19,7 +19,7 @@ function childProcessExecStdout({ dur, len }) { const cmd = `yes "${'.'.repeat(len)}"`; const child = exec(cmd, { 'stdio': ['ignore', 'pipe', 'ignore'] }); - var bytes = 0; + let bytes = 0; child.stdout.on('data', (msg) => { bytes += msg.length; }); diff --git a/benchmark/child_process/child-process-read-ipc.js b/benchmark/child_process/child-process-read-ipc.js index a9e9cdf7fd7914..827f75b1e54bd1 100644 --- a/benchmark/child_process/child-process-read-ipc.js +++ b/benchmark/child_process/child-process-read-ipc.js @@ -26,7 +26,7 @@ if (process.argv[2] === 'child') { const child = spawn(process.argv[0], [process.argv[1], 'child', len], options); - var bytes = 0; + let bytes = 0; child.on('message', (msg) => { bytes += msg.length; }); setTimeout(() => { diff --git a/benchmark/child_process/child-process-read.js b/benchmark/child_process/child-process-read.js index 3c0144116f589f..01e9846be22b56 100644 --- a/benchmark/child_process/child-process-read.js +++ b/benchmark/child_process/child-process-read.js @@ -24,7 +24,7 @@ function main({ dur, len }) { const options = { 'stdio': ['ignore', 'pipe', 'ignore'] }; const child = child_process.spawn('yes', [msg], options); - var bytes = 0; + let bytes = 0; child.stdout.on('data', (msg) => { bytes += msg.length; });