From d0018d43f46d3c32508094a3a3c2e73cc6acf3ff Mon Sep 17 00:00:00 2001 From: daurnimator Date: Tue, 30 May 2017 17:13:43 +1000 Subject: src/lbaselib.js: Fix misleading error message from collectgarbage() --- src/lbaselib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lbaselib.js b/src/lbaselib.js index 04a5e8d..b2a9951 100644 --- a/src/lbaselib.js +++ b/src/lbaselib.js @@ -92,7 +92,7 @@ const opts = ["stop", "restart", "collect", "isrunning"].map((e) => lua.to_luastring(e)); const luaB_collectgarbage = function(L) { lauxlib.luaL_checkoption(L, 1, lua.to_luastring("collect"), opts); - lauxlib.luaL_checkinteger(L, 2); + lauxlib.luaL_optinteger(L, 2, 0); lauxlib.luaL_error(L, lua.to_luastring("lua_gc not implemented")); }; -- cgit v1.2.3-70-g09d2