* Push a field (property or function) */
| 969 | * Push a field (property or function) |
| 970 | */ |
| 971 | static 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 | |
| 995 | static void GetFieldInternal(lua_State* L) |
| 996 | { |
no test coverage detected