diff options
author | Benoit Giannangeli <giann008@gmail.com> | 2017-04-13 07:17:05 +0200 |
---|---|---|
committer | Benoit Giannangeli <giann008@gmail.com> | 2017-04-13 08:57:25 +0200 |
commit | d251efeb37778e2ab57a3d2c80b9df621a691796 (patch) | |
tree | fe6db792a0e9a018d10983a142724fda6e17071b /src/lstate.js | |
parent | a6dc1dbf5a439a854581927fb36fdad05d0dff4b (diff) | |
download | fengari-d251efeb37778e2ab57a3d2c80b9df621a691796.tar.gz fengari-d251efeb37778e2ab57a3d2c80b9df621a691796.tar.bz2 fengari-d251efeb37778e2ab57a3d2c80b9df621a691796.zip |
Table indexes are also starting at 1 internally
Since we use a Map we don't have to care about indexes starting at 0
Diffstat (limited to 'src/lstate.js')
-rw-r--r-- | src/lstate.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lstate.js b/src/lstate.js index 74c908d..e18e7aa 100644 --- a/src/lstate.js +++ b/src/lstate.js @@ -109,8 +109,8 @@ const stack_init = function(L1, L) { const init_registry = function(L, g) { let registry = new lobject.Table(); g.l_registry = registry; - registry.value.set(lua.LUA_RIDX_MAINTHREAD - 1, L); - registry.value.set(lua.LUA_RIDX_GLOBALS - 1, new lobject.Table()); + registry.value.set(lua.LUA_RIDX_MAINTHREAD, L); + registry.value.set(lua.LUA_RIDX_GLOBALS, new lobject.Table()); }; /* |