-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fs: improve mode and flags validation #27044
Conversation
This comment has been minimized.
This comment has been minimized.
This mainly fixes the bug but I mark this defensively as semver-major. CITGM https://ci.nodejs.org/view/Node.js-citgm/job/citgm-smoker/1791/ |
@nodejs/fs @nodejs/tsc PTAL |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@nodejs/fs @nodejs/tsc PTAL |
This comment has been minimized.
This comment has been minimized.
This already has some LGs but it needs one more LG from the @nodejs/tsc. PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind adding some more tests to cover the changes in fs? I don't see new tests, I only see one test removed.
78fbc19
to
9bf11e8
Compare
9bf11e8
to
0d59092
Compare
I finally got the time to get back to this. The last time I missed a few more bugs in the beginning. That was very subtle because the name of the arguments was deceiving me. I fixed the variable naming and added proper validation for PTAL |
I just pushed two more commits that add some more refinements to the docs and fix all left issues with |
This comment has been minimized.
This comment has been minimized.
6de850d
to
05b29f3
Compare
@jasnell @targos @Trott @bnoordhuis please confirm your LG so that this can land. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
05b29f3
to
f1cc9cb
Compare
This comment has been minimized.
This comment has been minimized.
Multiple `fs` functions have a `mode` and or `flag` option. In some cases those have been mistaken and named wrongly. All of those faulty entries have been fixed. Besides that some indentation is also aligned with the rest of the document.
This fixes a few bugs in `fs`. E.g., `fs.promises.access` accepted strings as mode. It should have only accepted numbers. It will now always validate the flags and the mode argument in an consistent way.
This consolidates some examples to concentrate the reader on the important aspects and to reduce reading overhead.
f1cc9cb
to
acc80ae
Compare
@jasnell @targos @Trott @bnoordhuis please confirm your LG so that this can land. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Multiple `fs` functions have a `mode` and or `flag` option. In some cases those have been mistaken and named wrongly. All of those faulty entries have been fixed. Besides that some indentation is also aligned with the rest of the document. PR-URL: #27044 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
This fixes a few bugs in `fs`. E.g., `fs.promises.access` accepted strings as mode. It should have only accepted numbers. It will now always validate the flags and the mode argument in an consistent way. PR-URL: #27044 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
This consolidates some examples to concentrate the reader on the important aspects and to reduce reading overhead. PR-URL: #27044 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Landed in af5ddf2...4455f60 🎉 |
This fixes a bug in
fs.promises.access
as it accepted strings asmode. It should have only accepted numbers. It will now always
validate the flags and the mode argument in an consistent way.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes