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

writeJsonString handles undefined in an array in a wrong way. #735

Closed
pavel opened this issue Jul 18, 2014 · 0 comments
Closed

writeJsonString handles undefined in an array in a wrong way. #735

pavel opened this issue Jul 18, 2014 · 0 comments

Comments

@pavel
Copy link

pavel commented Jul 18, 2014

file source/vibe/data/json.d

writeJsonString function (line 1537) is handling undefined inside array by skipping it, see line 1555. This ruins one of the array's invariants, which is order.

Suppose, if in some system you expect [name, surname, address], then even if surname is undefined or null, you should get ["Mike", null, "Some street"] and not ["Mike", "Some street"].

JSON.stringify description by Mozilla:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify (section description, 3rd point)

@pavel pavel changed the title writeJsonString handles undefined in array in a wrong way. writeJsonString handles undefined in an array in a wrong way. Jul 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant