mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 00:25:19 +02:00
Fix debug.getinfo not being unset in CPCSM (#16506)
regression was introduced in eeb6cab
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
local builtin_shared = ...
|
||||
local debug_getinfo = debug.getinfo
|
||||
|
||||
do
|
||||
local default = {mod = "??", name = "??"}
|
||||
@@ -56,7 +57,7 @@ function builtin_shared.make_registration()
|
||||
core.callback_origins[func] = {
|
||||
-- may be nil or return nil
|
||||
mod = core.get_current_modname and core.get_current_modname() or "??",
|
||||
name = debug.getinfo(1, "n").name or "??"
|
||||
name = debug_getinfo(1, "n").name or "??"
|
||||
}
|
||||
end
|
||||
return t, registerfunc
|
||||
@@ -69,7 +70,7 @@ function builtin_shared.make_registration_reverse()
|
||||
core.callback_origins[func] = {
|
||||
-- may be nil or return nil
|
||||
mod = core.get_current_modname and core.get_current_modname() or "??",
|
||||
name = debug.getinfo(1, "n").name or "??"
|
||||
name = debug_getinfo(1, "n").name or "??"
|
||||
}
|
||||
end
|
||||
return t, registerfunc
|
||||
|
@@ -1,4 +1,4 @@
|
||||
local getinfo, rawget, rawset = debug.getinfo, rawget, rawset
|
||||
local debug_getinfo, rawget, rawset = debug.getinfo, rawget, rawset
|
||||
|
||||
function core.global_exists(name)
|
||||
if type(name) ~= "string" then
|
||||
@@ -18,7 +18,7 @@ function meta:__newindex(name, value)
|
||||
if declared[name] then
|
||||
return
|
||||
end
|
||||
local info = getinfo(2, "Sl")
|
||||
local info = debug_getinfo(2, "Sl")
|
||||
if info ~= nil then
|
||||
local desc = ("%s:%d"):format(info.short_src, info.currentline)
|
||||
local warn_key = ("%s\0%d\0%s"):format(info.source, info.currentline, name)
|
||||
@@ -36,7 +36,7 @@ function meta:__index(name)
|
||||
if declared[name] then
|
||||
return
|
||||
end
|
||||
local info = getinfo(2, "Sl")
|
||||
local info = debug_getinfo(2, "Sl")
|
||||
if info == nil then
|
||||
return
|
||||
end
|
||||
|
Reference in New Issue
Block a user