MCPcopy Create free account
hub / github.com/Tencent/xLua / createFunctionMetatable

Method createFunctionMetatable

Assets/XLua/Src/ObjectTranslator.cs:699–716  ·  view source on GitHub ↗
(RealStatePtr L)

Source from the content-addressed store, hash-verified

697 }
698
699 internal void createFunctionMetatable(RealStatePtr L)
700 {
701 LuaAPI.lua_newtable(L);
702 LuaAPI.xlua_pushasciistring(L,"__gc");
703 LuaAPI.lua_pushstdcallcfunction(L,metaFunctions.GcMeta);
704 LuaAPI.lua_rawset(L,-3);
705 LuaAPI.lua_pushlightuserdata(L, LuaAPI.xlua_tag());
706 LuaAPI.lua_pushnumber(L, 1);
707 LuaAPI.lua_rawset(L, -3);
708
709 LuaAPI.lua_pushvalue(L, -1);
710 int type_id = LuaAPI.luaL_ref(L, LuaIndexes.LUA_REGISTRYINDEX);
711 LuaAPI.lua_pushnumber(L, type_id);
712 LuaAPI.xlua_rawseti(L, -2, 1);
713 LuaAPI.lua_pop(L, 1);
714
715 typeIdMap.Add(typeof(LuaCSFunction), type_id);
716 }
717
718 internal Type FindType(string className, bool isQualifiedName = false)
719 {

Callers 1

LuaEnv.csFile · 0.80

Calls 12

lua_newtableMethod · 0.80
xlua_pushasciistringMethod · 0.80
lua_rawsetMethod · 0.80
lua_pushlightuserdataMethod · 0.80
xlua_tagMethod · 0.80
lua_pushnumberMethod · 0.80
lua_pushvalueMethod · 0.80
luaL_refMethod · 0.80
xlua_rawsetiMethod · 0.80
lua_popMethod · 0.80
AddMethod · 0.45

Tested by

no test coverage detected