diff options
author | daurnimator <quae@daurnimator.com> | 2017-03-03 22:46:39 +1100 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2017-03-03 22:46:39 +1100 |
commit | dba35fd2956f9f6b14ea8947baa11c5e483bc407 (patch) | |
tree | 67557d7f3a58d85d07b36fe303d7c83d8e9e4aa8 /tests/tests.js | |
parent | eada82cc75dd0a2ad40ad25552f8e8e2c93891f8 (diff) | |
download | fengari-dba35fd2956f9f6b14ea8947baa11c5e483bc407.tar.gz fengari-dba35fd2956f9f6b14ea8947baa11c5e483bc407.tar.bz2 fengari-dba35fd2956f9f6b14ea8947baa11c5e483bc407.zip |
Remove use of 'buffer-dataview' library
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 }; }; |