summaryrefslogtreecommitdiff
path: root/Source
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-03-17 11:47:43 +0800
committerchai <chaifix@163.com>2019-03-17 11:47:43 +0800
commitb2dbd84b019648d59df5046f154a30c10b6d7eca (patch)
treee467cdd9cddc619d1806b536d417df15de7e8fc8 /Source
parent5a9bbd481f94119488d845f5b8272734dfda82cc (diff)
*luax
Diffstat (limited to 'Source')
-rw-r--r--Source/3rdParty/Luax/luax.cpp0
-rw-r--r--Source/3rdParty/Luax/luax_class.cpp4
-rw-r--r--Source/Samples/LuaxTest/script.lua4
3 files changed, 4 insertions, 4 deletions
diff --git a/Source/3rdParty/Luax/luax.cpp b/Source/3rdParty/Luax/luax.cpp
deleted file mode 100644
index e69de29..0000000
--- a/Source/3rdParty/Luax/luax.cpp
+++ /dev/null
diff --git a/Source/3rdParty/Luax/luax_class.cpp b/Source/3rdParty/Luax/luax_class.cpp
index 3840d00..8c94248 100644
--- a/Source/3rdParty/Luax/luax_class.cpp
+++ b/Source/3rdParty/Luax/luax_class.cpp
@@ -146,8 +146,8 @@ namespace Luax
lua_setfield(L, -2, "Extend");
// .base
- lua_pushvalue(L, baseClass);
- lua_setfield(L, -2, "base");
+ lua_pushvalue(L, baseClass); // base class
+ lua_setfield(L, -2, "__base");
lua_pushvalue(L, -1); // class table
lua_setfield(L, -2, "__index");
diff --git a/Source/Samples/LuaxTest/script.lua b/Source/Samples/LuaxTest/script.lua
index 7cea38d..df6cbdf 100644
--- a/Source/Samples/LuaxTest/script.lua
+++ b/Source/Samples/LuaxTest/script.lua
@@ -91,10 +91,10 @@ function main()
self.age = age - 1
self.name = boy:GetName()
self.boy = boy
- self.base.Ctor(self, age, name, boy)
+ self.__base.Ctor(self, age, name, boy)
end
Coo.GetName = function(self)
- local name = self.base.GetName(self)
+ local name = self.__base.GetName(self)
return "his name is " .. name
end
local coo2 = Coo.New(20, "Wang", kid)