| 721 | |
| 722 | |
| 723 | LUA_API void lua_setglobal (lua_State *L, const char *name) { |
| 724 | Table *reg = hvalue(&G(L)->l_registry); |
| 725 | const TValue *gt; /* global table */ |
| 726 | lua_lock(L); |
| 727 | api_checknelems(L, 1); |
| 728 | gt = luaH_getint(reg, LUA_RIDX_GLOBALS); |
| 729 | setsvalue2s(L, L->top, luaS_new(L, name)); |
| 730 | api_incr_top(L); |
| 731 | luaV_settable(L, gt, L->top - 1, L->top - 2); |
| 732 | L->top -= 2; /* pop value and key */ |
| 733 | lua_unlock(L); |
| 734 | } |
| 735 | |
| 736 | |
| 737 | LUA_API void lua_settable (lua_State *L, int idx) { |
no test coverage detected