From 3033341b741cfb256baf91acf1f257a7f1ed6f7b Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Thu, 9 Nov 2017 11:30:46 +0100 Subject: src/ltablib.js: sort max interval should be LUA_MAXINTEGER Closes #1 --- src/ltablib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ltablib.js b/src/ltablib.js index 6d89acd..05c9c09 100644 --- a/src/ltablib.js +++ b/src/ltablib.js @@ -291,7 +291,7 @@ const auxsort = function(L, lo, up, rnd) { const sort = function(L) { let n = aux_getn(L, 1, TAB_RW); if (n > 1) { /* non-trivial interval? */ - lauxlib.luaL_argcheck(L, n < Number.MAX_SAFE_INTEGER, 1, lua.to_luastring("array too big", true)); + lauxlib.luaL_argcheck(L, n < luaconf.LUA_MAXINTEGER, 1, lua.to_luastring("array too big", true)); if (!lua.lua_isnoneornil(L, 2)) /* is there a 2nd argument? */ lauxlib.luaL_checktype(L, 2, lua.LUA_TFUNCTION); /* must be a function */ lua.lua_settop(L, 2); /* make sure there are two arguments */ -- cgit v1.2.3-54-g00ecf