fs: make mutating `options` in `readdir()` not affect results
The callback version is implemented in sync way (see https://github.com/nodejs/node/issues/56006), so its test should pass without adjustments.
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 88.00%. Comparing base (
9c046ea) to head (aa7c1ef). Report is 52 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #56057 +/- ##
=======================================
Coverage 88.00% 88.00%
=======================================
Files 656 656
Lines 189131 189138 +7
Branches 36009 36001 -8
=======================================
+ Hits 166439 166455 +16
+ Misses 15853 15849 -4
+ Partials 6839 6834 -5
| Files with missing lines | Coverage Δ | |
|---|---|---|
| lib/fs.js | 93.27% <100.00%> (+<0.01%) |
:arrow_up: |
| lib/internal/fs/promises.js | 97.56% <100.00%> (+<0.01%) |
:arrow_up: |
To be safe, Callback API test blocked until https://github.com/nodejs/node/pull/56041 lands (the test can be moved to that PR).
Rebased on main on top of https://github.com/nodejs/node/commit/53356c37b759f54b7da0c66558dde7f5755894e2, now it patches both Callback and Promises APIs.
In callback version, copy is made only for recursive mode.
Failed to start CI
⚠ Something was pushed to the Pull Request branch since the last approving review. ✘ Refusing to run CI on potentially unsafe PRhttps://github.com/nodejs/node/actions/runs/12211995025
CI: https://ci.nodejs.org/job/node-test-pull-request/63920/
CI: https://ci.nodejs.org/job/node-test-pull-request/63940/
CI: https://ci.nodejs.org/job/node-test-pull-request/63958/
CI: https://ci.nodejs.org/job/node-test-pull-request/64007/
CI: https://ci.nodejs.org/job/node-test-pull-request/64027/
Landed in 743eacc48f778345c6289f9d6cc581e631a0d19e...91099658a618732b2cf4a0bec334df26a9ebaaf4