MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / tableGetMetatable

Method tableGetMetatable

source/core/StarLua.cpp:892–903  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

890}
891
892Maybe<LuaTable> LuaEngine::tableGetMetatable(int handleIndex) {
893 lua_checkstack(m_state, 2);
894
895 pushHandle(m_state, handleIndex);
896 if (lua_getmetatable(m_state, -1) == 0) {
897 lua_pop(m_state, 1);
898 return {};
899 }
900 LuaTable table = popLuaValue(m_state).get<LuaTable>();
901 lua_pop(m_state, 1);
902 return table;
903}
904
905void LuaEngine::tableSetMetatable(int handleIndex, LuaTable const& table) {
906 lua_checkstack(m_state, 2);

Callers 1

getMetatableMethod · 0.80

Calls 2

lua_checkstackFunction · 0.85
lua_getmetatableFunction · 0.85

Tested by

no test coverage detected