Closed nviet closed 9 years ago
Hi.
If I've understood it correctly, you are trying to parse a string with an empty array (e.g. JSON.parse("[]")
.
I'll take a look at this soon.
This should be fixed in the develop branch. I've made some changes there and will merge to máster today.
Also, to parse arrays, you should set the result to an object, since the parse
method returns a reference to a JSONarray
objct that representes the data:
JSONstring = "[]"
set jsonArr = JSON.parse(JSONstring)
JSON.write() ' outputs '{"data":[]}'
jsonArr.write() ' outputs '[]'
I got syntax error message at line 324 when trying to parse an empty object
exampleObject: []
How can I fix this?