★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/0a492c730aNouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files
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 <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 targos committed Nov 28, 2018
1 parent e5c85ef commit 0a492c730ac60fb805c7271abdc51410215ff8ed
Showing with 2 additions and 2 deletions.
  1. +2 −2 test/parallel/test-child-process-env.js
@@ -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'));

0 comments on commit 0a492c7

Please sign in to comment.