bugfix
This commit is contained in:
parent
b82625f6a5
commit
2c04b3bbf2
1 changed files with 66 additions and 61 deletions
|
|
@ -41,6 +41,7 @@ function module.init(shared)
|
|||
end
|
||||
|
||||
-- make object that from instance, class and more
|
||||
local pack = table.pack;
|
||||
function new.make(ClassName,...) -- render object
|
||||
-- make thing
|
||||
local item;
|
||||
|
|
@ -52,10 +53,10 @@ function module.init(shared)
|
|||
elseif classOfClassName == "table" then -- if classname is a calss what is included new function, call it for making new object (object)
|
||||
local func = ClassName.new or ClassName.New or ClassName.__new;
|
||||
if ClassName.__noSetup then -- if is support initing props
|
||||
local childs,props = {},{...};
|
||||
local parsed = {};
|
||||
for iprop = #props,1,-1 do
|
||||
local childs,props,parsed = {},pack(...),{};
|
||||
for iprop = props.n,1,-1 do
|
||||
local prop = props[iprop];
|
||||
if prop then
|
||||
for i,v in pairs(prop) do
|
||||
if type(i) == "number" then
|
||||
childs[i] = ((iprop == 1) and v or v:Clone());
|
||||
|
|
@ -64,6 +65,7 @@ function module.init(shared)
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
item = func(parsed);
|
||||
local holder = getHolder(item);
|
||||
for _,v in ipairs(childs) do
|
||||
|
|
@ -81,8 +83,10 @@ function module.init(shared)
|
|||
-- set property and adding child and binding functions
|
||||
local holder = getHolder(item); -- to __holder or holder or it self (for tabled)
|
||||
-- for iprop,prop in ipairs({...}) do
|
||||
for iprop = select("#",...),1,-1 do
|
||||
local prop = select(iprop,...);
|
||||
local props = pack(...);
|
||||
for iprop = props.n,1,-1 do
|
||||
local prop = props[iprop];
|
||||
if prop then
|
||||
for index,value in pairs(prop) do
|
||||
local valueType = typeof(value);
|
||||
local indexType = typeof(index);
|
||||
|
|
@ -142,6 +146,7 @@ function module.init(shared)
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
return item;
|
||||
end
|
||||
local make = new.make;
|
||||
|
|
|
|||
Loading…
Reference in a new issue