-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Make JSON number serialization compatible with ES6 (and V8) #789
Comments
Neither of those links tell me anything. Where is the ES6 number specification? And give an example of a number that is wrong and what the correct number is. |
@JamesNK Here is the number specification: I don't have a JSON.net example but double.toString() wasn't designed for ES6 compatibility so the difference in formatting is likely to be rather big.
The above returns 5E-05 while ES6 mandates 0.00005 |
I'll wait until MS fixes this in DCJS and then reuse it |
@JamesNK Sounds like a reasonable solution. I just hope it won't take forever :-) |
Now it is available: Finally making clear text signatures using Json.NET fully realistic! Unfortunately there is a bug in .NET with respect to parsing floating point numbers: |
After looking into the code it seems that numbers do not follow ES6.
This is usually not a problem but there's a new use-case which may motivate an update:
chakra-core/ChakraCore#149
Unfortunately this is an non-trivial thing:
https://github.com/cyberphone/openkeystore/blob/master/library/src/org/webpki/json/JSONObjectWriter.java#L147
The text was updated successfully, but these errors were encountered: