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

Comments

Projects
None yet
1 participant
@pavel

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 from writeJsonString handles undefined in array in a wrong way. to writeJsonString handles undefined in an array in a wrong way. Jul 18, 2014

@s-ludwig s-ludwig closed this in 0f87041 Jul 19, 2014

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