MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaB_setmetatable

Function luaB_setmetatable

third-party/lua-5.5.0/src/lbaselib.c:139–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137
138
139static int luaB_setmetatable (lua_State *L) {
140 int t = lua_type(L, 2);
141 luaL_checktype(L, 1, LUA_TTABLE);
142 luaL_argexpected(L, t == LUA_TNIL || t == LUA_TTABLE, 2, "nil or table");
143 if (l_unlikely(luaL_getmetafield(L, 1, "__metatable") != LUA_TNIL))
144 return luaL_error(L, "cannot change a protected metatable");
145 lua_settop(L, 2);
146 lua_setmetatable(L, 1);
147 return 1;
148}
149
150
151static int luaB_rawequal (lua_State *L) {

Callers

nothing calls this directly

Calls 6

lua_typeFunction · 0.70
luaL_checktypeFunction · 0.70
luaL_getmetafieldFunction · 0.70
luaL_errorFunction · 0.70
lua_settopFunction · 0.70
lua_setmetatableFunction · 0.70

Tested by

no test coverage detected