diff options
author | Kim Alvefur <zash@zash.se> | 2015-03-13 21:11:33 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2015-03-13 21:11:33 +0100 |
commit | 8442d2756cd70527395f1c97d9be620aa28798bd (patch) | |
tree | df700584d0ba3a720acc9ebfe7c1345b31d753c1 /util | |
parent | bd8cd6b9285b88eb7887ed7c1a1719f6eaf07bdb (diff) | |
download | prosody-8442d2756cd70527395f1c97d9be620aa28798bd.tar.gz prosody-8442d2756cd70527395f1c97d9be620aa28798bd.zip |
util.json: Remove use of newproxy
Diffstat (limited to 'util')
-rw-r--r-- | util/json.lua | 7 |
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 = { |