diff options
Diffstat (limited to 'src/lstate.js')
-rw-r--r-- | src/lstate.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lstate.js b/src/lstate.js index 4b4aaa5..1b077d2 100644 --- a/src/lstate.js +++ b/src/lstate.js @@ -104,10 +104,10 @@ const stack_init = function(L1, L) { ** Create registry table and its predefined values */ const init_registry = function(L, g) { - let registry = new lobject.TValue(CT.LUA_TTABLE, ltable.luaH_new(L)); - g.l_registry = registry; - registry.value.set(defs.LUA_RIDX_MAINTHREAD, L); - registry.value.set(defs.LUA_RIDX_GLOBALS, new lobject.TValue(CT.LUA_TTABLE, ltable.luaH_new(L))); + let registry = ltable.luaH_new(L); + g.l_registry.sethvalue(registry); + ltable.luaH_setint(registry, defs.LUA_RIDX_MAINTHREAD, new lobject.TValue(CT.LUA_TTHREAD, L)); + ltable.luaH_setint(registry, defs.LUA_RIDX_GLOBALS, new lobject.TValue(CT.LUA_TTABLE, ltable.luaH_new(L))); }; /* |