MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / trymt

Function trymt

lib/lua/src/lstrlib.c:277–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

275
276
277static void trymt (lua_State *L, const char *mtname) {
278 lua_settop(L, 2); /* back to the original arguments */
279 if (l_unlikely(lua_type(L, 2) == LUA_TSTRING ||
280 !luaL_getmetafield(L, 2, mtname)))
281 luaL_error(L, "attempt to %s a '%s' with a '%s'", mtname + 2,
282 luaL_typename(L, -2), luaL_typename(L, -1));
283 lua_insert(L, -3); /* put metamethod before arguments */
284 lua_call(L, 2, 1); /* call metamethod */
285}
286
287
288static int arith (lua_State *L, int op, const char *mtname) {

Callers 1

arithFunction · 0.85

Calls 4

lua_settopFunction · 0.85
lua_typeFunction · 0.85
luaL_getmetafieldFunction · 0.85
luaL_errorFunction · 0.85

Tested by

no test coverage detected