-
Notifications
You must be signed in to change notification settings - Fork 923
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
JSON.parse broken #206
Comments
The upstream issue: bellard/quickjs#206 This changes `js_strtod` to use the standard `strtod` in cases when the input number is not an integer that is guaranteed to be representable as a double without any precision errors. As a result, parsing of integers that exceed 2^53 as floats becomes slower than before, but it also becomes spec-compliant and matches literal parsing: ``` > let x = 19686109595169230000; > let y = parseFloat("19686109595169230000"); > x == y < false (before this patch) < true (after this patch) ```
That said, the spec requires that
This should return I debugged the issue to this part of One way to fix this issue would be to restrict the fast-path parsing only to integers up to 2^53 and fall back to the slower |
fixed |
In Chrome, Node, and Firefox this works just fine:
In QuickJS in wasm32-wasi (using Javy) and on my Ubuntu laptop x86 this is broken:
The text was updated successfully, but these errors were encountered: