From 3152eb68f451568ee547eef3772d0070642d9b2e Mon Sep 17 00:00:00 2001 From: Benoit Giannangeli Date: Fri, 14 Apr 2017 15:19:12 +0200 Subject: Fixed boolean comparison --- src/lobject.js | 2 +- src/lvm.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lobject.js b/src/lobject.js index aeaa105..78434ae 100644 --- a/src/lobject.js +++ b/src/lobject.js @@ -436,7 +436,7 @@ const l_str2d = function(s) { return null; let end = l_str2dloc(s, mode); /* try to convert */ if (end === null) { /* failed? may be a different locale */ - throw new Error("Locale not available to handle number"); // TODO + // throw new Error("Locale not available to handle number"); // TODO } return end; }; diff --git a/src/lvm.js b/src/lvm.js index a2a8feb..efbb7e7 100644 --- a/src/lvm.js +++ b/src/lvm.js @@ -775,9 +775,10 @@ const luaV_equalobj = function(L, t1, t2) { switch(t1.ttype()) { case CT.LUA_TNIL: return 1; + case CT.LUA_TBOOLEAN: + return t1.value == t2.value ? 1 : 0; // Might be 1 or true case CT.LUA_TNUMINT: case CT.LUA_TNUMFLT: - case CT.LUA_TBOOLEAN: case CT.LUA_TLCF: return t1.value === t2.value ? 1 : 0; case CT.LUA_TSHRSTR: -- cgit v1.2.3-70-g09d2