diff options
author | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-03-03 14:41:11 +0100 |
---|---|---|
committer | Benoit Giannangeli <benoit.giannangeli@boursorama.fr> | 2017-03-03 14:41:11 +0100 |
commit | 3b116600d75012d5d4cd1b21343a0179712d32eb (patch) | |
tree | 020a43afdc63aa353ae2a27420a859487489d1d8 /tests/tests.js | |
parent | 0ba3c5d516b1a0b67cff6d5f4b4583284086dd4b (diff) | |
parent | dba35fd2956f9f6b14ea8947baa11c5e483bc407 (diff) | |
download | fengari-3b116600d75012d5d4cd1b21343a0179712d32eb.tar.gz fengari-3b116600d75012d5d4cd1b21343a0179712d32eb.tar.bz2 fengari-3b116600d75012d5d4cd1b21343a0179712d32eb.zip |
Merge remote-tracking branch 'daurnimator/remove-buffer-dataview'
Diffstat (limited to 'tests/tests.js')
-rw-r--r-- | tests/tests.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/tests.js b/tests/tests.js index a47aee5..d4173c3 100644 --- a/tests/tests.js +++ b/tests/tests.js @@ -3,7 +3,6 @@ const fs = require('fs'); const child_process = require('child_process'); const tmp = require('tmp'); -const DataView = require('buffer-dataview'); const BytecodeParser = require("../src/lundump.js"); const lauxlib = require("../src/lauxlib.js"); @@ -20,10 +19,11 @@ const toByteCode = function (luaCode) { bclist = fs.readFileSync(`${luaFile.name}.bc.txt`, 'utf8'); - // console.log(bclist); + let b = fs.readFileSync(`${luaFile.name}.bc`); + let dv = new DataView(b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength)); return { - dataView: new DataView(fs.readFileSync(`${luaFile.name}.bc`)), + dataView: dv, bclist: bclist }; }; |