Skip to content

[22 regression] Breaks gulp with Cannot assign to read only property 'atime' of object '#<Stats>' #52707

@nicolo-ribaudo

Description

@nicolo-ribaudo

Version

v22.0.0

Platform

Linux

Subsystem

fs

What steps will reproduce the bug?

"use strict";
var fs = require("fs");
var stat = fs.statSync("./package.json")
stat.atime;
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 set stat.atime to 2

What do you see instead?

stat.atime = 2;
           ^

TypeError: Cannot assign to read only property 'atime' of object '#<Stats>'
    at Object.<anonymous> (/home/nic/Documents/dev/github.com/babel/babel/test.js:5:12)
    at Module._compile (node:internal/modules/cjs/loader:1455:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1534:10)
    at Module.load (node:internal/modules/cjs/loader:1265:32)
    at Module._load (node:internal/modules/cjs/loader:1081:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:187:14)
    at node:internal/main/run_main_module:28:49

Additional information

Original bug report: gulpjs/vinyl-fs#350

Caused by #50908

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.fsIssues and PRs related to the fs subsystem / file system.regressionIssues related to regressions.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions