props bug fixed
This commit is contained in:
parent
cdc11d4c2b
commit
acc8f403e7
1 changed files with 7 additions and 13 deletions
|
|
@ -53,20 +53,14 @@ function module.init(shared)
|
||||||
local func = ClassName.new or ClassName.New or ClassName.__new;
|
local func = ClassName.new or ClassName.New or ClassName.__new;
|
||||||
if ClassName.__noSetup then -- if is support initing props
|
if ClassName.__noSetup then -- if is support initing props
|
||||||
local childs,props = {},{...};
|
local childs,props = {},{...};
|
||||||
local parsed;
|
local parsed = {};
|
||||||
for iprop = #props,1,-1 do
|
for iprop = #props,1,-1 do
|
||||||
local prop = props[iprop];
|
local prop = props[iprop];
|
||||||
for i,v in ipairs(prop) do
|
for i,v in pairs(prop) do
|
||||||
childs[i] = ((iprop == 1) and v or v:Clone());
|
if type(i) == "number" then
|
||||||
prop[i] = nil;
|
childs[i] = ((iprop == 1) and v or v:Clone());
|
||||||
end
|
|
||||||
if next(prop) then -- there are (key/value)s
|
|
||||||
if parsed then
|
|
||||||
for i,v in pairs(prop) do
|
|
||||||
parsed[i] = v;
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
parsed = prop;
|
parsed[i] = v;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -166,12 +160,12 @@ function module.init(shared)
|
||||||
return function (nprop)
|
return function (nprop)
|
||||||
nprop = nprop or {};
|
nprop = nprop or {};
|
||||||
nprop.Name = lastName;
|
nprop.Name = lastName;
|
||||||
local item = make(ClassName,nprop);
|
local item = make(ClassName,nprop,this);
|
||||||
addObject(lastName,item);
|
addObject(lastName,item);
|
||||||
return item;
|
return item;
|
||||||
end;
|
end;
|
||||||
elseif propType == "nil" then
|
elseif propType == "nil" then
|
||||||
return make(ClassName);
|
return make(ClassName,this);
|
||||||
end
|
end
|
||||||
return make(ClassName,prop,this);
|
return make(ClassName,prop,this);
|
||||||
end;
|
end;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue