lljson.slencode()/sldecode() don't work well with lljson.empty_array
planned
SuzannaLinn Resident
lljson.empty_array
decodes to an empty table:local t = { lljson.null, lljson.empty_array }
print(t[1], t[2])
-- > lljson_constant: 0x0000000000000003 lljson_constant: 0x0000000000000005
local s = lljson.slencode(t)
print(s)
-- > [null,[]]
local ts = lljson.sldecode(s)
print(ts[1], ts[2])
-- > lljson_constant: 0x0000000000000003 table: 0x0000000011ef6718
lljson.slencode()/sldecode()
should be able to recover the exact same table.Log In
H
Harold Linden
marked this post as
planned
H
Harold Linden
Interesting! in general, it's probably best for us to avoid the hacks necessary for normal JSON serialization by not treating them specially at all in the serializer, and not decoding them in the deserializer. Since they're a lightuserdata, I'll have to think of a serializer that makes sense there without letting people create any arbitrary lightuserdata.