summaryrefslogtreecommitdiff
path: root/src/lobject.js
diff options
context:
space:
mode:
authorBenoit Giannangeli <giann008@gmail.com>2017-03-23 15:46:09 +0100
committerBenoit Giannangeli <giann008@gmail.com>2017-03-24 07:05:47 +0100
commitd3530bdc202419c85ec79fdb01197112cab8a788 (patch)
treef83dd6abe1a539a5085320d071ee4934950fb87b /src/lobject.js
parent4dc92d3e554278192c2979dd3d81942ca24f15b6 (diff)
downloadfengari-d3530bdc202419c85ec79fdb01197112cab8a788.tar.gz
fengari-d3530bdc202419c85ec79fdb01197112cab8a788.tar.bz2
fengari-d3530bdc202419c85ec79fdb01197112cab8a788.zip
strings.lua
Diffstat (limited to 'src/lobject.js')
-rw-r--r--src/lobject.js28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/lobject.js b/src/lobject.js
index 8fc587d..c2950b6 100644
--- a/src/lobject.js
+++ b/src/lobject.js
@@ -424,18 +424,18 @@ const luaO_int2fb = function(x) {
const intarith = function(L, op, v1, v2) {
switch (op) {
- case lua.LUA_OPADD: return (v1 + v2)|0;
- case lua.LUA_OPSUB: return (v1 - v2)|0;
- case lua.LUA_OPMUL: return (v1 * v2)|0;
- case lua.LUA_OPMOD: return (v1 % v2)|0;
- case lua.LUA_OPIDIV: return (v1 / v2)|0;
- case lua.LUA_OPBAND: return (v1 & v2)|0;
- case lua.LUA_OPBOR: return (v1 | v2)|0;
- case lua.LUA_OPBXOR: return (v1 ^ v2)|0;
- case lua.LUA_OPSHL: return (v1 << v2)|0;
- case lua.LUA_OPSHR: return (v1 >> v2)|0;
- case lua.LUA_OPUNM: return (-v1)|0;
- case lua.LUA_OPBNOT: return (~v1)|0;
+ case lua.LUA_OPADD: return (v1 + v2);
+ case lua.LUA_OPSUB: return (v1 - v2);
+ case lua.LUA_OPMUL: return (v1 * v2);
+ case lua.LUA_OPMOD: return (v1 % v2);
+ case lua.LUA_OPIDIV: return (v1 / v2);
+ case lua.LUA_OPBAND: return (v1 & v2);
+ case lua.LUA_OPBOR: return (v1 | v2);
+ case lua.LUA_OPBXOR: return (v1 ^ v2);
+ case lua.LUA_OPSHL: return (v1 << v2);
+ case lua.LUA_OPSHR: return (v1 >> v2);
+ case lua.LUA_OPUNM: return (-v1);
+ case lua.LUA_OPBNOT: return (~v1);
}
};
@@ -447,7 +447,7 @@ const numarith = function(L, op, v1, v2) {
case lua.LUA_OPMUL: return v1 * v2;
case lua.LUA_OPDIV: return v1 / v2;
case lua.LUA_OPPOW: return Math.pow(v1, v2);
- case lua.LUA_OPIDIV: return (v1 / v2)|0;
+ case lua.LUA_OPIDIV: return (v1 / v2);
case lua.LUA_OPUNM: return -v1;
case lua.LUA_OPMOD: return v1 % v2;
}
@@ -465,4 +465,4 @@ module.exports.luaO_hexavalue = luaO_hexavalue;
module.exports.luaO_int2fb = luaO_int2fb;
module.exports.luaO_str2num = luaO_str2num;
module.exports.luaO_utf8desc = luaO_utf8desc;
-module.exports.numarith = numarith; \ No newline at end of file
+module.exports.numarith = numarith;