** Close all upvalues and to-be-closed variables up to the given stack ** level. Return restored 'level'. */
| 228 | ** level. Return restored 'level'. |
| 229 | */ |
| 230 | StkId luaF_close (lua_State *L, StkId level, TStatus status, int yy) { |
| 231 | ptrdiff_t levelrel = savestack(L, level); |
| 232 | luaF_closeupval(L, level); /* first, close the upvalues */ |
| 233 | while (L->tbclist.p >= level) { /* traverse tbc's down to that level */ |
| 234 | StkId tbc = L->tbclist.p; /* get variable index */ |
| 235 | poptbclist(L); /* remove it from list */ |
| 236 | prepcallclosemth(L, tbc, status, yy); /* close variable */ |
| 237 | level = restorestack(L, levelrel); |
| 238 | } |
| 239 | return level; |
| 240 | } |
| 241 | |
| 242 | |
| 243 | Proto *luaF_newproto (lua_State *L) { |
no test coverage detected