diff --git a/lib/internal/fs/promises.js b/lib/internal/fs/promises.js index 0f1db035629c42..1e9573d0385fd0 100644 --- a/lib/internal/fs/promises.js +++ b/lib/internal/fs/promises.js @@ -670,7 +670,7 @@ async function read(handle, bufferOrParams, offset, length, position) { validateInteger(offset, 'offset', 0); } - length = length ?? buffer.byteLength - offset; + length ??= buffer.byteLength - offset; if (length === 0) return { __proto__: null, bytesRead: length, buffer };