| 402 | /* lua_getupvalue() and lua_setupvalue() are in lj_api.c. */ |
| 403 | |
| 404 | LUA_API const char *lua_getlocal(lua_State *L, const lua_Debug *ar, int n) |
| 405 | { |
| 406 | const char *name = NULL; |
| 407 | if (ar) { |
| 408 | TValue *o = debug_localname(L, ar, &name, (BCReg)n); |
| 409 | if (name) { |
| 410 | copyTV(L, L->top, o); |
| 411 | incr_top(L); |
| 412 | } |
| 413 | } else if (tvisfunc(L->top-1) && isluafunc(funcV(L->top-1))) { |
| 414 | name = debug_varname(funcproto(funcV(L->top-1)), 0, (BCReg)n-1); |
| 415 | } |
| 416 | return name; |
| 417 | } |
| 418 | |
| 419 | LUA_API const char *lua_setlocal(lua_State *L, const lua_Debug *ar, int n) |
| 420 | { |
no test coverage detected