diff options
Diffstat (limited to 'src/lobject.js')
-rw-r--r-- | src/lobject.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lobject.js b/src/lobject.js index b2cffe3..66a0dcb 100644 --- a/src/lobject.js +++ b/src/lobject.js @@ -556,8 +556,8 @@ const intarith = function(L, op, 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); + case lua.LUA_OPUNM: return (0 - v1); + case lua.LUA_OPBNOT: return (~0 ^ v1); } }; |