-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
JSON.parseImmutable as a separate companion proposal #330
Comments
It does seem like a separable piece that would be good in a follow-on proposal. |
There is also https://github.com/tc39/proposal-json-parse-with-source that might clash with adding a parameter to |
That proposal does not change the JSON.parse ( text [ , reviver ] ) signature, just the arguments passed to a reviver function. So it would be possible to add another parameter like JSON.parse ( text [ , reviver [ , options ] ] ), or possibly to overload the second parameter to something like JSON.parse ( text [ , optionsOrReviver ] ) as in Temporal |
Thanks for raising this. Have just discussed this with @littledan and @rricard. We are happy to split this off as a separate proposal, which will retain the stage 2 status. We can present this at the next plenary. |
new repo for anyone interested in following there 😀 |
JSON.parseImmutable
seems like it can be expressed as an option given toJSON.parse
since it's otherwise identical as far as I'm aware. I see that in #74 it was originally imagined this way but quickly rejected. But couldn't we take an options bag in place of the reviver and branch on its type?This kind of question is why I'm still a little uneasy about whether
JSON.parseImmutable
should be pursued as a follow-on proposal or not.The text was updated successfully, but these errors were encountered: