mirror of
https://github.com/TangentFoxy/lume.git
synced 2024-11-19 07:04:24 +00:00
Fixed iscallable() to handle the lack of metatable properly
This commit is contained in:
parent
fff0d780bb
commit
6a160a3afe
4
lume.lua
4
lume.lua
@ -30,7 +30,9 @@ local absindex = function(len, i)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local iscallable = function(x)
|
local iscallable = function(x)
|
||||||
return type(x) == "function" or getmetatable(x).__call ~= nil
|
if type(x) == "function" then return true end
|
||||||
|
local mt = getmetatable(x)
|
||||||
|
return mt and mt.__call ~= nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user