refactoring
This commit is contained in:
@@ -51,6 +51,7 @@ do
|
|||||||
function accessor() return temp end
|
function accessor() return temp end
|
||||||
function mutator(t) return temp(t) end
|
function mutator(t) return temp(t) end
|
||||||
public.perm() -- TODO or 'keep' 'hold'??
|
public.perm() -- TODO or 'keep' 'hold'??
|
||||||
|
function accessor() return perm end
|
||||||
function mutator(t) return perm(t) end
|
function mutator(t) return perm(t) end
|
||||||
|
|
||||||
function public.collector_mt(f)
|
function public.collector_mt(f)
|
||||||
|
|||||||
+1
-2
@@ -30,7 +30,7 @@ function importer_mt.__call(self, arg1, arg2)
|
|||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
function set_property(metadata, data, modifier, key, f)
|
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
|
metadata[key] = metadata[key] + modifier
|
||||||
data[key] = f
|
data[key] = f
|
||||||
end
|
end
|
||||||
@@ -68,7 +68,6 @@ do
|
|||||||
local function index(access, default)
|
local function index(access, default)
|
||||||
return function(self, key)
|
return function(self, key)
|
||||||
local state = _state[self]; local modifiers = state.metadata[key] or 0
|
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
|
if mask(access+ACCESSOR, modifiers) == access+ACCESSOR then return state.accessors[key]() end
|
||||||
return state.data[key] or default[key]
|
return state.data[key] or default[key]
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user