Content deleted Content added
m cleanup |
testing code |
||
Line 99:
return childFrame
end
--[[ Note
Scribunto really doesn't want or like you doing things like what this function
aims to do (basically "hook" _G), and the outputs are completely not what you
would expect from the below code. Unsure how much of this is exactly "intended"
--]]
function p.globalExperiments()
local _log = mw.log
local _tostring = tostring
local _type = type
local _next = next
local _pairs = pairs
local _rawset = rawset
local scanned = {}
local function recursive(t, path)
scanned[t] = true
for a,b in _next,t do
--for a,b in _pairs(t) do
if _type(b) == "table" and not scanned[b] then
recursive(b, path .. _tostring(a) .. ".")
elseif _type(b) == "function" then
_rawset(t, a, function(...)
_log("(GHook) Just accessed " .. path .. _tostring(a))
return b(...)
end)
_log("(GHook) Hooked " .. path .. _tostring(a))
end
end
end
recursive(_G, "")
end
|