| 30 | } |
| 31 | |
| 32 | static int32 TMap_New(lua_State* L) |
| 33 | { |
| 34 | int32 NumParams = lua_gettop(L); |
| 35 | if (NumParams != 3) |
| 36 | return luaL_error(L, "invalid parameters"); |
| 37 | |
| 38 | auto& Env = UnLua::FLuaEnv::FindEnvChecked(L); |
| 39 | auto KeyType = Env.GetPropertyRegistry()->CreateTypeInterface(L, 2); |
| 40 | if (!KeyType) |
| 41 | return luaL_error(L, "invalid key type"); |
| 42 | |
| 43 | auto ValueType = Env.GetPropertyRegistry()->CreateTypeInterface(L, 3); |
| 44 | if (!ValueType) |
| 45 | return luaL_error(L, "invalid value type"); |
| 46 | |
| 47 | auto Registry = Env.GetContainerRegistry(); |
| 48 | Registry->NewMap(L, KeyType, ValueType, FLuaMap::OwnedBySelf); |
| 49 | |
| 50 | return 1; |
| 51 | } |
| 52 | |
| 53 | static int TMap_Enumerable(lua_State* L) |
| 54 | { |
nothing calls this directly
no test coverage detected