-
Notifications
You must be signed in to change notification settings - Fork 23
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
Consider specializing a subset for JSON #25
Comments
Since object literals can contain both non-JSON-representable types, and because it can contain any arbitrary type that has a .toJSON method, what would be the advantage to trying to represent a “JSON-style” literal? |
For the moment, it's more of an intuition than anything else. But my intuition tells me that we should be able to make things faster and more efficient if we know that we're dealing with a very small subset of JavaScript that can only contain pure data, and in particular nothing unsafe (assuming that it doesn't throw a SyntaxError). |
That sounds nice, but I’m not sure how those things can be statically known. |
I believe that we should consider offering a subset of the syntax specialized for JSON-style literal expressions.
Expected benefits
JSON.parse()
to TypeArray and create a newJSON.binify()
;Possible spec
The text was updated successfully, but these errors were encountered: