@@ -78,6 +78,14 @@ fs.readdir(readdirDir, {
|
78 | 78 | assertDirents(dirents); |
79 | 79 | })().then(common.mustCall()); |
80 | 80 | |
| 81 | +// Check that mutating options doesn't affect results |
| 82 | +(async () => { |
| 83 | +const options = { withFileTypes: true }; |
| 84 | +const direntsPromise = fs.promises.readdir(readdirDir, options); |
| 85 | +options.withFileTypes = false; |
| 86 | +assertDirents(await direntsPromise); |
| 87 | +})().then(common.mustCall()); |
| 88 | + |
81 | 89 | // Check for correct types when the binding returns unknowns |
82 | 90 | const UNKNOWN = constants.UV_DIRENT_UNKNOWN; |
83 | 91 | const oldReaddir = binding.readdir; |
|