summaryrefslogtreecommitdiff
path: root/src/lstate.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-04-27 12:15:10 +1000
committerBenoit Giannangeli <giann008@gmail.com>2017-04-28 14:15:58 +0200
commitb45dc3dd1e3f9ef4548a5e422cb6f7daa9a3ba79 (patch)
treed27f1299ae4324395367703cf311ec4d3dc54ea7 /src/lstate.js
parent86c357cd0c0184b640d0c2233ff53b6f23188d90 (diff)
downloadfengari-b45dc3dd1e3f9ef4548a5e422cb6f7daa9a3ba79.tar.gz
fengari-b45dc3dd1e3f9ef4548a5e422cb6f7daa9a3ba79.tar.bz2
fengari-b45dc3dd1e3f9ef4548a5e422cb6f7daa9a3ba79.zip
Add table construction function
Diffstat (limited to 'src/lstate.js')
-rw-r--r--src/lstate.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lstate.js b/src/lstate.js
index 23374c0..1a4cbd5 100644
--- a/src/lstate.js
+++ b/src/lstate.js
@@ -7,6 +7,7 @@ const defs = require('./defs.js');
const lobject = require('./lobject.js');
const ldo = require('./ldo.js');
const lapi = require('./lapi.js');
+const ltable = require('./ltable.js');
const luaT_init = require('./ltm.js').luaT_init;
const CT = defs.constant_types;
const TS = defs.thread_status;
@@ -106,10 +107,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, new Map());
+ 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, new Map()));
+ registry.value.set(defs.LUA_RIDX_GLOBALS, new lobject.TValue(CT.LUA_TTABLE, ltable.luaH_new(L)));
};
/*