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/lauxlib.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lauxlib.js') diff --git a/src/lauxlib.js b/src/lauxlib.js index b2ee971..1eac8d3 100644 --- a/src/lauxlib.js +++ b/src/lauxlib.js @@ -678,7 +678,7 @@ const luaL_unref = function(L, t, ref) { const errfile = function(L, what, fnameindex, error) { let serr = error.message; - let filename = lua.lua_tostring(L, fnameindex).slice(1); + let filename = lua.lua_tostring(L, fnameindex).subarray(1); lua.lua_pushfstring(L, lua.to_luastring("cannot %s %s: %s"), lua.to_luastring(what), filename, lua.to_luastring(serr)); lua.lua_remove(L, fnameindex); return lua.LUA_ERRFILE; @@ -824,7 +824,7 @@ if (typeof process === "undefined") { lf.pos += bytes; } if (bytes > 0) - return lf.buff.subarray(0, bytes); /* slice on a node.js Buffer is 'free' */ + return lf.buff.subarray(0, bytes); else return null; }; -- cgit v1.2.3-54-g00ecf