Skip to content

Commit

Permalink
test: replace anonymous closure functions with arrow functions
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
sagirk authored and codebytere committed Jan 13, 2019
1 parent 1f5a5a7 commit d987701
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-fs-truncate-fd.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ const msg = 'Using fs.truncate with a file descriptor is deprecated.' +


common.expectWarning('DeprecationWarning', msg, 'DEP0081');
fs.truncate(fd, 5, common.mustCall(function(err) {
fs.truncate(fd, 5, common.mustCall((err) => {
assert.ok(!err);
assert.strictEqual(fs.readFileSync(filename, 'utf8'), 'hello');
}));

process.on('exit', function() {
process.on('exit', () => {
fs.closeSync(fd);
fs.unlinkSync(filename);
console.log('ok');
Expand Down

0 comments on commit d987701

Please sign in to comment.