summaryrefslogtreecommitdiff
path: root/tests/test-suite/ltests.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-05-23 11:53:18 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-05-24 10:15:31 +0200
commit214d745949e33f869751214c0997bf02f63c88b4 (patch)
tree5273443f7ecf421749ef3115c76562b4738ba3b4 /tests/test-suite/ltests.js
parent3f6f88a1948454562b4416b2f4d398dedac725cc (diff)
downloadfengari-214d745949e33f869751214c0997bf02f63c88b4.tar.gz
fengari-214d745949e33f869751214c0997bf02f63c88b4.tar.bz2
fengari-214d745949e33f869751214c0997bf02f63c88b4.zip
ltests.js: fixed getstring
Diffstat (limited to 'tests/test-suite/ltests.js')
-rw-r--r--tests/test-suite/ltests.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/test-suite/ltests.js b/tests/test-suite/ltests.js
index dcc8cec..685f530 100644
--- a/tests/test-suite/ltests.js
+++ b/tests/test-suite/ltests.js
@@ -58,7 +58,7 @@ const getstring = function(L, buff, pc) {
while (pc.script[pc.offset] !== 0 && pc.offset < pc.script.length && delimits.indexOf(pc.script[pc.offset]) < 0)
buff[i++] = pc.script[pc.offset++];
}
- buff[i] = 0;
+ buff.length = i;
return buff;
};
@@ -102,7 +102,7 @@ const runJS = function(L, L1, pc) {
let status = 0;
if (!pc || pc.length === 0) return lauxlib.luaL_error(L, "attempt to runJS empty script");
for (;;) {
- let inst = lua.to_jsstring(getstring(L, buff, pc).slice(0, -1));
+ let inst = lua.to_jsstring(getstring(L, buff, pc));
if (inst.length === 0) return 0;
else if (inst === "absindex") {
lua.lua_pushnumber(1, lua.lua_absindex(1, getindex(L, L1, pc)));