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

Function luaB_setmetatable

third-party/lua-5.2.4/src/lbaselib.c:112–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110
111
112static int luaB_setmetatable (lua_State *L) {
113 int t = lua_type(L, 2);
114 luaL_checktype(L, 1, LUA_TTABLE);
115 luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2,
116 "nil or table expected");
117 if (luaL_getmetafield(L, 1, "__metatable"))
118 return luaL_error(L, "cannot change a protected metatable");
119 lua_settop(L, 2);
120 lua_setmetatable(L, 1);
121 return 1;
122}
123
124
125static 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