MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / callclosemethod

Function callclosemethod

3rd/lua-5.4.3/src/lfunc.c:108–119  ·  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

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

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