From 2318c7fea3fbea300f2a061d31c4b8e32fa3213c Mon Sep 17 00:00:00 2001 From: sagirk Date: Mon, 19 Nov 2018 15:11:13 +0530 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/24482 Reviewed-By: James M Snell Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Gireesh Punathil Reviewed-By: Ruben Bridgewater Reviewed-By: Rich Trott --- test/parallel/test-child-process-env.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-child-process-env.js b/test/parallel/test-child-process-env.js index 2eec658872518a..1e398ff26afee9 100644 --- a/test/parallel/test-child-process-env.js +++ b/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'));