summaryrefslogtreecommitdiff
path: root/src/lvm.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/lvm.js')
-rw-r--r--src/lvm.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lvm.js b/src/lvm.js
index eba7d38..376e64e 100644
--- a/src/lvm.js
+++ b/src/lvm.js
@@ -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;
};