diff options
author | Benoit Giannangeli <giann008@gmail.com> | 2017-05-09 15:19:26 +0200 |
---|---|---|
committer | Benoit Giannangeli <giann008@gmail.com> | 2017-05-09 15:20:53 +0200 |
commit | 2b3a4790759168c4f17129f719f96f63a2c6765b (patch) | |
tree | f781ac366a71e0e1625cae200fbaebf32d36c9ae /src | |
parent | 8235d4e02fb6196886ed9162326eb46077291100 (diff) | |
download | fengari-2b3a4790759168c4f17129f719f96f63a2c6765b.tar.gz fengari-2b3a4790759168c4f17129f719f96f63a2c6765b.tar.bz2 fengari-2b3a4790759168c4f17129f719f96f63a2c6765b.zip |
lvm.tonumber should return the integer value
Diffstat (limited to 'src')
-rw-r--r-- | src/lvm.js | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -859,8 +859,10 @@ const tonumber = function(v) { if (v.ttnov() === CT.LUA_TNUMBER) return v.value; - if (v.ttnov() === CT.LUA_TSTRING) - return lobject.luaO_str2num(v.svalue()); + if (v.ttnov() === CT.LUA_TSTRING) { + let number = lobject.luaO_str2num(v.svalue()); + return number ? number.value : false; + } return false; }; |