mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 12:20:41 +00:00
don't check imported function in snax.hotfix
This commit is contained in:
@@ -4,6 +4,7 @@ Dev version
|
|||||||
* bugfix: service exit before init would not report back
|
* bugfix: service exit before init would not report back
|
||||||
* add skynet.response and check multicall skynet.ret
|
* add skynet.response and check multicall skynet.ret
|
||||||
* skynet.newservice throw error when lanuch faild
|
* skynet.newservice throw error when lanuch faild
|
||||||
|
* Don't check imported function in snax.hotfix
|
||||||
|
|
||||||
v0.5.0 (2014-7-28)
|
v0.5.0 (2014-7-28)
|
||||||
-----------
|
-----------
|
||||||
|
|||||||
@@ -3,7 +3,21 @@ local io = io
|
|||||||
|
|
||||||
local hotfix = {}
|
local hotfix = {}
|
||||||
|
|
||||||
local function collect_uv(f , uv)
|
local function envid(f)
|
||||||
|
local i = 1
|
||||||
|
while true do
|
||||||
|
local name, value = debug.getupvalue(f, i)
|
||||||
|
if name == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if name == "_ENV" then
|
||||||
|
return debug.upvalueid(f, i)
|
||||||
|
end
|
||||||
|
i = i + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
local function collect_uv(f , uv, env)
|
||||||
local i = 1
|
local i = 1
|
||||||
while true do
|
while true do
|
||||||
local name, value = debug.getupvalue(f, i)
|
local name, value = debug.getupvalue(f, i)
|
||||||
@@ -18,7 +32,9 @@ local function collect_uv(f , uv)
|
|||||||
uv[name] = { func = f, index = i, id = id }
|
uv[name] = { func = f, index = i, id = id }
|
||||||
|
|
||||||
if type(value) == "function" then
|
if type(value) == "function" then
|
||||||
collect_uv(value, uv)
|
if envid(value) == env then
|
||||||
|
collect_uv(value, uv, env)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -30,7 +46,7 @@ local function collect_all_uv(funcs)
|
|||||||
local global = {}
|
local global = {}
|
||||||
for _, v in pairs(funcs) do
|
for _, v in pairs(funcs) do
|
||||||
if v[4] then
|
if v[4] then
|
||||||
collect_uv(v[4], global)
|
collect_uv(v[4], global, envid(v[4]))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user