summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-03-24 15:05:35 +0100
committerBenoit Giannangeli <giann008@gmail.com>2017-03-24 15:05:35 +0100
commit478ffdad62482192fd92a8a8f18275c28cfd6826 (patch)
tree115dcbf328983c15abef551a0036624f2b75ba06
parent379b86fdea9f01c4bbff7fe66dec5a659ae82b27 (diff)
downloadfengari-478ffdad62482192fd92a8a8f18275c28cfd6826.tar.gz
fengari-478ffdad62482192fd92a8a8f18275c28cfd6826.tar.bz2
fengari-478ffdad62482192fd92a8a8f18275c28cfd6826.zip
Fixed bad long string parsing
-rw-r--r--src/llex.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/llex.js b/src/llex.js
index 9983c1d..bf7463c 100644
--- a/src/llex.js
+++ b/src/llex.js
@@ -356,7 +356,14 @@ const read_long_string = function(ls, seminfo, sep) {
}
if (seminfo)
- seminfo.ts = new TValue(CT.LUA_TLNGSTR, lua.to_luastring(ls.buff.buffer.slice(2 + sep).join('')));
+ seminfo.ts = new TValue(
+ CT.LUA_TLNGSTR,
+ lua.to_luastring(
+ ls.buff.buffer
+ .slice(2 + sep, 2 + sep - 2 * (2 + sep))
+ .join('')
+ )
+ );
};
const esccheck = function(ls, c, msg) {