Skip to content

Commit fe821fb

Browse files
kemitchellMylesBorins
authored andcommitted
fs: clarify fs.link and fs.linkSync arguments
Updates the argument names `srcpath` and `dstpath` to match the more descriptive `existingPath` and `newPath` in the documentation. PR-URL: #9145 Reviewed-By: Sakthipriyan Vairamani <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]>
1 parent 30f7802 commit fe821fb

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

‎lib/fs.js‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,24 +1056,24 @@ fs.symlinkSync = function(target, path, type){
10561056
type);
10571057
};
10581058

1059-
fs.link=function(srcpath,dstpath,callback){
1059+
fs.link=function(existingPath,newPath,callback){
10601060
callback=makeCallback(callback);
1061-
if(!nullCheck(srcpath,callback))return;
1062-
if(!nullCheck(dstpath,callback))return;
1061+
if(!nullCheck(existingPath,callback))return;
1062+
if(!nullCheck(newPath,callback))return;
10631063

10641064
varreq=newFSReqWrap();
10651065
req.oncomplete=callback;
10661066

1067-
binding.link(pathModule._makeLong(srcpath),
1068-
pathModule._makeLong(dstpath),
1067+
binding.link(pathModule._makeLong(existingPath),
1068+
pathModule._makeLong(newPath),
10691069
req);
10701070
};
10711071

1072-
fs.linkSync=function(srcpath,dstpath){
1073-
nullCheck(srcpath);
1074-
nullCheck(dstpath);
1075-
returnbinding.link(pathModule._makeLong(srcpath),
1076-
pathModule._makeLong(dstpath));
1072+
fs.linkSync=function(existingPath,newPath){
1073+
nullCheck(existingPath);
1074+
nullCheck(newPath);
1075+
returnbinding.link(pathModule._makeLong(existingPath),
1076+
pathModule._makeLong(newPath));
10771077
};
10781078

10791079
fs.unlink=function(path,callback){

0 commit comments

Comments
(0)