Fixed iscallable() to handle the lack of metatable properly

This commit is contained in:
rxi 2014-04-28 12:52:29 +01:00
parent fff0d780bb
commit 6a160a3afe

View File

@ -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