6 Commits

Author SHA1 Message Date
rxi
d1e3b0f5d0 Version 0.1.2 2019-06-21 22:44:42 +01:00
rxi
69b714ad2b Updated copyright year (2018 -> 2019) 2019-04-09 20:20:50 +01:00
rxi
f049daf06c Merge pull request #15 from nikeinikei/master
Fix serializing of tables with overloaded indexing / using __index metamethod
2019-04-09 20:10:27 +01:00
niki
fd58f29876 Merge branch 'master' of https://github.com/nikeinikei/json.lua 2019-01-11 19:22:45 +01:00
niki
d3f417d4d4 fix array detection when using overloaded indexing 2019-01-11 19:22:04 +01:00
niki
e1abe1c45c fix array detection when using overloaded indexing 2019-01-11 19:12:00 +01:00
2 changed files with 4 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
Copyright (c) 2018 rxi
Copyright (c) 2019 rxi
Permission is hereby granted, free of charge, to any person obtaining a copy of

View File

@@ -1,7 +1,7 @@
--
-- json.lua
--
-- Copyright (c) 2018 rxi
-- Copyright (c) 2019 rxi
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy of
-- this software and associated documentation files (the "Software"), to deal in
@@ -22,7 +22,7 @@
-- SOFTWARE.
--
local json = { _version = "0.1.1" }
local json = { _version = "0.1.2" }
-------------------------------------------------------------------------------
-- Encode
@@ -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