Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: vars to const and let in child_process #8617

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions test/parallel/test-child-process-stdin.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use strict';
var common = require('../common');
var assert = require('assert');
const common = require('../common');
const assert = require('assert');

var spawn = require('child_process').spawn;
const spawn = require('child_process').spawn;

var cat = spawn(common.isWindows ? 'more' : 'cat');
const cat = spawn(common.isWindows ? 'more' : 'cat');
cat.stdin.write('hello');
cat.stdin.write(' ');
cat.stdin.write('world');
Expand All @@ -14,7 +14,7 @@ assert.ok(!cat.stdin.readable);

cat.stdin.end();

var response = '';
let response = '';

cat.stdout.setEncoding('utf8');
cat.stdout.on('data', function(chunk) {
Expand Down
16 changes: 8 additions & 8 deletions test/parallel/test-child-process-stdio-big-write-end.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
require('../common');
var assert = require('assert');
var BUFSIZE = 1024;
const assert = require('assert');
const BUFSIZE = 1024;

switch (process.argv[2]) {
case undefined:
Expand All @@ -13,11 +13,11 @@ switch (process.argv[2]) {
}

function parent() {
var spawn = require('child_process').spawn;
var child = spawn(process.execPath, [__filename, 'child']);
var sent = 0;
const spawn = require('child_process').spawn;
const child = spawn(process.execPath, [__filename, 'child']);
let sent = 0;

var n = '';
let n = '';
child.stdout.setEncoding('ascii');
child.stdout.on('data', function(c) {
n += c;
Expand All @@ -34,7 +34,7 @@ function parent() {
} while (child.stdin.write(buf));

// then write a bunch more times.
for (var i = 0; i < 100; i++) {
for (let i = 0; i < 100; i++) {
const buf = Buffer.alloc(BUFSIZE, '.');
sent += BUFSIZE;
child.stdin.write(buf);
Expand All @@ -47,7 +47,7 @@ function parent() {
}

function child() {
var received = 0;
let received = 0;
process.stdin.on('data', function(c) {
received += c.length;
});
Expand Down
8 changes: 4 additions & 4 deletions test/parallel/test-child-process-stdio.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';
var common = require('../common');
var assert = require('assert');
const common = require('../common');
const assert = require('assert');

var options = {stdio: ['pipe']};
var child = common.spawnPwd(options);
let options = {stdio: ['pipe']};
let child = common.spawnPwd(options);

assert.notEqual(child.stdout, null);
assert.notEqual(child.stderr, null);
Expand Down