summaryrefslogtreecommitdiff
path: root/src/lauxlib.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-05-28 11:54:09 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-05-28 11:54:09 +0200
commit03fa39649de945d5a392f460fd592f815534f69a (patch)
treee574b099dd5058be94fc9a3f5ab0f8bf878ea853 /src/lauxlib.js
parent8173e639527cffc583c9c6ad6e7fc0d43429ab50 (diff)
downloadfengari-03fa39649de945d5a392f460fd592f815534f69a.tar.gz
fengari-03fa39649de945d5a392f460fd592f815534f69a.tar.bz2
fengari-03fa39649de945d5a392f460fd592f815534f69a.zip
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.
Diffstat (limited to 'src/lauxlib.js')
-rw-r--r--src/lauxlib.js2
1 files changed, 1 insertions, 1 deletions
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;