Skip to content

Commit

Permalink
test: use arrow function
Browse files Browse the repository at this point in the history
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 <jasnell@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
sagirk authored and gireeshpunathil committed Nov 28, 2018
1 parent b02cac5 commit 484ad3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-child-process-env.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ let response = '';

child.stdout.setEncoding('utf8');

child.stdout.on('data', function(chunk) {
child.stdout.on('data', (chunk) => {
console.log(`stdout: ${chunk}`);
response += chunk;
});

process.on('exit', function() {
process.on('exit', () => {
assert.ok(response.includes('HELLO=WORLD'));
assert.ok(response.includes('FOO=BAR'));
assert.ok(!response.includes('UNDEFINED=undefined'));
Expand Down

0 comments on commit 484ad3b

Please sign in to comment.