-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should __proto__ property be treated specially? #199
Comments
JSON5 should definitely maintain backward compatibility with JSON. Thank you for reporting this. I've opened PR #200 for this issue. |
I’m team is using JSON5 as a way to allow users to enter hierarchical data. While non JS implementation will not have an issue with proto, I can see lot of potential security/quality issues if JAVASCRIPT json5 parser will allow proto. suggesting that it will be explicit written into the spec that JavaScript parsers, (by default), will not allow proto and other special attributes to be set. |
@yairlenga Thanks of the suggestion. Since JSON5 is just a document format, it is generic regarding implementations. Although the format is based on JavaScript (just like JSON is) it doesn't really have to do with the JavaScript language (apart from the fact that it references JavaScript grammar productions). If we were to include implementation details for JavaScript, then why should we not also include implementation details for Python, C/C++, C#, Rust, PHP, Go, etc. If you would like to continue this discussion regarding the spec, please open an issue in the json5-spec repo. |
I also am looking for a PHP implementation of JSON5 Also for comparison (note: comments): |
@jasonkhanlar In the Wild on the Wiki is the place to look for implementations. |
Fixed in 4a8c456 |
The json5-spec didn't mention it.
I know it's in js-spec, I just wonder whether it should be same like js.
Because in JSON land,
__proto__
key is just a normal key, as a data language.BTW: Is it right for JSON5 parser use
[[set]]
not[[define]]
?The text was updated successfully, but these errors were encountered: