From c2f73113499b4d1466619e8d5210d8f79b8b3daa Mon Sep 17 00:00:00 2001 From: Manuel Simon Hirsig Date: Tue, 23 Aug 2016 06:58:10 +0200 Subject: [PATCH] refactoring --- aux-addon.lua | 1 + module.lua | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/aux-addon.lua b/aux-addon.lua index 2cf7350..6ec9570 100644 --- a/aux-addon.lua +++ b/aux-addon.lua @@ -51,6 +51,7 @@ do function accessor() return temp end function mutator(t) return temp(t) end public.perm() -- TODO or 'keep' 'hold'?? + function accessor() return perm end function mutator(t) return perm(t) end function public.collector_mt(f) diff --git a/module.lua b/module.lua index 8e1cb11..98cb35d 100644 --- a/module.lua +++ b/module.lua @@ -30,7 +30,7 @@ function importer_mt.__call(self, arg1, arg2) return self end function set_property(metadata, data, modifier, key, f) - if key and not data[key] and type(f) == 'function' or property_error() then + if key and not data[key] and (type(f) == 'function' or property_error()) then metadata[key] = metadata[key] + modifier data[key] = f end @@ -68,7 +68,6 @@ do local function index(access, default) return function(self, key) local state = _state[self]; local modifiers = state.metadata[key] or 0 - if key == 'perm' then DEFAULT_CHAT_FRAME:AddMessage(tostring(key)) end if mask(access+ACCESSOR, modifiers) == access+ACCESSOR then return state.accessors[key]() end return state.data[key] or default[key] end