fix array detection when using overloaded indexing

This commit is contained in:
niki
2019-01-11 19:12:00 +01:00
parent bee7ee3431
commit e1abe1c45c

View File

@@ -65,7 +65,7 @@ local function encode_table(val, stack)
stack[val] = true
if val[1] ~= nil or next(val) == nil then
if rawget(val[1]) ~= nil or next(val) == nil then
-- Treat as array -- check keys are valid and it is not sparse
local n = 0
for k in pairs(val) do