Skip to content

Should returned objects have a null prototype? #6

Description

@peetklecha

The return value for Object.grouBy, the groups property on arrays returned by String.prototype.match, and objects returned by JSON.rawJSON all have null prototypes. Should objects returned by JSON.parseImmutable also do this?

One argument raised at a recent TC39 was that since prototypes are mutable, having a null prototype (or some kind of exotic frozen prototype) would be necessary for these returned objects to be truly frozen. On the other hand, it seems like a non-starter for Arrays returned by this function to have anything other than the normal Array prototype.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions