Skip to content

Options bag option names #9

Description

@peetklecha

This proposal will introduce an options bag to JSON.parse with (for now) two flags: One which freezes objects and one which makes plain (non-array) objects have a null prototype. We are committed to flags whose default value is false and where the false behavior aligns with current JSON.parse behavior without a reviver.

What should the option bag property names be? Per #8 it might be helpful for compat if the names are not extremely terse.

My current preferences therefore are

freezeObjects -- something as terse as frozen or freeze increases likelihood of web compat issues. but maybe this is overthinking
nullPrototype -- technically doesn't quite capture the fact that only non-array objects will get a null prototype, but that seems hard to capture without getting ridiculous.

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