From 656758c86ad929b07bb6422eb0f44cf9f2347aac Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Mon, 24 Apr 2017 12:01:42 +0200 Subject: Use maximum 32bit number instead of Number.MAX_SAFE_INTEGER --- src/luaconf.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/luaconf.js') diff --git a/src/luaconf.js b/src/luaconf.js index 3314d5c..803bb90 100644 --- a/src/luaconf.js +++ b/src/luaconf.js @@ -1,6 +1,8 @@ /*jshint esversion: 6 */ "use strict"; +const llimit = require('./llimit.js'); + /* @@ LUAI_MAXSTACK limits the size of the Lua stack. ** CHANGE it if you need a different limit. This limit is arbitrary; @@ -17,7 +19,7 @@ const LUAI_MAXSTACK = 1000000; const LUA_IDSIZE = 60; const lua_numbertointeger = function(n) { - return n >= Number.MIN_SAFE_INTEGER && n < -Number.MIN_SAFE_INTEGER ? n : 0; + return n >= llimit.MIN_INT && n < -llimit.MIN_INT ? n : 0; }; const LUA_INTEGER_FRMLEN = ""; -- cgit v1.2.3-54-g00ecf