MCPcopy Create free account
hub / github.com/Tencent/UnLua / PushField

Function PushField

Plugins/UnLua/Source/UnLua/Private/LuaCore.cpp:971–993  ·  view source on GitHub ↗

* Push a field (property or function) */

Source from the content-addressed store, hash-verified

969 * Push a field (property or function)
970 */
971static void PushField(lua_State *L, TSharedPtr<FFieldDesc> Field)
972{
973 const auto& Env = UnLua::FLuaEnv::FindEnvChecked(L);
974 check(Field && Field->IsValid());
975 if (Field->IsProperty())
976 {
977 TSharedPtr<FPropertyDesc> Property = Field->AsProperty();
978 Env.GetObjectRegistry()->Push(L, Property);
979 }
980 else
981 {
982 TSharedPtr<FFunctionDesc> Function = Field->AsFunction();
983 Env.GetObjectRegistry()->Push(L, Function);
984 if (Function->IsLatentFunction())
985 {
986 lua_pushcclosure(L, Class_CallLatentFunction, 1); // closure
987 }
988 else
989 {
990 lua_pushcclosure(L, Class_CallUFunction, 1); // closure
991 }
992 }
993}
994
995static void GetFieldInternal(lua_State* L)
996{

Callers 1

GetFieldInternalFunction · 0.85

Calls 8

checkFunction · 0.85
lua_pushcclosureFunction · 0.85
IsPropertyMethod · 0.80
AsPropertyMethod · 0.80
AsFunctionMethod · 0.80
IsLatentFunctionMethod · 0.80
IsValidMethod · 0.45
PushMethod · 0.45

Tested by

no test coverage detected