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

Function callclosemethod

lib/lua/src/lfunc.c:107–118  ·  view source on GitHub ↗

** Call closing method for object 'obj' with error message 'err'. The ** boolean 'yy' controls whether the call is yieldable. ** (This function assumes EXTRA_STACK.) */

Source from the content-addressed store, hash-verified

105** (This function assumes EXTRA_STACK.)
106*/
107static void callclosemethod (lua_State *L, TValue *obj, TValue *err, int yy) {
108 StkId top = L->top.p;
109 const TValue *tm = luaT_gettmbyobj(L, obj, TM_CLOSE);
110 setobj2s(L, top, tm); /* will call metamethod... */
111 setobj2s(L, top + 1, obj); /* with 'self' as the 1st argument */
112 setobj2s(L, top + 2, err); /* and error msg. as 2nd argument */
113 L->top.p = top + 3; /* add function and arguments */
114 if (yy)
115 luaD_call(L, top, 0);
116 else
117 luaD_callnoyield(L, top, 0);
118}
119
120
121/*

Callers 1

prepcallclosemthFunction · 0.85

Calls 3

luaT_gettmbyobjFunction · 0.85
luaD_callFunction · 0.85
luaD_callnoyieldFunction · 0.85

Tested by

no test coverage detected