| 729 | |
| 730 | |
| 731 | LUA_API void lua_setglobal (lua_State *L, const char *var) { |
| 732 | Table *reg = hvalue(&G(L)->l_registry); |
| 733 | const TValue *gt; /* global table */ |
| 734 | lua_lock(L); |
| 735 | api_checknelems(L, 1); |
| 736 | gt = luaH_getint(reg, LUA_RIDX_GLOBALS); |
| 737 | setsvalue2s(L, L->top++, luaS_new(L, var)); |
| 738 | luaV_settable(L, gt, L->top - 1, L->top - 2); |
| 739 | L->top -= 2; /* pop value and key */ |
| 740 | lua_unlock(L); |
| 741 | } |
| 742 | |
| 743 | |
| 744 | LUA_API void lua_settable (lua_State *L, int idx) { |
no test coverage detected