# HG changeset patch # User Kim Alvefur # Date 1426277493 -3600 # Node ID bf1f09a5bcf70a8af0edab7e311a79735919e507 # Parent 4da860edc27c31efea71e36361fc388b90ffc532 util.json: Remove use of newproxy diff -r 4da860edc27c -r bf1f09a5bcf7 util/json.lua --- 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 = {