| 27 | } |
| 28 | |
| 29 | static int32 TArray_New(lua_State* L) |
| 30 | { |
| 31 | int32 NumParams = lua_gettop(L); |
| 32 | if (NumParams != 2) |
| 33 | return luaL_error(L, "invalid parameters"); |
| 34 | |
| 35 | auto& Env = UnLua::FLuaEnv::FindEnvChecked(L); |
| 36 | auto ElementType = Env.GetPropertyRegistry()->CreateTypeInterface(L, 2); |
| 37 | if (!ElementType) |
| 38 | return luaL_error(L, "failed to create TArray"); |
| 39 | |
| 40 | auto Registry = UnLua::FLuaEnv::FindEnvChecked(L).GetContainerRegistry(); |
| 41 | Registry->NewArray(L, ElementType, FLuaArray::OwnedBySelf); |
| 42 | return 1; |
| 43 | } |
| 44 | |
| 45 | static int TArray_Enumerable(lua_State* L) |
| 46 | { |
nothing calls this directly
no test coverage detected