forked from enlightenment/efl
elua: make it possible to return values from constructors
This commit is contained in:
parent
c68a73d6e2
commit
2f678f862d
|
@ -60,7 +60,7 @@ end
|
||||||
M.Object = {
|
M.Object = {
|
||||||
__call = function(self, ...)
|
__call = function(self, ...)
|
||||||
local r = self:clone()
|
local r = self:clone()
|
||||||
if self.__ctor then self.__ctor(r, ...) end
|
if self.__ctor then return r, self.__ctor(r, ...) end
|
||||||
return r
|
return r
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ M.Readonly_Object.__call = function(self, ...)
|
||||||
rmt.__index = self
|
rmt.__index = self
|
||||||
rmt.__tostring = self.__tostring
|
rmt.__tostring = self.__tostring
|
||||||
rmt.__metatable = false
|
rmt.__metatable = false
|
||||||
if self.__ctor then self.__ctor(r, rmt, ...) end
|
if self.__ctor then return r, self.__ctor(r, rmt, ...) end
|
||||||
return r
|
return r
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue