MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / luaB_setmetatable

Function luaB_setmetatable

libraries/AP_Scripting/lua/src/lbaselib.c:128–138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126
127
128static int luaB_setmetatable (lua_State *L) {
129 int t = lua_type(L, 2);
130 luaL_checktype(L, 1, LUA_TTABLE);
131 luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2,
132 "nil or table expected");
133 if (luaL_getmetafield(L, 1, "__metatable") != LUA_TNIL)
134 return luaL_error(L, "cannot change a protected metatable");
135 lua_settop(L, 2);
136 lua_setmetatable(L, 1);
137 return 1;
138}
139
140
141static int luaB_rawequal (lua_State *L) {

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