Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7920e7b

Browse filesBrowse files
sagirkcodebytere
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 283a6b8 commit 7920e7b
Copy full SHA for 7920e7b

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: test/parallel/test-fs-truncate-fd.js
+2-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.