** 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. */
| 142 | ** won't be used again. |
| 143 | */ |
| 144 | static 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 | /* |
no test coverage detected