Skip to content

Commit

Permalink
fs: clarify fs.link and fs.linkSync arguments
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
kemitchell authored and jasnell committed Oct 21, 2016
1 parent 6f7cdf7 commit e8fadd8
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -955,24 +955,24 @@ fs.symlinkSync = function(target, path, type) {
type);
};

fs.link = function(srcpath, dstpath, callback) {
fs.link = function(existingPath, newPath, callback) {
callback = makeCallback(callback);
if (!nullCheck(srcpath, callback)) return;
if (!nullCheck(dstpath, callback)) return;
if (!nullCheck(existingPath, callback)) return;
if (!nullCheck(newPath, callback)) return;

var req = new FSReqWrap();
req.oncomplete = callback;

binding.link(pathModule._makeLong(srcpath),
pathModule._makeLong(dstpath),
binding.link(pathModule._makeLong(existingPath),
pathModule._makeLong(newPath),
req);
};

fs.linkSync = function(srcpath, dstpath) {
nullCheck(srcpath);
nullCheck(dstpath);
return binding.link(pathModule._makeLong(srcpath),
pathModule._makeLong(dstpath));
fs.linkSync = function(existingPath, newPath) {
nullCheck(existingPath);
nullCheck(newPath);
return binding.link(pathModule._makeLong(existingPath),
pathModule._makeLong(newPath));
};

fs.unlink = function(path, callback) {
Expand Down

0 comments on commit e8fadd8

Please sign in to comment.