mirror of
https://github.com/lazuscripts/locator.git
synced 2024-11-19 10:54:24 +00:00
calling an empty register function on locator will not error out
This commit is contained in:
parent
b32f9c9b34
commit
6c39c1cbd1
11
init.moon
11
init.moon
@ -67,10 +67,13 @@ registry = setmetatable {}, {
|
||||
if ok and register[name]
|
||||
insert registered_functions, register[name]
|
||||
|
||||
t[name] = (...) ->
|
||||
for i=1, #registered_functions-1
|
||||
registered_functions[i](...)
|
||||
return registered_functions[#registered_functions](...)
|
||||
if #registered_functions > 0
|
||||
t[name] = (...) ->
|
||||
for i=1, #registered_functions-1
|
||||
registered_functions[i](...)
|
||||
return registered_functions[#registered_functions](...)
|
||||
else
|
||||
t[name] = ->
|
||||
|
||||
return t[name]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user