summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml18
-rw-r--r--README.md2
-rw-r--r--src/lvm.js3
-rw-r--r--tests/ltm.js4
-rw-r--r--tests/tests.js4
5 files changed, 22 insertions, 9 deletions
diff --git a/.travis.yml b/.travis.yml
index 4796715..09bac7d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,3 +1,15 @@
-language: node_js
-node_js:
- - "node" \ No newline at end of file
+language: node
+
+before_install:
+ - pip install --user hererocks
+ - hererocks lua53 -l5.3 -rlatest
+ - source lua53/bin/activate
+ - nvm install node
+ - export NODE=$(nvm which node)
+ - export NPM=${NODE%node}npm
+
+install:
+ - $NPM i
+
+script:
+ - $NPM t \ No newline at end of file
diff --git a/README.md b/README.md
index c6cae01..a4e1325 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,5 @@
+[![Build Status](https://travis-ci.com/giann/fengari.svg?token=PSYuVp8qrrdszprvDFz7&branch=master)](https://travis-ci.com/giann/fengari)
+
# fengari
🐺 φεγγάρι - A Lua VM written in JS ES6 targeting the browser
diff --git a/src/lvm.js b/src/lvm.js
index 16a3bd2..a0822cc 100644
--- a/src/lvm.js
+++ b/src/lvm.js
@@ -521,7 +521,6 @@ const luaV_execute = function(L) {
for (let aux = 0; nfuncOff + aux < lim; aux++)
L.stack[ofuncOff + aux] = L.stack[nfuncOff + aux];
oci.func = nci.func;
- oci.funcOff = nci.funcOff;
oci.u.l.base = ofuncOff + (nci.u.l.base - nfuncOff);
L.top = ofuncOff + (L.top - nfuncOff);
oci.top = L.top;
@@ -920,7 +919,7 @@ const luaV_objlen = function(L, ra, rb) {
}
case CT.LUA_TSHRSTR:
case CT.LUA_TLNGSTR:
- L.stack[ra] = rb.value.length; // TODO: 8-byte clean string
+ L.stack[ra] = new TValue(CT.LUA_TNUMINT, rb.value.length); // TODO: 8-byte clean string
return;
default: {
tm = ltm.luaT_gettmbyobj(L, rb, ltm.TMS.TM_LEN);
diff --git a/tests/ltm.js b/tests/ltm.js
index 0543110..a05d2b5 100644
--- a/tests/ltm.js
+++ b/tests/ltm.js
@@ -783,7 +783,7 @@ test('binary __xxx functions in metatable', function (t) {
}, "Second part of the program executed without errors");
t.deepEqual(
- L.stack.slice(L.top - 12, L.top).map(function (e) { return e.value }),
+ L.stack.slice(L.top - 12, L.top).map(e => e.value),
[
"{} + 1",
"{} - 1",
@@ -1300,7 +1300,7 @@ test('__call', function (t) {
}, "Second part of the program executed without errors");
t.deepEqual(
- L.stack.slice(L.top - 3, L.top).map(function (e) { return e.value }),
+ L.stack.slice(L.top - 3, L.top).map(e => e.value),
["hello", "world", "wow"],
"Program output is correct"
);
diff --git a/tests/tests.js b/tests/tests.js
index a9f8730..0963159 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -16,8 +16,8 @@ const toByteCode = function (luaCode) {
fs.writeSync(luaFile.fd, luaCode);
- child_process.execSync(`luac-5.3 -o ${luaFile.name}.bc ${luaFile.name}`);
- child_process.execSync(`luac-5.3 -l ${luaFile.name} > ${luaFile.name}.bc.txt`);
+ 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');