diff --git a/json.lua b/json.lua index e4cee97..1a049ee 100644 --- a/json.lua +++ b/json.lua @@ -298,6 +298,9 @@ local function parse_object(str, i, chr) break end -- Read key + if str:sub(i, i) ~= '"' then + decode_error(str, i, "expected string for key") + end key, i = parse(str, i) -- Read ':' delimiter i = next_char(str, i, space_chars, true)