aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-04-26 10:39:40 +0200
committerBenoit Giannangeli <giann008@gmail.com>2017-04-26 11:41:21 +0200
commit3742b1dbf24d25e6de561e688789e1bcabd2c3f6 (patch)
tree392bedce2b088dc8a1af00112914b7f19e14a744
parent8c355bd8579a9999a404bd00363b0545f10c6359 (diff)
downloadfengari-3742b1dbf24d25e6de561e688789e1bcabd2c3f6.tar.gz
fengari-3742b1dbf24d25e6de561e688789e1bcabd2c3f6.tar.bz2
fengari-3742b1dbf24d25e6de561e688789e1bcabd2c3f6.zip
Added missin |0
-rw-r--r--src/lobject.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lobject.js b/src/lobject.js
index c15101a..bd65ea8 100644
--- a/src/lobject.js
+++ b/src/lobject.js
@@ -463,7 +463,7 @@ const l_str2int = function(s) {
if (empty || (s.length > 0 && s[0] !== 0)) return null; /* something wrong in the numeral */
else {
- return neg ? -a : a;
+ return (neg ? -a : a)|0;
}
};
@@ -534,7 +534,7 @@ const intarith = function(L, op, v1, v2) {
case defs.LUA_OPBXOR: return (v1 ^ v2);
case defs.LUA_OPSHL: return (v1 << v2);
case defs.LUA_OPSHR: return (v1 >> v2);
- case defs.LUA_OPUNM: return (0 - v1);
+ case defs.LUA_OPUNM: return (0 - v1)|0;
case defs.LUA_OPBNOT: return (~0 ^ v1);
}
};