activated - Whether to search the GC for the active function of the proto.
Examples
local function DummyFunction()
local function DummyProto1()
print("Hello")
end
local function DummyProto2()
print("Hello2")
end
end
debug.getproto(DummyFunction, 1)() -- Output: Hello
debug.getproto(DummyFunction, 2)() -- Output: Hello2
local function DummyFunction()
local function DummyProto()
return "hi"
end
return DummyProto
end
local RealProto = DummyFunction()
local RetrievedProto = debug.getproto(DummyFunction, 1, true)[1]
print(RealProto == RetrievedProto) -- Output: true
print(RetrievedProto()) -- Output: hilua