node icon indicating copy to clipboard operation
node copied to clipboard

Behavior of `realpath` with an empty string argument

Open redyetidev opened this issue 7 months ago • 2 comments

Refs: #35403

Currently, the project has 2 outcomes for different realpath functions with empty string arguments:

fs.realpathSync('') // Returns CWD
await util.promisify(fs.realpath)('') // Returns CWD

await fs.promises.realpath('') // ENOENT Error
fs.realpathSync.native('') // ENOENT Error
await util.promisify(fs.realpath.native)('') // ENOENT Error

IMO, this should be standardized to (A) Always throw (B) Always return CWD (C) Return CWD for non-.native calls, throw otherwise

redyetidev avatar Jun 28 '24 21:06 redyetidev