tc39 / tc39/proposal-json-parseimmutable

Options bag option names

Open
#9 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
48
Forks
4
Avg merge
1d 1m
Merged PRs (30d)
5

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the proposed option names, the current preferences, and the compatibility context from #8. Done means reaching agreement on names for the freeze and null-prototype flags; this issue does not identify files or tests to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.