mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-25 23:24:35 +00:00
[removed] class.lua dependency on table.overlay - fixed #1
This commit is contained in:
parent
3674846f11
commit
74a04423bb
@ -19,8 +19,12 @@ local function class(inherits)
|
||||
--performing a super construction if necessary and assigning the right metatable
|
||||
function c:init(t, ...)
|
||||
if inherits then
|
||||
--super ctor, then overlay args table
|
||||
t = table.overlay(inherits:new(...), t)
|
||||
--construct superclass instance, then overlay args table
|
||||
local ct = inherits:new(...)
|
||||
for k,v in pairs(t) do
|
||||
ct[k] = v
|
||||
end
|
||||
t = ct
|
||||
end
|
||||
--upgrade to this class and return
|
||||
return setmetatable(t, self.__mt)
|
||||
|
Loading…
Reference in New Issue
Block a user