MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / callclosemethod

Function callclosemethod

third-party/lua-5.5.0/src/lfunc.c:107–120  ·  view source on GitHub ↗

** Call closing method for object 'obj' with error object '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 StkId func = top;
110 const TValue *tm = luaT_gettmbyobj(L, obj, TM_CLOSE);
111 setobj2s(L, top++, tm); /* will call metamethod... */
112 setobj2s(L, top++, obj); /* with 'self' as the 1st argument */
113 if (err != NULL) /* if there was an error... */
114 setobj2s(L, top++, err); /* then error object will be 2nd argument */
115 L->top.p = top; /* add function and arguments */
116 if (yy)
117 luaD_call(L, func, 0);
118 else
119 luaD_callnoyield(L, func, 0);
120}
121
122
123/*

Callers 1

prepcallclosemthFunction · 0.70

Calls 3

luaT_gettmbyobjFunction · 0.70
luaD_callFunction · 0.70
luaD_callnoyieldFunction · 0.70

Tested by

no test coverage detected