Browse Source

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: https://github.com/nodejs/node/pull/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>
v7.x
Kyle E. Mitchell 8 years ago
committed by James M Snell
parent
commit
108c1fbbe2
  1. 20
      lib/fs.js

20
lib/fs.js

@ -955,24 +955,24 @@ fs.symlinkSync = function(target, path, type) {
type); type);
}; };
fs.link = function(srcpath, dstpath, callback) { fs.link = function(existingPath, newPath, callback) {
callback = makeCallback(callback); callback = makeCallback(callback);
if (!nullCheck(srcpath, callback)) return; if (!nullCheck(existingPath, callback)) return;
if (!nullCheck(dstpath, callback)) return; if (!nullCheck(newPath, callback)) return;
var req = new FSReqWrap(); var req = new FSReqWrap();
req.oncomplete = callback; req.oncomplete = callback;
binding.link(pathModule._makeLong(srcpath), binding.link(pathModule._makeLong(existingPath),
pathModule._makeLong(dstpath), pathModule._makeLong(newPath),
req); req);
}; };
fs.linkSync = function(srcpath, dstpath) { fs.linkSync = function(existingPath, newPath) {
nullCheck(srcpath); nullCheck(existingPath);
nullCheck(dstpath); nullCheck(newPath);
return binding.link(pathModule._makeLong(srcpath), return binding.link(pathModule._makeLong(existingPath),
pathModule._makeLong(dstpath)); pathModule._makeLong(newPath));
}; };
fs.unlink = function(path, callback) { fs.unlink = function(path, callback) {

Loading…
Cancel
Save