diff --git a/res/scripts/stdlib.lua b/res/scripts/stdlib.lua index 8915c2b1..0765199e 100644 --- a/res/scripts/stdlib.lua +++ b/res/scripts/stdlib.lua @@ -523,6 +523,15 @@ function time.post_runnable(runnable) table.insert(__post_runnables, runnable) end +-- Hide unsafe debug.* functions +local removed_names = { + "getregistry", "getupvalue", "setupvalue", "upvalueid", "upvaluejoin", + "sethook", "gethook", "getinfo" +} +for i, name in ipairs(removed_names) do + debug[name] = nil +end + -- --------- Deprecated functions ------ -- local function wrap_deprecated(func, name, alternatives) return function (...)