Skip to content

Compiler safeguards when defining a __proto__ field #7343

Closed

Description

@DZakh

https://rescript-lang.org/try?version=v11.1.4&module=esmodule&code=C4TwDgpgBMULxQN4H1lgE4HtidQLigGdh0BLAOwHMBfAKFoClCA6AG00oAoU0sd8oAIgBmmTIOoBKWkA

It would be nice for compiler to prevent records creation with the __proto__ field name, since it doesn't work in JavaScript.

Activity

  1. DZakh commented on Mar 16, 2025

    @DZakh
    MemberAuthor

    Related #7342

  2. added this to the v12.1 milestone on May 5, 2025
  3. modified the milestones: v12.1, v13 on Jan 13, 2026
  4. cknitt commented on Oct 19, 2026

    @cknitt
    Member

    This was fixed by #8747: a "__proto__" key in an object literal is now emitted as a computed key (["__proto__"]: ...), so it creates an own property instead of setting the prototype. Closing.

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01Kr4cjoUi2f5VpMvE6wT9bo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions