| 1220 | |
| 1221 | |
| 1222 | LUA_API void lua_toclose (lua_State *L, int idx) { |
| 1223 | int nresults; |
| 1224 | StkId o; |
| 1225 | lua_lock(L); |
| 1226 | o = index2stack(L, idx); |
| 1227 | nresults = L->ci->nresults; |
| 1228 | api_check(L, L->openupval == NULL || uplevel(L->openupval) <= o, |
| 1229 | "marked index below or equal new one"); |
| 1230 | luaF_newtbcupval(L, o); /* create new to-be-closed upvalue */ |
| 1231 | if (!hastocloseCfunc(nresults)) /* function not marked yet? */ |
| 1232 | L->ci->nresults = codeNresults(nresults); /* mark it */ |
| 1233 | lua_assert(hastocloseCfunc(L->ci->nresults)); |
| 1234 | lua_unlock(L); |
| 1235 | } |
| 1236 | |
| 1237 | |
| 1238 | LUA_API void lua_concat (lua_State *L, int n) { |
no test coverage detected