From da7551f134377574bbda7dfe5b73e3989fddeb77 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Mon, 29 May 2017 18:48:27 +0200 Subject: long source chunkid must be truncated from the end --- src/lobject.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) */ -- cgit v1.2.3-70-g09d2