fs: use consistent defaults in sync stat functions#31097
Closed
cjihrig wants to merge 1 commit intonodejs:masterfrom
Closed
fs: use consistent defaults in sync stat functions#31097cjihrig wants to merge 1 commit intonodejs:masterfrom
cjihrig wants to merge 1 commit intonodejs:masterfrom
Conversation
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.
gireeshpunathil
approved these changes
Dec 26, 2019
Trott
approved these changes
Dec 26, 2019
targos
approved these changes
Dec 26, 2019
devsnek
approved these changes
Dec 26, 2019
Member
devsnek
left a comment
There was a problem hiding this comment.
this means that xyz(path, {}) will still have options.bigint be undefined. we may want to explore defaults further in future changes.
ZYSzys
reviewed
Dec 26, 2019
| function fstatSync(fd, options = { bigint: false }) { | ||
| validateInt32(fd, 'fd', 0); | ||
| const ctx = { fd }; | ||
| const stats = binding.fstat(fd, options.bigint, undefined, ctx); |
Member
There was a problem hiding this comment.
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); |
Member
There was a problem hiding this comment.
in a future change we could do { bigint = false } = {} for all of them
jasnell
approved these changes
Dec 26, 2019
addaleax
approved these changes
Dec 28, 2019
Collaborator
Member
|
Landed in 3cd7780 |
Trott
pushed a commit
that referenced
this pull request
Dec 29, 2019
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>
BridgeAR
pushed a commit
that referenced
this pull request
Jan 3, 2020
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>
Merged
targos
pushed a commit
that referenced
this pull request
Jan 14, 2020
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>
BethGriggs
pushed a commit
that referenced
this pull request
Feb 6, 2020
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>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit updates the default options used by
statSync(),lstatSync(), andfstatSync()to be identical to the defaults used by the callback- and Promise-based versions.Technically, the binding layer treats
bigintvalues ofundefinedandfalsethe same, but we might as well be consistent.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes