From 2c52b5ec9159eb8fdaa0c59d9e0ee11d3bf6764f Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Mon, 7 Nov 2016 12:40:53 +0100 Subject: [PATCH] greent refactoring --- util.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/util.lua b/util.lua index e7a4f2b..6ee5a8b 100644 --- a/util.lua +++ b/util.lua @@ -48,9 +48,11 @@ end do local mt = {__metatable=false, __newindex=nop} function mt:__sub(table) - return setmetatable(T, O('__metatable', false, '__newindex', nop, '__index', table)) + local proxy = setmetatable(T, O('__metatable', false, '__newindex', nop, '__index', table)) + self[proxy] = table + return proxy end - function M.wrapper() + function M.wrapper() -- TODO replace index function return setmetatable(T, mt) end end