Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -922,15 +922,15 @@ function stat(path, options = { bigint: false }, callback) {
binding.stat(pathModule.toNamespacedPath(path), options.bigint, req);
}

function fstatSync(fd, options = {}) {
function fstatSync(fd, options = { bigint: false }) {
validateInt32(fd, 'fd', 0);
const ctx = { fd };
const stats = binding.fstat(fd, options.bigint, undefined, ctx);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For @devsnek 's concerns, how about changing this to:

Suggested change
const stats = binding.fstat(fd, options.bigint, undefined, ctx);
const stats = binding.fstat(fd, options.bigint || false, undefined, ctx);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in a future change we could do { bigint = false } = {} for all of them

handleErrorFromBinding(ctx);
return getStatsFromBinding(stats);
}

function lstatSync(path, options = {}) {
function lstatSync(path, options = { bigint: false }) {
path = getValidatedPath(path);
const ctx = { path };
const stats = binding.lstat(pathModule.toNamespacedPath(path),
Expand All @@ -939,7 +939,7 @@ function lstatSync(path, options = {}) {
return getStatsFromBinding(stats);
}

function statSync(path, options = {}) {
function statSync(path, options = { bigint: false }) {
path = getValidatedPath(path);
const ctx = { path };
const stats = binding.stat(pathModule.toNamespacedPath(path),
Expand Down