Skip to content

Commit f19dae3

Browse files
sagirkrvagg
authored andcommitted
test: replace anonymous closure functions with arrow functions
In `test/parallel/test-fs-truncate-fd.js`, callbacks use anonymous closure functions. It is safe to replace them with arrow functions since these callbacks don't alter their context (`this`). This results in shorter functions. PR-URL: #24478 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent fbb228b commit f19dae3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎test/parallel/test-fs-truncate-fd.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ const msg = 'Using fs.truncate with a file descriptor is deprecated.' +
1616

1717

1818
common.expectWarning('DeprecationWarning',msg,'DEP0081');
19-
fs.truncate(fd,5,common.mustCall(function(err){
19+
fs.truncate(fd,5,common.mustCall((err)=>{
2020
assert.ok(!err);
2121
assert.strictEqual(fs.readFileSync(filename,'utf8'),'hello');
2222
}));
2323

24-
process.on('exit',function(){
24+
process.on('exit',()=>{
2525
fs.closeSync(fd);
2626
fs.unlinkSync(filename);
2727
console.log('ok');

0 commit comments

Comments
(0)