Closed
Description
Version
v22.0.0
Platform
Linux
Subsystem
fs
What steps will reproduce the bug?
var fs = requre("fs");
var stat = fs.statSync("./package.json")
stat.atime = 2
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
It should work
What do you see instead?
It throws
Uncaught RangeError: Maximum call stack size exceeded
at Stats.set [as atime] (node:internal/fs/utils:469:18)
at Stats.set [as atime] (node:internal/fs/utils:469:18)
at Stats.set [as atime] (node:internal/fs/utils:469:18)
at Stats.set [as atime] (node:internal/fs/utils:469:18)
at Stats.set [as atime] (node:internal/fs/utils:469:18)
at Stats.set [as atime] (node:internal/fs/utils:469:18)
at Stats.set [as atime] (node:internal/fs/utils:469:18)
at Stats.set [as atime] (node:internal/fs/utils:469:18)
at Stats.set [as atime] (node:internal/fs/utils:469:18)
Additional information
- This is probably caused by fs: make stats date fields lazy #50908 (cc @anonrig), since the setters defined in that PR just call themselves recursively
- I found this while investigating NodeJS 22 breaks vinyl-js gulpjs/vinyl-fs#350, which is probably another regression