diff --git a/lib/internal/fs/utils.js b/lib/internal/fs/utils.js index 619e7c54f7e4be..842c5266c6f677 100644 --- a/lib/internal/fs/utils.js +++ b/lib/internal/fs/utils.js @@ -652,7 +652,7 @@ const getValidatedPath = hideStackFrames((fileURLOrPath, propName = 'path') => { const getValidatedFd = hideStackFrames((fd, propName = 'fd') => { if (ObjectIs(fd, -0)) { - fd = 0; + return 0; } validateInt32(fd, propName, 0);