Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 17a48f1

Browse filesBrowse files
cjihrigtargos
authored andcommitted
fs: use consistent defaults in sync stat functions
This commit updates the default options used by statSync(), lstatSync(), and fstatSync() to be identical to the defaults used by the callback- and Promise-based versions. PR-URL: #31097 Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent cb75f56 commit 17a48f1
Copy full SHA for 17a48f1

File tree

Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-3
lines changed
Open diff view settings
Collapse file

‎lib/fs.js‎

Copy file name to clipboardExpand all lines: lib/fs.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -899,15 +899,15 @@ function stat(path, options = { bigint: false }, callback) {
899899
binding.stat(pathModule.toNamespacedPath(path), options.bigint, req);
900900
}
901901

902-
function fstatSync(fd, options = {}) {
902+
function fstatSync(fd, options = { bigint: false }) {
903903
validateInt32(fd, 'fd', 0);
904904
const ctx = { fd };
905905
const stats = binding.fstat(fd, options.bigint, undefined, ctx);
906906
handleErrorFromBinding(ctx);
907907
return getStatsFromBinding(stats);
908908
}
909909

910-
function lstatSync(path, options = {}) {
910+
function lstatSync(path, options = { bigint: false }) {
911911
path = getValidatedPath(path);
912912
const ctx = { path };
913913
const stats = binding.lstat(pathModule.toNamespacedPath(path),
@@ -916,7 +916,7 @@ function lstatSync(path, options = {}) {
916916
return getStatsFromBinding(stats);
917917
}
918918

919-
function statSync(path, options = {}) {
919+
function statSync(path, options = { bigint: false }) {
920920
path = getValidatedPath(path);
921921
const ctx = { path };
922922
const stats = binding.stat(pathModule.toNamespacedPath(path),

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.