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

Function prepcallclosemth

3rd/lua-5.4.3/src/lfunc.c:144–154  ·  view source on GitHub ↗

** Prepare and call a closing method. ** If status is CLOSEKTOP, the call to the closing method will be pushed ** at the top of the stack. Otherwise, values can be pushed right after ** the 'level' of the upvalue being closed, as everything after that ** won't be used again. */

Source from the content-addressed store, hash-verified

142** won't be used again.
143*/
144static void prepcallclosemth (lua_State *L, StkId level, int status, int yy) {
145 TValue *uv = s2v(level); /* value being closed */
146 TValue *errobj;
147 if (status == CLOSEKTOP)
148 errobj = &G(L)->nilvalue; /* error object is nil */
149 else { /* 'luaD_seterrorobj' will set top to level + 2 */
150 errobj = s2v(level + 1); /* error object goes after 'uv' */
151 luaD_seterrorobj(L, status, level + 1); /* set error object */
152 }
153 callclosemethod(L, uv, errobj, yy);
154}
155
156
157/*

Callers 1

luaF_closeFunction · 0.85

Calls 2

luaD_seterrorobjFunction · 0.85
callclosemethodFunction · 0.85

Tested by

no test coverage detected