This commit is contained in:
Manuel Simon Hirsig
2016-09-04 02:52:50 +02:00
parent 8be659f4b4
commit a9cce523b1
+2 -2
View File
@@ -59,8 +59,8 @@ do
local ACCESS, EVENT = {public=PUBLIC, private=PRIVATE}, {call=CALL, get=INDEX, set=NEWINDEX}
local function declare(self, access, name, handlers)
self.access[name] = (not self.access[name] or collision_error(name)) and access or self.default_access or declaration_error()
for event, handler in handlers do local handler
self[event][name] = type(handler) == 'function' and handler or event == INDEX and function() return handler end or declaration_error()
for event, handler in handlers do local handler = handler
self[event][name] = type(handler) == 'function' and handler or (event == INDEX and function() return handler end or declaration_error())
end
end
function DECLARATOR:__index(key) self=state[self]; local name, access = self.declaration_name, self.declaration_access