diff options
author | Benoit Giannangeli <giann008@gmail.com> | 2017-04-12 07:55:38 +0200 |
---|---|---|
committer | Benoit Giannangeli <giann008@gmail.com> | 2017-04-12 09:18:43 +0200 |
commit | fc08312ebf8cf01a53b4826acce0f1c3aedcdc53 (patch) | |
tree | 5b1c3a1276037b482102bfe2c36bcb31c459acac /src/lobject.js | |
parent | 58fcb1d7f55424de904fd6ae53954b46d82aae8c (diff) | |
download | fengari-fc08312ebf8cf01a53b4826acce0f1c3aedcdc53.tar.gz fengari-fc08312ebf8cf01a53b4826acce0f1c3aedcdc53.tar.bz2 fengari-fc08312ebf8cf01a53b4826acce0f1c3aedcdc53.zip |
debug.traceback
Diffstat (limited to 'src/lobject.js')
-rw-r--r-- | src/lobject.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lobject.js b/src/lobject.js index 66a0dcb..618e801 100644 --- a/src/lobject.js +++ b/src/lobject.js @@ -306,12 +306,12 @@ const luaO_chunkid = function(source, bufflen) { out = RETS.concat(source.slice(1, l - bufflen)); } } else { /* string; format as [string "source"] */ - let nli = source.indexOf('\n'); /* find first new line (if any) */ - let nl = nli ? source.slice(nli) : null; + let nli = source.indexOf(char['\n']); /* find first new line (if any) */ + let nl = nli > -1 ? source.slice(nli) : null; out = PRE; /* add prefix */ bufflen -= PRE.length + RETS.length + POS.length + 1; /* save space for prefix+suffix+'\0' */ if (l < bufflen && nl === null) { /* small one-line source? */ - out = out.conat(source); /* keep it */ + out = out.concat(source); /* keep it */ } else { if (nl !== null) l = nl.length - source.length; /* stop at first newline */ if (l > bufflen) l = bufflen; |