summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-02 15:23:07 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-02 15:23:15 +1000
commitade2bbc6099b40fcde7b5a99ce24bd21913f117c (patch)
treed32db4e8d195404c77b7649c6f912c802898854e
parent5a28287e832a60133865386c8a034a5ca8b76bce (diff)
downloadfengari-ade2bbc6099b40fcde7b5a99ce24bd21913f117c.tar.gz
fengari-ade2bbc6099b40fcde7b5a99ce24bd21913f117c.tar.bz2
fengari-ade2bbc6099b40fcde7b5a99ce24bd21913f117c.zip
tests/tests.js: Use luaL_loadstring instead of using lundump.js directly
-rw-r--r--tests/tests.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/tests.js b/tests/tests.js
index 6de0db3..217f1b8 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -4,7 +4,7 @@ const fs = require('fs');
const child_process = require('child_process');
const tmp = require('tmp');
-const BytecodeParser = require("../src/lundump.js");
+const lua = require("../src/lua.js");
const lauxlib = require("../src/lauxlib.js");
const toByteCode = function (luaCode) {
@@ -21,11 +21,9 @@ const toByteCode = function (luaCode) {
};
const getState = function(luaCode) {
- var dv = toByteCode(luaCode);
-
let L = lauxlib.luaL_newstate();
- let p = new BytecodeParser(L, dv).luaU_undump();
+ lauxlib.luaL_loadstring(L, lua.to_luastring(luaCode));
return L;
};