summaryrefslogtreecommitdiff
path: root/tests/tests.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/tests.js')
-rw-r--r--tests/tests.js14
1 files changed, 3 insertions, 11 deletions
diff --git a/tests/tests.js b/tests/tests.js
index 40bebd8..32efca1 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -15,23 +15,15 @@ const toByteCode = function (luaCode) {
fs.writeSync(luaFile.fd, luaCode);
child_process.execSync(`luac -o ${luaFile.name}.bc ${luaFile.name}`);
- child_process.execSync(`luac -l ${luaFile.name} > ${luaFile.name}.bc.txt`);
-
- bclist = fs.readFileSync(`${luaFile.name}.bc.txt`, 'utf8');
let b = fs.readFileSync(`${luaFile.name}.bc`);
let dv = new DataView(b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength));
- return {
- dataView: dv,
- bclist: bclist
- };
+ return dv;
};
const getState = function(luaCode) {
- var bc = toByteCode(luaCode),
- dv = bc.dataView,
- bcl = bc.bclist;
+ var dv = toByteCode(luaCode);
let L = lauxlib.luaL_newstate();
@@ -41,4 +33,4 @@ const getState = function(luaCode) {
};
module.exports.getState = getState;
-module.exports.toByteCode = toByteCode; \ No newline at end of file
+module.exports.toByteCode = toByteCode;