From 6c6ac3ba0f454b64bb74cebd11252cac828ff854 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 10 Dec 2019 11:08:58 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E8=AF=8A=E6=96=AD=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E7=9A=84=E4=B8=80=E4=B8=AAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-beta/core/diagnostics/redundant-parameter.lua | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/script-beta/core/diagnostics/redundant-parameter.lua b/script-beta/core/diagnostics/redundant-parameter.lua index ec14188e..839dd182 100644 --- a/script-beta/core/diagnostics/redundant-parameter.lua +++ b/script-beta/core/diagnostics/redundant-parameter.lua @@ -67,13 +67,12 @@ return function (uri, callback) local func = source.node local funcArgs vm.eachDef(func, function (info) - if info.mode == 'value' then - local src = info.source - if src.type == 'function' then - local args = countFuncArgs(src) - if not funcArgs or args > funcArgs then - funcArgs = args - end + local src = info.source + local f = src.value + if f and f.type == 'function' then + local args = countFuncArgs(f) + if not funcArgs or args > funcArgs then + funcArgs = args end end end) -- cgit v1.2.3