diff options
author | daurnimator <quae@daurnimator.com> | 2017-05-02 16:37:50 +1000 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-05-03 12:20:43 +1000 |
commit | cb0295e52870f22c5dd1a1726342b8d4b147b1c5 (patch) | |
tree | 3655d4d6f4873ed246c00c0eb6680a06124f3046 /src/lstate.js | |
parent | 50820e54d065bffbb504e6b20b6c27802e102c25 (diff) | |
download | fengari-cb0295e52870f22c5dd1a1726342b8d4b147b1c5.tar.gz fengari-cb0295e52870f22c5dd1a1726342b8d4b147b1c5.tar.bz2 fengari-cb0295e52870f22c5dd1a1726342b8d4b147b1c5.zip |
Refactor table implementation
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))); }; /* |