summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lauxlib.js4
-rw-r--r--src/ldblib.js2
2 files changed, 1 insertions, 5 deletions
diff --git a/src/lauxlib.js b/src/lauxlib.js
index 51c5749..aafdfff 100644
--- a/src/lauxlib.js
+++ b/src/lauxlib.js
@@ -869,12 +869,8 @@ const lua_writestringerror = function() {
for (let i=0; i<arguments.length; i++) {
let a = arguments[i];
if (typeof process === "undefined") {
- if (typeof a !== "string")
- a = lua.to_jsstring(a);
console.error(a);
} else {
- if (typeof a !== "string")
- a = Uint8Array.from(a);
process.stderr.write(a);
}
}
diff --git a/src/ldblib.js b/src/ldblib.js
index df7d2ff..a189976 100644
--- a/src/ldblib.js
+++ b/src/ldblib.js
@@ -415,7 +415,7 @@ if (typeof process !== "undefined") { // Only with Node
let buffer = lua.to_luastring(input);
if (lauxlib.luaL_loadbuffer(L, buffer, buffer.length, lua.to_luastring("=(debug command)", true))
|| lua.lua_pcall(L, 0, 0, 0)) {
- lauxlib.lua_writestringerror(lua.lua_toluastring(L, -1), "\n");
+ lauxlib.lua_writestringerror(lua.lua_tojsstring(L, -1), "\n");
}
lua.lua_settop(L, 0); /* remove eventual returns */
}