Fix bug with keyorder when value is false

This commit is contained in:
Cr4xy 2019-04-11 08:02:52 +02:00 committed by GitHub
parent e72ba0c9f5
commit 1662f9263d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -319,7 +319,7 @@ encode2 = function (value, indent, level, buffer, buflen, tables, globalorder, s
for i = 1, n do for i = 1, n do
local k = order[i] local k = order[i]
local v = value[k] local v = value[k]
if v then if v ~= nil then
used[k] = true used[k] = true
buflen, msg = addpair (k, v, prev, indent, level, buffer, buflen, tables, globalorder, state) buflen, msg = addpair (k, v, prev, indent, level, buffer, buflen, tables, globalorder, state)
prev = true -- add a seperator before the next element prev = true -- add a seperator before the next element