From 2951276b31e04d7bff330b5c7af42d87cf766cd0 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Fri, 5 May 2017 14:08:13 +1000 Subject: src/ldebug.js: Fix incorrect error messages Previously could get odd things, e.g. `1-nil` would throw: > attempt to perform arithmetic on a number value --- src/ldebug.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/ldebug.js b/src/ldebug.js index b411e0a..50625e5 100644 --- a/src/ldebug.js +++ b/src/ldebug.js @@ -551,8 +551,7 @@ const luaG_concaterror = function(L, p1, p2) { ** Error when both values are convertible to numbers, but not to integers */ const luaG_opinterror = function(L, p1, p2, msg) { - let temp = lvm.tonumber(p1); - if (temp !== false) + if (lvm.tonumber(p1) === false) p2 = p1; luaG_typeerror(L, p2, msg); }; -- cgit v1.2.3-70-g09d2