diff options
author | daurnimator <quae@daurnimator.com> | 2018-01-07 03:28:43 +1100 |
---|---|---|
committer | daurnimator <quae@daurnimator.com> | 2018-01-07 03:35:03 +1100 |
commit | ef0784b2982e65af05982d8e1e18ef1d45ea96ad (patch) | |
tree | 0cc5a7aff5c54c7dae8f2fa84dc4f32a131e47bf /src/lauxlib.js | |
parent | a63de72aa0bf0b1b3bd91ed0c23c4d03bcbf4cd5 (diff) | |
download | fengari-ef0784b2982e65af05982d8e1e18ef1d45ea96ad.tar.gz fengari-ef0784b2982e65af05982d8e1e18ef1d45ea96ad.tar.bz2 fengari-ef0784b2982e65af05982d8e1e18ef1d45ea96ad.zip |
Avoid Uint8Array.slice (IE compat)
Diffstat (limited to 'src/lauxlib.js')
-rw-r--r-- | src/lauxlib.js | 4 |
1 files changed, 2 insertions, 2 deletions
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; }; |