MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / prepclosingmethod

Function prepclosingmethod

extlibs/lua/src/lfunc.c:113–123  ·  view source on GitHub ↗

** Prepare closing method plus its arguments for object 'obj' with ** error message 'err'. (This function assumes EXTRA_STACK.) */

Source from the content-addressed store, hash-verified

111** error message 'err'. (This function assumes EXTRA_STACK.)
112*/
113static int prepclosingmethod (lua_State *L, TValue *obj, TValue *err) {
114 StkId top = L->top;
115 const TValue *tm = luaT_gettmbyobj(L, obj, TM_CLOSE);
116 if (ttisnil(tm)) /* no metamethod? */
117 return 0; /* nothing to call */
118 setobj2s(L, top, tm); /* will call metamethod... */
119 setobj2s(L, top + 1, obj); /* with 'self' as the 1st argument */
120 setobj2s(L, top + 2, err); /* and error msg. as 2nd argument */
121 L->top = top + 3; /* add function and arguments */
122 return 1;
123}
124
125
126/*

Callers 2

callclosemthFunction · 0.85
luaF_newtbcupvalFunction · 0.85

Calls 1

luaT_gettmbyobjFunction · 0.85

Tested by

no test coverage detected