diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/src/core/diagnostics.lua | 12 | ||||
-rw-r--r-- | server/test/diagnostics/init.lua | 7 |
2 files changed, 19 insertions, 0 deletions
diff --git a/server/src/core/diagnostics.lua b/server/src/core/diagnostics.lua index 16132bee..93cf34d9 100644 --- a/server/src/core/diagnostics.lua +++ b/server/src/core/diagnostics.lua @@ -219,6 +219,18 @@ function mt:searchRedundantParameters(callback) return end + -- 回调函数不检查 + local simple = source:get 'simple' + if simple and simple[2] == source then + local loc = simple[1]:bindLocal() + if loc then + local source = loc:getSource() + if source:get 'arg' then + return + end + end + end + local value = source:findCallFunction() if not value then return diff --git a/server/test/diagnostics/init.lua b/server/test/diagnostics/init.lua index cb842f71..eec4bf36 100644 --- a/server/test/diagnostics/init.lua +++ b/server/test/diagnostics/init.lua @@ -233,6 +233,13 @@ next({}, 1, <!2!>) print(1, 2, 3, 4, 5) ]] +TEST [[ +local function f(callback) + callback(1, 2, 3) +end +f(function () end) +]] + --TEST [[ --local realTostring = tostring --tostring = function () end |