Skip to content
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

Editor corrupts large numbers, exposing limitation of underlying jscript #466

Closed
CamyDee opened this issue Sep 22, 2017 · 1 comment
Closed

Comments

@CamyDee
Copy link

CamyDee commented Sep 22, 2017

Repro:

Create a simple JSON structure like so:

{
   "name" : "Numeric Corruption Repro",
   "value" : 9223372036854775807,
   "detail" : "Int64.MaxValue by the way..."
}

As soon as you enter the value, it is oddly changed to:

{
   "name" : "Numeric Corruption Repro",
   "value" : 9223372036854776000,
   "detail" : "Int64.MaxValue by the way..."
}

This makes sense only when you know about the way numbers are stored in JavaScript, but should not corrupt the data the user is trying to save. Numeric values should probably be stored internally as strings rather than the limited storage type internally used by JavaScript, to avoid this kind of thing.

@josdejong
Copy link
Owner

Yes that's indeed a good point. I made a start with it long time ago but so far didn't implement it in JSONEditor, see #231. Let's continue any discussion in #231.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants