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.
  • Loading branch information
sagirk committed Nov 19, 2018
1 parent 9801eb9 commit 905d538
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 905d538

Please sign in to comment.