mirror of
https://github.com/TangentFoxy/lume.git
synced 2025-07-28 11:02:20 +00:00
Fixed iscallable() to handle the lack of metatable properly
This commit is contained in:
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
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user