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