benchmark: use let instead of var in child_process

PR-URL: https://github.com/nodejs/node/pull/31043
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
dnlup 2019-12-20 17:01:49 +01:00 committed by Ruben Bridgewater
parent 1bc7a50fdd
commit 3885e157fa
No known key found for this signature in database
GPG Key ID: F07496B3EB3C1762
3 changed files with 3 additions and 3 deletions

View File

@ -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;
});

View File

@ -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(() => {

View File

@ -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;
});