summaryrefslogtreecommitdiff
path: root/src/lvm.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-05-21 20:44:31 +1000
committerdaurnimator <quae@daurnimator.com>2017-05-21 20:45:35 +1000
commit7b7775f9edd1fd68bb4f6ec975fc08985e898816 (patch)
treeb36d15d14c89503f342a99aca7b87f1602c97f09 /src/lvm.js
parent9bd802f91c02b7f9ed1241e7be1266a429ba0cf9 (diff)
downloadfengari-7b7775f9edd1fd68bb4f6ec975fc08985e898816.tar.gz
fengari-7b7775f9edd1fd68bb4f6ec975fc08985e898816.tar.bz2
fengari-7b7775f9edd1fd68bb4f6ec975fc08985e898816.zip
lua_numbertointeger should return false on failure
Found via behaviour of pushnumint in lmathlib
Diffstat (limited to 'src/lvm.js')
-rw-r--r--src/lvm.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lvm.js b/src/lvm.js
index dfb2ed5..3cf406a 100644
--- a/src/lvm.js
+++ b/src/lvm.js
@@ -801,8 +801,7 @@ const luaV_tointeger = function(obj, mode) {
f += 1; /* convert floor to ceil (remember: n !== f) */
}
- let res = luaconf.lua_numbertointeger(f);
- return res !== 0 ? res : (n === 0 ? 0 : false);
+ return luaconf.lua_numbertointeger(f);
} else if (obj.ttisinteger()) {
return obj.value;
} else if (obj.ttisstring()) {