Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lunajson/decoder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ local function newdecoder()
end

if arraylen then -- commit the length of the array if `arraylen` is set
ary[0] = i
ary.n = i
end
rec_depth = rec_depth - 1
return ary
Expand Down
4 changes: 2 additions & 2 deletions src/lunajson/encoder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ end
local _ENV = nil


local function newencoder()
local function newencoder(saxtbl)
local v, nullv
local i, builder, visited

Expand Down Expand Up @@ -93,7 +93,7 @@ local function newencoder()
end
visited[o] = true

local tmp = o[0]
local tmp = o.n
if type(tmp) == 'number' then -- arraylen available
builder[i] = '['
i = i+1
Expand Down