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 <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
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

+2-2
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)