summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lcode.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lcode.js b/src/lcode.js
index 8dbff2b..60b7452 100644
--- a/src/lcode.js
+++ b/src/lcode.js
@@ -950,7 +950,7 @@ const validop = function(op, v1, v2) {
switch (op) {
case defs.LUA_OPBAND: case defs.LUA_OPBOR: case defs.LUA_OPBXOR:
case defs.LUA_OPSHL: case defs.LUA_OPSHR: case defs.LUA_OPBNOT: { /* conversion errors */
- return (lvm.tointeger(v1) && lvm.tointeger(v2));
+ return (lvm.tointeger(v1) !== false && lvm.tointeger(v2) !== false);
}
case defs.LUA_OPDIV: case defs.LUA_OPIDIV: case defs.LUA_OPMOD: /* division by 0 */
return (v2.value !== 0);