Skip to content

Object.freeze misses arrays assembled by Zod #314

Description

@pmatos

Summary

Object.freeze/Object.isFrozen disagree for arrays assembled by Zod v4.4.3, causing both upstream readonly freezing cases to fail in normal and jitless modes.

Reproduction

A standalone source bundle using Zod shows:

const value = z.array(z.string()).readonly().parse(["a"]);
Object.isFrozen(value); // jsse: false; Node: true

The same occurs for Zod tuple output. Maps, records, Sets, and primitive Promise output in the same readonly matrix report frozen correctly. A direct literal array followed by Object.freeze reports true on jsse, so the defect depends on how the array elements/descriptors were assembled.

Expected

SetIntegrityLevel updates every own array index and length descriptor regardless of whether elements were created through literals, pushes, or property definitions; TestIntegrityLevel then returns true. Relevant spec operations: SetIntegrityLevel and TestIntegrityLevel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyReady for autonomous Symphonika dispatchenhancementNew feature or requestsym:claimedSymphonika has claimed this issue for an orchestrated run.sym:failedA Symphonika run reached a deterministic failed state.sym:staleA Symphonika claim exists without a live local run.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions