Skip to content

Commit 0a492c7

Browse files
sagirktargos
authored andcommittedNov 28, 2018
test: use arrow function
In `test/parallel/test-child-process-env.js`, callbacks use anonymous closure functions. It is safe to replace them with arrow functions since these callbacks don't contain references to `this`, `super` or `arguments`. This results in shorter functions. PR-URL: #24482 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Rich Trott <[email protected]>
1 parent e5c85ef commit 0a492c7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎test/parallel/test-child-process-env.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ let response = '';
4848

4949
child.stdout.setEncoding('utf8');
5050

51-
child.stdout.on('data', function(chunk) {
51+
child.stdout.on('data', (chunk) => {
5252
console.log(`stdout: ${chunk}`);
5353
response += chunk;
5454
});
5555

56-
process.on('exit', function() {
56+
process.on('exit', () => {
5757
assert.ok(response.includes('HELLO=WORLD'));
5858
assert.ok(response.includes('FOO=BAR'));
5959
assert.ok(!response.includes('UNDEFINED=undefined'));

0 commit comments

Comments
 (0)
Please sign in to comment.