From 2114d7e5d83ded1f9298eeca6e81a6d5e48bfcdd Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 13 Mar 2015 21:11:33 +0100 Subject: util.json: Remove use of newproxy --- util/json.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'util/json.lua') 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 = { -- cgit v1.2.3