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.
This proposal will introduce an options bag to
JSON.parsewith (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 isfalseand where thefalsebehavior aligns with currentJSON.parsebehavior 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 asfrozenorfreezeincreases likelihood of web compat issues. but maybe this is overthinkingnullPrototype-- 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.