Skip to content

Commit e8fadd8

Browse files
kemitchelljasnell
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 <thechargingvolcano@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
1 parent 6f7cdf7 commit e8fadd8

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
@@ -955,24 +955,24 @@ fs.symlinkSync = function(target, path, type) {
955955
type);
956956
};
957957

958-
fs.link = function(srcpath, dstpath, callback) {
958+
fs.link = function(existingPath, newPath, callback) {
959959
callback = makeCallback(callback);
960-
if (!nullCheck(srcpath, callback)) return;
961-
if (!nullCheck(dstpath, callback)) return;
960+
if (!nullCheck(existingPath, callback)) return;
961+
if (!nullCheck(newPath, callback)) return;
962962

963963
var req = new FSReqWrap();
964964
req.oncomplete = callback;
965965

966-
binding.link(pathModule._makeLong(srcpath),
967-
pathModule._makeLong(dstpath),
966+
binding.link(pathModule._makeLong(existingPath),
967+
pathModule._makeLong(newPath),
968968
req);
969969
};
970970

971-
fs.linkSync = function(srcpath, dstpath) {
972-
nullCheck(srcpath);
973-
nullCheck(dstpath);
974-
return binding.link(pathModule._makeLong(srcpath),
975-
pathModule._makeLong(dstpath));
971+
fs.linkSync = function(existingPath, newPath) {
972+
nullCheck(existingPath);
973+
nullCheck(newPath);
974+
return binding.link(pathModule._makeLong(existingPath),
975+
pathModule._makeLong(newPath));
976976
};
977977

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

0 commit comments

Comments
 (0)