Software /
code /
prosody
Changeset
6785:bf1f09a5bcf7
util.json: Remove use of newproxy
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 13 Mar 2015 21:11:33 +0100 |
parents | 6784:4da860edc27c |
children | 6786:3deeb38d79ab |
files | util/json.lua |
diffstat | 1 files changed, 2 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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 = {