summaryrefslogtreecommitdiff
path: root/src/lua.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-03-14 08:30:45 +0100
committerBenoit Giannangeli <benoit.giannangeli@boursorama.fr>2017-03-14 09:09:52 +0100
commit0d51854b27836c485d0bac7a1a28c19fc61496f1 (patch)
tree0e5fc99d7b205b79ed10eab1f4ce49aa39f7ae59 /src/lua.js
parentf72e2999b92084a8e2d0cef8bfb3b52607bc8dd5 (diff)
downloadfengari-0d51854b27836c485d0bac7a1a28c19fc61496f1.tar.gz
fengari-0d51854b27836c485d0bac7a1a28c19fc61496f1.tar.bz2
fengari-0d51854b27836c485d0bac7a1a28c19fc61496f1.zip
Use emscripten's utf8tojs string function
Diffstat (limited to 'src/lua.js')
-rw-r--r--src/lua.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lua.js b/src/lua.js
index 08bad58..be6cc1e 100644
--- a/src/lua.js
+++ b/src/lua.js
@@ -133,7 +133,7 @@ class lua_Debug {
}
const to_luastring = function(str, maxBytesToWrite) {
- maxBytesToWrite = maxBytesToWrite !== undefined ? maxBytesToWrite : str.length + 1;
+ maxBytesToWrite = maxBytesToWrite !== undefined ? maxBytesToWrite : Number.MAX_SAFE_INTEGER;
let outU8Array = [];
if (!(maxBytesToWrite > 0)) // Parameter maxBytesToWrite is not optional. Negative values, 0, null, undefined and false each don't write out any bytes.