summaryrefslogtreecommitdiff
path: root/src/lua.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lua.js')
-rw-r--r--src/lua.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lua.js b/src/lua.js
index 971593d..12d4e65 100644
--- a/src/lua.js
+++ b/src/lua.js
@@ -133,6 +133,7 @@ class lua_Debug {
}
const to_luastring = function(str, maxBytesToWrite) {
+ maxBytesToWrite = maxBytesToWrite !== undefined ? maxBytesToWrite : str.length;
let outU8Array = new Array(maxBytesToWrite);
if (!(maxBytesToWrite > 0)) // Parameter maxBytesToWrite is not optional. Negative values, 0, null, undefined and false each don't write out any bytes.