summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-04-10 08:36:43 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-04-10 08:36:43 +0200
commitea6717c46d26dfaded112b4f0bb9c7639ad8c337 (patch)
tree4cbe1c773adff725e9e113cb289b52d720bd9ec7
parentebf729d811e469b0cba66091ba5bbdc50b8fb670 (diff)
downloadfengari-ea6717c46d26dfaded112b4f0bb9c7639ad8c337.tar.gz
fengari-ea6717c46d26dfaded112b4f0bb9c7639ad8c337.tar.bz2
fengari-ea6717c46d26dfaded112b4f0bb9c7639ad8c337.zip
Fixed bad number comparison
-rw-r--r--src/lvm.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lvm.js b/src/lvm.js
index 6f49ad3..4786da4 100644
--- a/src/lvm.js
+++ b/src/lvm.js
@@ -751,11 +751,11 @@ const luaV_lessequal = function(L, l, r) {
const luaV_equalobj = function(L, t1, t2) {
if (t1.ttype() !== t2.ttype()) { /* not the same variant? */
- if (t1.ttnov() !== t2.ttnov() || t1.ttnov() !== CT.LUA_NUMBER)
+ if (t1.ttnov() !== t2.ttnov() || t1.ttnov() !== CT.LUA_TNUMBER)
return 0; /* only numbers can be equal with different variants */
else { /* two numbers with different variants */
/* compare them as integers */
- return Math.floor(t1.value) === Math.floor(t2.value); // TODO: tointeger
+ return Math.floor(t1.value) === Math.floor(t2.value) ? 1 : 0; // TODO: tointeger
}
}