1
0
Fork 0
mirror of https://github.com/Reuh/classtoi.git synced 2025-10-27 12:19:31 +00:00
This commit is contained in:
Reuh 2016-12-23 16:54:35 +01:00
parent a47a0f5da6
commit bd9d989b4d

View file

@ -1,5 +1,5 @@
--- Reuh's class library version 0.1.2. Lua 5.1-5.3 and LuaJit compatible. --- Reuh's class library version 0.1.2. Lua 5.1-5.3 and LuaJit compatible.
-- Objects and classes behavior are identical, so you can consider this to be prototype-based. -- Objects and classes behavior are identical, so you can consider this to be somewhat prototype-based.
-- Features: -- Features:
-- * Multiple inheritance with class(parents...) or someclass(newstuff...) -- * Multiple inheritance with class(parents...) or someclass(newstuff...)
-- * Every metamethods supported -- * Every metamethods supported
@ -114,7 +114,7 @@ methods = {
if val ~= nil and val ~= different then return val end if val ~= nil and val ~= different then return val end
-- If different search is on and the direct t[k] returns an identical value, force the __index metamethod search. -- If different search is on and the direct t[k] returns an identical value, force the __index metamethod search.
if different ~= nil and getmetatable(t) and getmetatable(t).__index then if different ~= nil and getmetatable(t) and getmetatable(t).__index then
local val = getmetatable(t):__index(k) val = getmetatable(t):__index(k)
if val ~= nil and val ~= different then return val end if val ~= nil and val ~= different then return val end
end end
end end