| 580 | |
| 581 | |
| 582 | LUA_API int lua_getglobal (lua_State *L, const char *name) { |
| 583 | Table *reg = hvalue(&G(L)->l_registry); |
| 584 | const TValue *gt; /* global table */ |
| 585 | lua_lock(L); |
| 586 | gt = luaH_getint(reg, LUA_RIDX_GLOBALS); |
| 587 | setsvalue2s(L, L->top, luaS_new(L, name)); |
| 588 | api_incr_top(L); |
| 589 | luaV_gettable(L, gt, L->top - 1, L->top - 1); |
| 590 | lua_unlock(L); |
| 591 | return ttnov(L->top - 1); |
| 592 | } |
| 593 | |
| 594 | |
| 595 | LUA_API int lua_gettable (lua_State *L, int idx) { |
no test coverage detected