diff options
author | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-02-17 09:27:51 +0100 |
---|---|---|
committer | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-02-17 09:27:51 +0100 |
commit | 50aa5b5029165be03d0cfb34e7d664795dd80898 (patch) | |
tree | dc42e1a73ac367fef1a88c3dd0502a0879eebea3 /tests/tests.js | |
parent | 4eea48935f2e0ea1267d314f2900af2a1a4b8b02 (diff) | |
download | fengari-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.js | 8 |
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 = { |