diff --git a/res/scripts/stdlib.lua b/res/scripts/stdlib.lua index 3729d516..ce036a48 100644 --- a/res/scripts/stdlib.lua +++ b/res/scripts/stdlib.lua @@ -531,9 +531,15 @@ local removed_names = { "getregistry", "getupvalue", "setupvalue", "upvalueid", "upvaluejoin", "sethook", "gethook", "getinfo" } +local _getinfo = debug.getinfo for i, name in ipairs(removed_names) do debug[name] = nil end +debug.getinfo = function(...) + local debuginfo = _getinfo(...) + debuginfo.func = nil + return debuginfo +end -- --------- Deprecated functions ------ -- local function wrap_deprecated(func, name, alternatives)