summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-05-29 18:48:27 +0200
committerdaurnimator <quae@daurnimator.com>2017-05-31 22:24:00 +1000
commitda7551f134377574bbda7dfe5b73e3989fddeb77 (patch)
tree70ec195b10ab03072c16ab253cae973bf346b3e1
parent13d56c391dfea596eba9cd247fd4a35a328e5746 (diff)
downloadfengari-da7551f134377574bbda7dfe5b73e3989fddeb77.tar.gz
fengari-da7551f134377574bbda7dfe5b73e3989fddeb77.tar.bz2
fengari-da7551f134377574bbda7dfe5b73e3989fddeb77.zip
long source chunkid must be truncated from the end
-rw-r--r--src/lobject.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lobject.js b/src/lobject.js
index 44d8c9b..7c81045 100644
--- a/src/lobject.js
+++ b/src/lobject.js
@@ -313,7 +313,7 @@ const luaO_chunkid = function(source, bufflen) {
out = source.slice(1);
else { /* add '...' before rest of name */
bufflen -= RETS.length;
- out = RETS.concat(source.slice(1, l - bufflen));
+ out = RETS.concat(source.slice(1 + l - bufflen));
}
} else { /* string; format as [string "source"] */
let nli = source.indexOf(char['\n']); /* find first new line (if any) */