aboutsummaryrefslogtreecommitdiff
path: root/src/ltablib.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/ltablib.js')
-rw-r--r--src/ltablib.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ltablib.js b/src/ltablib.js
index 10d66eb..20fdf95 100644
--- a/src/ltablib.js
+++ b/src/ltablib.js
@@ -168,7 +168,7 @@ const pack = function(L) {
const unpack = function(L) {
let i = lauxlib.luaL_optinteger(L, 2, 1);
- let e = lauxlib.luaL_opt(L, lauxlib.luaL_checkinteger, 3, lapi.lua_len(L, 1));
+ let e = lauxlib.luaL_opt(L, lauxlib.luaL_checkinteger, 3, lauxlib.luaL_len(L, 1));
if (i > e) return 0; /* empty range */
let n = e - i; /* number of elements minus 1 (avoid overflows) */
if (n >= Number.MAX_SAFE_INTEGER || !lapi.lua_checkstack(L, ++n))