summaryrefslogtreecommitdiff
path: root/source/tests/02-luax/script.lua
diff options
context:
space:
mode:
Diffstat (limited to 'source/tests/02-luax/script.lua')
-rw-r--r--source/tests/02-luax/script.lua14
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)