diff options
author | chai <chaifix@163.com> | 2019-03-27 09:07:54 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-03-27 09:07:54 +0800 |
commit | 66c5fdc564dd892ed265132d6c1378dbe3cebcee (patch) | |
tree | 909848ed622b35c8653c961c9ebed8c574bb150e /source/tests/02-luax/script.lua | |
parent | d9041d6e12ded456c17622f7f2e7bbacb9e99b1a (diff) |
*misc
Diffstat (limited to 'source/tests/02-luax/script.lua')
-rw-r--r-- | source/tests/02-luax/script.lua | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/tests/02-luax/script.lua b/source/tests/02-luax/script.lua index 57c9664..7e553d2 100644 --- a/source/tests/02-luax/script.lua +++ b/source/tests/02-luax/script.lua @@ -66,7 +66,7 @@ function main() ------------------- plain class test local Foo = Asura.Class("Foo") - Foo.Ctor = function(self, age, name, boy) + Foo.__init = function(self, age, name, boy) self.age = age self.name = name self.boy = boy @@ -87,11 +87,11 @@ function main() print(Coo.GetClassName()) local coo = Coo.New(20, "Wang", kid) print(coo:GetAge()) - Coo.Ctor = function(self, age, name, boy) + Coo.__init = function(self, age, name, boy) self.age = age - 1 self.name = boy:GetName() self.boy = boy - self.__base.Ctor(self, age, "Wangba", boy) + self.__base.__init(self, age, "Wangba", boy) end Coo.GetName = function(self) local name = self.__base.GetName(self) @@ -117,9 +117,9 @@ function main() -- Boy2.Speak = function(self) -- return self.__base.GetAge(self) -- end - -- Boy2.Ctor = function(self, age, name) - -- print("ctor " .. age) - -- print("ctor " .. name) + -- Boy2.__init = function(self, age, name) + -- print("__init " .. age) + -- print("__init " .. name) -- end -- local boy22 = Boy2.New(12, "Liu") -- print(boy22) @@ -128,6 +128,8 @@ function main() ------------------------gc test local boy = Asura.SimBoy.New(11, "chaichai") boy = nil + + io.read() end function err(msg) print(msg) |