From ef0784b2982e65af05982d8e1e18ef1d45ea96ad Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sun, 7 Jan 2018 03:28:43 +1100 Subject: Avoid Uint8Array.slice (IE compat) --- src/lbaselib.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lbaselib.js') 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); }; -- cgit v1.2.3-54-g00ecf