Skip to content

Commit ec79232

Browse files
author
Jungku Lee
authored
fs: fix to not return for void function
PR-URL: #50769 Reviewed-By: Matthew Aitken <maitken033380023@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Qingyu Deng <i@ayase-lab.com>
1 parent 6dbf678 commit ec79232

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

lib/fs.js

+13-11
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ function close(fd, callback = defaultCloseCallback) {
530530
function closeSync(fd) {
531531
fd = getValidatedFd(fd);
532532

533-
return binding.close(fd);
533+
binding.close(fd);
534534
}
535535

536536
/**
@@ -782,7 +782,7 @@ function readv(fd, buffers, position, callback) {
782782
if (typeof position !== 'number')
783783
position = null;
784784

785-
return binding.readBuffers(fd, buffers, position, req);
785+
binding.readBuffers(fd, buffers, position, req);
786786
}
787787

788788
ObjectDefineProperty(readv, kCustomPromisifyArgsSymbol,
@@ -858,7 +858,8 @@ function write(fd, buffer, offsetOrOptions, length, position, callback) {
858858

859859
const req = new FSReqCallback();
860860
req.oncomplete = wrapper;
861-
return binding.writeBuffer(fd, buffer, offset, length, position, req);
861+
binding.writeBuffer(fd, buffer, offset, length, position, req);
862+
return;
862863
}
863864

864865
validateStringAfterArrayBufferView(buffer, 'buffer');
@@ -879,7 +880,7 @@ function write(fd, buffer, offsetOrOptions, length, position, callback) {
879880

880881
const req = new FSReqCallback();
881882
req.oncomplete = wrapper;
882-
return binding.writeString(fd, str, offset, length, req);
883+
binding.writeString(fd, str, offset, length, req);
883884
}
884885

885886
ObjectDefineProperty(write, kCustomPromisifyArgsSymbol,
@@ -969,7 +970,7 @@ function writev(fd, buffers, position, callback) {
969970
if (typeof position !== 'number')
970971
position = null;
971972

972-
return binding.writeBuffers(fd, buffers, position, req);
973+
binding.writeBuffers(fd, buffers, position, req);
973974
}
974975

975976
ObjectDefineProperty(writev, kCustomPromisifyArgsSymbol, {
@@ -1175,7 +1176,8 @@ function rmdir(path, options, callback) {
11751176
if (err === false) {
11761177
const req = new FSReqCallback();
11771178
req.oncomplete = callback;
1178-
return binding.rmdir(path, req);
1179+
binding.rmdir(path, req);
1180+
return;
11791181
}
11801182
if (err) {
11811183
return callback(err);
@@ -1188,7 +1190,7 @@ function rmdir(path, options, callback) {
11881190
validateRmdirOptions(options);
11891191
const req = new FSReqCallback();
11901192
req.oncomplete = callback;
1191-
return binding.rmdir(path, req);
1193+
binding.rmdir(path, req);
11921194
}
11931195
}
11941196

@@ -1294,7 +1296,7 @@ function fdatasync(fd, callback) {
12941296
*/
12951297
function fdatasyncSync(fd) {
12961298
fd = getValidatedFd(fd);
1297-
return binding.fdatasync(fd);
1299+
binding.fdatasync(fd);
12981300
}
12991301

13001302
/**
@@ -1319,7 +1321,7 @@ function fsync(fd, callback) {
13191321
*/
13201322
function fsyncSync(fd) {
13211323
fd = getValidatedFd(fd);
1322-
return binding.fsync(fd);
1324+
binding.fsync(fd);
13231325
}
13241326

13251327
/**
@@ -1877,7 +1879,7 @@ function unlink(path, callback) {
18771879
*/
18781880
function unlinkSync(path) {
18791881
path = pathModule.toNamespacedPath(getValidatedPath(path));
1880-
return binding.unlink(path);
1882+
binding.unlink(path);
18811883
}
18821884

18831885
/**
@@ -2921,7 +2923,7 @@ realpath.native = (path, options, callback) => {
29212923
path = getValidatedPath(path);
29222924
const req = new FSReqCallback();
29232925
req.oncomplete = callback;
2924-
return binding.realpath(pathModule.toNamespacedPath(path), options.encoding, req);
2926+
binding.realpath(pathModule.toNamespacedPath(path), options.encoding, req);
29252927
};
29262928

29272929
/**

0 commit comments

Comments
 (0)