From 214d745949e33f869751214c0997bf02f63c88b4 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Tue, 23 May 2017 11:53:18 +0200 Subject: ltests.js: fixed getstring --- tests/test-suite/ltests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/test-suite/ltests.js') 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))); -- cgit v1.2.3-54-g00ecf