From f893be002aebd215b499b0c72803dd1346f4eb05 Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Fri, 24 Mar 2017 12:23:30 +0100 Subject: Fixed bad lua_tointegerx --- src/luaconf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/luaconf.js') diff --git a/src/luaconf.js b/src/luaconf.js index a965954..190893a 100644 --- a/src/luaconf.js +++ b/src/luaconf.js @@ -17,7 +17,7 @@ const LUAI_MAXSTACK = 1000000; const LUA_IDSIZE = 60; const lua_numbertointeger = function(n) { - return n; + return n >= Number.MIN_SAFE_INTEGER && n < -Number.MIN_SAFE_INTEGER ? n : 0; }; const LUA_INTEGER_FRMLEN = ""; -- cgit v1.2.3-54-g00ecf