| 300 | } |
| 301 | |
| 302 | LUA_API void lua_replace (lua_State *L, int toidx) { |
| 303 | TValue *fr, *to; |
| 304 | lua_lock(L); |
| 305 | fr = index2value(L, -1); |
| 306 | to = index2value(L, toidx); |
| 307 | api_check(L, isvalid(L, to), "invalid index"); |
| 308 | setobj(L, to, fr); |
| 309 | if (isupvalue(toidx)) /* function upvalue? */ |
| 310 | luaC_barrier(L, clCvalue(s2v(L->ci->func.p)), fr); |
| 311 | L->top.p--; |
| 312 | lua_unlock(L); |
| 313 | } |
| 314 | #endif |
| 315 | |
| 316 |
no test coverage detected