aboutsummaryrefslogtreecommitdiffstats
path: root/util/json.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-08-20 13:05:22 +0200
committerKim Alvefur <zash@zash.se>2015-08-20 13:05:22 +0200
commit6ef7c4d80892f486d71e660b054bdfdb993c8528 (patch)
tree103fd7d9396b60b9f76071a009c54d3ca9d35744 /util/json.lua
parenta9029bd099734436154fc4e794d3b958e54d1943 (diff)
parentd32f36b2817739d7f8d5f1208a3009b7be379562 (diff)
downloadprosody-6ef7c4d80892f486d71e660b054bdfdb993c8528.tar.gz
prosody-6ef7c4d80892f486d71e660b054bdfdb993c8528.zip
Merge 0.10->trunk
Diffstat (limited to 'util/json.lua')
-rw-r--r--util/json.lua7
1 files changed, 2 insertions, 5 deletions
diff --git a/util/json.lua b/util/json.lua
index a8a58afc..becd295d 100644
--- a/util/json.lua
+++ b/util/json.lua
@@ -13,7 +13,7 @@ local tostring, tonumber = tostring, tonumber;
local pairs, ipairs = pairs, ipairs;
local next = next;
local error = error;
-local newproxy, getmetatable, setmetatable = newproxy, getmetatable, setmetatable;
+local getmetatable, setmetatable = getmetatable, setmetatable;
local print = print;
local has_array, array = pcall(require, "util.array");
@@ -22,10 +22,7 @@ local array_mt = has_array and getmetatable(array()) or {};
--module("json")
local json = {};
-local null = newproxy and newproxy(true) or {};
-if getmetatable and getmetatable(null) then
- getmetatable(null).__tostring = function() return "null"; end;
-end
+local null = setmetatable({}, { __tostring = function() return "null"; end; });
json.null = null;
local escapes = {