From 612dac8b7aeb1e9e614fb8dbda9872cdef7a6fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ot=C3=A1vio=20Junqueira=20C=2E=20Le=C3=A3o?= Date: Thu, 13 Feb 2020 19:17:41 -0300 Subject: [PATCH] Variable declared in global scope I believe that 'object' variable was not initialized here, being declared in Lua global scope. Is it right? By the way, thanks for developing this module! --- json/json.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/json/json.lua b/json/json.lua index 79761b6..324ca55 100755 --- a/json/json.lua +++ b/json/json.lua @@ -182,6 +182,7 @@ function decode_scanArray(s,startPos) startPos = decode_scanWhitespace(s,startPos+1) end assert(startPos<=stringLen, 'JSON String ended unexpectedly scanning array.') + local object object, startPos = json.decode(s,startPos) array[index] = object index = index + 1