aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/ldebug.js3
-rw-r--r--tests/ldebug.js2
2 files changed, 2 insertions, 3 deletions
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);
};
diff --git a/tests/ldebug.js b/tests/ldebug.js
index ba5c966..fe6e83d 100644
--- a/tests/ldebug.js
+++ b/tests/ldebug.js
@@ -175,7 +175,7 @@ test('luaG_opinterror', function (t) {
}, "JS Lua program ran without error");
t.ok(
- lua.lua_tojsstring(L, -1).endsWith("attempt to perform arithmetic on a string value"),
+ lua.lua_tojsstring(L, -1).endsWith("attempt to perform arithmetic on a table value"),
"Correct error was thrown"
);
});