You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Implement proposal-json-parse-with-source API #185
The reviver function receives only the already converted value, which could be inconvenient if the convertion is not being done correctly by the parser.
For example, if a nunber is greater than Number.MAX_SAFE_INTEGER then the convertion will not be OK:
JSON.parse(`{"n":900719925474099123}`,function(k,v){// v will be 900719925474099100 instead of 900719925474099123console.log(v);})
By adding an extra string argument, will give the programmer a way to do the convertion on their own:
Thanks for the suggestions. While I like your ideas, I don't plan on adding any more features to the JSON5 parser at this time. In an effort to keep JSON5 simple, this library will be a reference parser rather than a full-featured, production-ready implementation of a JSON5 parser.
changed the title [-]Add a new argument to reviver with the original string representation[/-][+]Implement proposal-json-parse-with-source API[/+]on May 29, 2022
Activity
jordanbtucker commentedon Sep 18, 2018
You make a good point. I can see how this would be a useful extension to the API.
jordanbtucker commentedon Oct 3, 2018
See also https://github.com/tc39/proposal-json-parse-with-source
jordanbtucker commentedon Apr 28, 2020
Thanks for the suggestions. While I like your ideas, I don't plan on adding any more features to the JSON5 parser at this time. In an effort to keep JSON5 simple, this library will be a reference parser rather than a full-featured, production-ready implementation of a JSON5 parser.
jordanbtucker commentedon May 29, 2022
I'm reopening this issue to track and discuss https://github.com/tc39/proposal-json-parse-with-source since it has gained some traction lately.
I will not be implementing any of the features from proposal-json-parse-with-source unless and until it gets to stage 4 of the TC39 process.
[-]Add a new argument to reviver with the original string representation[/-][+]Implement proposal-json-parse-with-source API[/+]jordanbtucker commentedon Jul 24, 2022
https://github.com/tc39/proposal-json-parse-with-source is now at stage 3 of the TC39 process.