Skip to content

Commit 45b2bb0

Browse files
Jungku LeeRafaelGSS
authored andcommitted
fs: fix to not return for void function
PR-URL: #50769 Reviewed-By: Matthew Aitken <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Qingyu Deng <[email protected]>
1 parent fd9195d commit 45b2bb0

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

‎lib/fs.js‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ function close(fd, callback = defaultCloseCallback){
530530
functioncloseSync(fd){
531531
fd=getValidatedFd(fd);
532532

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

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

785-
returnbinding.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
constreq=newFSReqCallback();
860860
req.oncomplete=wrapper;
861-
returnbinding.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
constreq=newFSReqCallback();
881882
req.oncomplete=wrapper;
882-
returnbinding.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(typeofposition!=='number')
970971
position=null;
971972

972-
returnbinding.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
constreq=newFSReqCallback();
11771178
req.oncomplete=callback;
1178-
returnbinding.rmdir(path,req);
1179+
binding.rmdir(path,req);
1180+
return;
11791181
}
11801182
if(err){
11811183
returncallback(err);
@@ -1188,7 +1190,7 @@ function rmdir(path, options, callback){
11881190
validateRmdirOptions(options);
11891191
constreq=newFSReqCallback();
11901192
req.oncomplete=callback;
1191-
returnbinding.rmdir(path,req);
1193+
binding.rmdir(path,req);
11921194
}
11931195
}
11941196

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

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

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

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

29272929
/**

0 commit comments

Comments
(0)