Skip to content

Commit db12267

Browse files
committed
Update cjson.util to workaround missing "unpack"
1 parent 013b277 commit db12267

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lua/cjson/util.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ local json = require "cjson"
1010
-- -1 Not an array
1111
-- 0 Empty table
1212
-- >0 Highest index in the array
13+
14+
-- Provide unpack for Lua 5.3+ built without LUA_COMPAT_UNPACK
15+
local unpack = unpack
16+
if table.unpack then unpack = table.unpack end
17+
1318
local function is_array(table)
1419
local max = 0
1520
local count = 0

0 commit comments

Comments
 (0)