summaryrefslogtreecommitdiff
path: root/src/lbaselib.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lbaselib.js')
-rw-r--r--src/lbaselib.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lbaselib.js b/src/lbaselib.js
index 9a534f2..ca03b7f 100644
--- a/src/lbaselib.js
+++ b/src/lbaselib.js
@@ -26,7 +26,9 @@ if (typeof process === "undefined") {
s = lua.to_jsstring(s);
} catch(e) {
/* otherwise push copy of raw array */
- s = s.slice(0);
+ let copy = new Uint8Array(s.length);
+ copy.set(s);
+ s = copy;
}
buff.push(s);
};