mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-05 19:31:04 +00:00
unset debug.getinfo
This commit is contained in:
parent
a2f98b1879
commit
5a422ca0c6
7 changed files with 22 additions and 10 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue