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/loadlib.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/loadlib.js')
-rw-r--r-- | src/loadlib.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/loadlib.js b/src/loadlib.js index c859798..2e68ffd 100644 --- a/src/loadlib.js +++ b/src/loadlib.js @@ -263,12 +263,12 @@ const addtoclib = function(L, path, plib) { }; const pushnexttemplate = function(L, path) { - while (path[0] === lua.LUA_PATH_SEP.charCodeAt(0)) path = path.slice(1); /* skip separators */ + while (path[0] === lua.LUA_PATH_SEP.charCodeAt(0)) path = path.subarray(1); /* skip separators */ if (path.length === 0) return null; /* no more templates */ let l = lua.luastring_indexOf(path, lua.LUA_PATH_SEP.charCodeAt(0)); /* find next separator */ if (l < 0) l = path.length; lua.lua_pushlstring(L, path, l); /* template */ - return path.slice(l); + return path.subarray(l); }; const searchpath = function(L, name, path, sep, dirsep) { |