MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / luaB_setmetatable

Function luaB_setmetatable

Source/Misc/lua/src/lua.c:10968–10978  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10966
10967
10968static int luaB_setmetatable (lua_State *L) {
10969int t = lua_type(L, 2);
10970luaL_checktype(L, 1, LUA_TTABLE);
10971luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2,
10972"nil or table expected");
10973if (luaL_getmetafield(L, 1, "__metatable"))
10974luaL_error(L, "cannot change a protected metatable");
10975lua_settop(L, 2);
10976lua_setmetatable(L, 1);
10977return 1;
10978}
10979
10980
10981static void getfunc (lua_State *L, int opt) {

Callers

nothing calls this directly

Calls 6

lua_typeFunction · 0.85
luaL_checktypeFunction · 0.85
luaL_getmetafieldFunction · 0.85
luaL_errorFunction · 0.85
lua_settopFunction · 0.85
lua_setmetatableFunction · 0.85

Tested by

no test coverage detected