Skip to content

Commit 17a48f1

Browse 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

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎lib/fs.js‎

Lines 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-
functionfstatSync(fd,options={}){
902+
functionfstatSync(fd,options={bigint: false}){
903903
validateInt32(fd,'fd',0);
904904
constctx={ fd };
905905
conststats=binding.fstat(fd,options.bigint,undefined,ctx);
906906
handleErrorFromBinding(ctx);
907907
returngetStatsFromBinding(stats);
908908
}
909909

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

919-
functionstatSync(path,options={}){
919+
functionstatSync(path,options={bigint: false}){
920920
path=getValidatedPath(path);
921921
constctx={ path };
922922
conststats=binding.stat(pathModule.toNamespacedPath(path),

0 commit comments

Comments
 (0)