From 66c5fdc564dd892ed265132d6c1378dbe3cebcee Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 27 Mar 2019 09:07:54 +0800 Subject: *misc --- source/3rd-party/Luax/luax_class.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/3rd-party/Luax/luax_class.cpp') diff --git a/source/3rd-party/Luax/luax_class.cpp b/source/3rd-party/Luax/luax_class.cpp index e2019d4..9f316c1 100644 --- a/source/3rd-party/Luax/luax_class.cpp +++ b/source/3rd-party/Luax/luax_class.cpp @@ -73,7 +73,7 @@ namespace Luax } /// - /// New函数接受n个参数,并尝试获取Ctor,将参数传给Ctor初始化实例。 + /// New函数接受n个参数,并尝试获取__init,将参数传给__init初始化实例。 /// int LuaxPlainClass::l_New(lua_State* L) { @@ -95,11 +95,11 @@ namespace Luax lua_setmetatable(L, -2); // 找到构造函数,会触发metatable.__index,根据继承链向上找。 - lua_getfield(L, classTable, "Ctor"); + lua_getfield(L, classTable, "__init"); if (state.IsType(-1, LUA_TFUNCTION)) { // stack: - // -1: Ctor() + // -1: __init() // -2: instance // -3~-n-2: params @@ -107,27 +107,27 @@ namespace Luax // stack: // -1: instance // -2~-n-1: params - // -n-2: Ctor() + // -n-2: __init() lua_pushvalue(L, -1); // stack: // -1: instance // -2: instance // -3~-n-2: params - // -n-3: Ctor + // -n-3: __init lua_insert(L, -3 - n); // stack: // -1: instance // -2~-n-1: params - // -n-2: Ctor() + // -n-2: __init() // -n-3: instance lua_insert(L, -1 - n); // stack: // -1~-n: params // -n-1: instance - // -n-2: Ctor() + // -n-2: __init() // -n-3: instance lua_pcall(L, n + 1, 0, 0); -- cgit v1.1-26-g67d0