summaryrefslogtreecommitdiff
path: root/tests/tests.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-17 09:27:51 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-02-17 09:27:51 +0100
commit50aa5b5029165be03d0cfb34e7d664795dd80898 (patch)
treedc42e1a73ac367fef1a88c3dd0502a0879eebea3 /tests/tests.js
parent4eea48935f2e0ea1267d314f2900af2a1a4b8b02 (diff)
downloadfengari-50aa5b5029165be03d0cfb34e7d664795dd80898.tar.gz
fengari-50aa5b5029165be03d0cfb34e7d664795dd80898.tar.bz2
fengari-50aa5b5029165be03d0cfb34e7d664795dd80898.zip
More accurate state and closure init
Diffstat (limited to 'tests/tests.js')
-rw-r--r--tests/tests.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/tests.js b/tests/tests.js
index 02dac80..5a1b023 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -7,7 +7,7 @@ const tmp = require('tmp');
const DataView = require('buffer-dataview');
const BytecodeParser = require("../src/lundump.js");
-const lua_State = require("../src/lstate.js").lua_State;
+const lauxlib = require("../src/lauxlib.js");
const VM = require("../src/lvm.js");
const toByteCode = function (luaCode) {
@@ -34,10 +34,12 @@ const getState = function(luaCode) {
dv = bc.dataView,
bcl = bc.bclist;
+ let L = lauxlib.luaL_newstate();
+
let p = new BytecodeParser(dv);
- let cl = p.luaU_undump();
+ let cl = p.luaU_undump(L);
- return new lua_State(cl);
+ return L;
};
module.exports = {