Prevent new
calls that won't work as expected
This commit is contained in:
parent
297e6e4996
commit
93b63a5831
@ -41,12 +41,13 @@ function mknew(tt)
|
|||||||
local mt,oldinit,more = {__index=tt},tt.superinit,rawget(tt, "init")
|
local mt,oldinit,more = {__index=tt},tt.superinit,rawget(tt, "init")
|
||||||
tt.new=function(ret)
|
tt.new=function(ret)
|
||||||
if(not ret) ret = {}
|
if(not ret) ret = {}
|
||||||
|
ret.new = false
|
||||||
setmetatable(ret, mt)
|
setmetatable(ret, mt)
|
||||||
if(oldinit) oldinit(ret)
|
if(oldinit) oldinit(ret)
|
||||||
if (more) more(ret)
|
if (more) more(ret)
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|
||||||
if oldinit and more then
|
if oldinit and more then
|
||||||
tt.superinit = function(ret)
|
tt.superinit = function(ret)
|
||||||
oldinit(ret)
|
oldinit(ret)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user