util/json.lua
changeset 6788 bf1f09a5bcf7
parent 5776 bd0ff8ae98a8
child 7238 ee1f7e1e548c
--- a/util/json.lua	Fri Mar 13 20:12:12 2015 +0100
+++ b/util/json.lua	Fri Mar 13 21:11:33 2015 +0100
@@ -13,7 +13,7 @@
 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 @@
 --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 = {