From 03fa39649de945d5a392f460fd592f815534f69a Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Sun, 28 May 2017 11:54:09 +0200 Subject: lua_tonumberx lua_tonumber should return 0 if argument is not convertible to a number. But luaL_checknumber uses lua_tonumberx and tests isnum. -> lua_tonumberx return false if argument is not convertible to a number. --- src/lauxlib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lauxlib.js') diff --git a/src/lauxlib.js b/src/lauxlib.js index 0672c14..3851ee7 100644 --- a/src/lauxlib.js +++ b/src/lauxlib.js @@ -333,7 +333,7 @@ const interror = function(L, arg) { }; const luaL_checknumber = function(L, arg) { - let d = lua.lua_tonumber(L, arg); + let d = lua.lua_tonumberx(L, arg); if (d === false) tag_error(L, arg, lua.LUA_TNUMBER); return d; -- cgit v1.2.3-54-g00ecf